Closed HCJung-jbnu closed 11 months ago
- sm 5 test : 1997 sat vapor error ( 19960101 -> 1997 run success <- ncep clim atm forcing)
- sm 20 test : 1994년 maximum temp blowup
- sm 10 test : 1994년 bgc error(NaN)
- sm 2 test : 1995년 bgc error(NaN)
ERA5 고해상도(0.25도)와 MOM-TOPAZ(약1도)의 해상도 차이때문인지?
USE netcdf
IMPLICIT NONE
INCLUDE 'netcdf.inc'
INTEGER :: stats INTEGER :: ncid, varid INTEGER :: nlon, nlat, ntime INTEGER :: xtype
INTEGER :: i, j, t, cnt
CHARACTER(LEN=100) :: nc_filename CHARACTER(LEN=50) :: lon_name, lat_name, time_name, vname
REAL, ALLOCATABLE, DIMENSION(:,:,:) :: data
nc_filename = 'temp.nc'
stats = NF90_OPEN(TRIM(nc_filename), NF90_WRITE, ncid) IF ( stats .NE. 0 ) PRINT*,'ERA5 file open error'
stats = NF90_INQUIRE_DIMENSION(ncid, 2, lon_name, nlon) IF ( stats .NE. 0 ) PRINT,'ERA5 inquire lon info error' print,'lon info : ', TRIM(lon_name), nlon
stats = NF90_INQUIRE_DIMENSION(ncid, 3, lat_name, nlat) IF ( stats .NE. 0 ) PRINT,'ERA5 inquire lat info error' print,'lat info : ', TRIM(lat_name), nlat
stats = NF90_INQUIRE_DIMENSION(ncid, 1, time_name, ntime) IF ( stats .NE. 0 ) PRINT,'ERA5 inquire time info error' print,'time info : ', TRIM(time_name), ntime
ALLOCATE(data(nlon,nlat,ntime)); data=0.0
stats = NF90_INQUIRE_VARIABLE(ncid, 4, vname) IF ( stats .NE. 0 ) PRINT,'ERA5 inquire vname info error' print,'var info : ', TRIM(vname)
stats = NF90_INQ_VARID(ncid, TRIM(vname), varid) IF ( stats .NE. 0 ) PRINT,'ERA5 inquire varid info error' print,'varid info : ', varid
stats = NF90_GET_VAR(ncid, varid, data) IF ( stats .NE. 0 ) PRINT*,'ERA5 get data error'
DO cnt = 1, 5
DO t = 1, ntime
!left(west) side of global map i = 1; j = 1 data(i,j,t) = ( data(i,j,t) + data(i+1,j,t) + data(i,j+1,t) + data(nlon,j,t) ) / 4.0 i = 1; j = nlat data(i,j,t) = ( data(i,j,t) + data(i,j-1,t) + data(i+1,j,t) + data(nlon,j,t) ) / 4.0 i = 1 DO j = 2, nlat-1 data(i,j,t) = ( data(i,j,t) + data(i,j-1,t) + data(i+1,j,t) + data(i,j+1,t) + data(nlon,j,t) ) / 5.0 END DO
!bottom(south) side of global map i = nlon; j = 1 data(i,j,t) = ( data(i,j,t) + data(1,j,t) + data(i,j+1,t) + data(i-1,j,t) ) / 4.0 j = 1 DO i = 2, nlon-1 data(i,j,t) = ( data(i,j,t) + data(i+1,j,t) + data(i,j+1,t) + data(i-1,j,t) ) / 4.0 END DO
!right(east) side of global map i = nlon; j = nlat data(i,j,t) = ( data(i,j,t) + data(i,j-1,t) + data(1,j,t) + data(i-1,j,t) ) / 4.0 i = nlon DO j = 2, nlat-1 data(i,j,t) = ( data(i,j,t) + data(i,j-1,t) + data(1,j,t) + data(i,j+1,t) + data(i-1,j,t) ) / 5.0 END DO
!top(north) side of global map j = nlat DO i = 2, nlon-1 data(i,j,t) = ( data(i,j,t) + data(i,j-1,t) + data(i+1,j,t) + data(i-1,j,t) ) / 4.0 END DO
!center of global map DO j = 2, nlat-1 DO i = 2, nlon-1 data(i,j,t) = ( data(i,j,t) + data(i,j-1,t) + data(i+1,j,t) + data(i,j+1,t) + data(i-1,j,t) ) / 5.0 END DO END DO
END DO
END DO
stats = NF90_PUT_VAR(ncid, varid, data) IF ( stats .NE. 0 ) PRINT*,'ERA5 put data error'
stats = NF90_CLOSE(ncid) IF ( stats .NE. 0 ) PRINT*,'ERA5 file close error'
END PROGRAM ERA5_smoother
ifort -O3 -L/opt/kma/kma_lib/apps/netcdf-fortran/4.5.2/INTEL/210/lib -lnetcdff -I/opt/kma/kma_lib/apps/netcdf-fortran/4.5.2/INTEL/210/include ERA5_smoother.F90 -o ERA5_smoother.exe