Hello everyone.
Recently, I wanted to restore SST to the climatology in the specified region. So, I modified the code 'forcing_coupled.F90' in POP source code. After modification, the model can run without any errors and the SST can be restored correctly. Unfortunately ,due to some casual issues, the run was killed in the model time 0007-02-15. Then, I switched 'CONTINUE_RUN' to 'TRUE' to restart this run from restart file 0007-01-01. However, in the restart run, I found the output data values are different from the previous run which is not killed during model time 0007-01 (even if the differences are marginal). I don't know why the output data values are different. Can anyone give me some advice? Thank you in advance!
In the code 'forcing_coupled.F90', I modified the codes after calculating STF(:,:,i,iblock):
Recently, I wanted to restore SST to the climatology in the specified region. So, I modified the code 'forcing_coupled.F90' in POP source code. After modification, the model can run without any errors and the SST can be restored correctly. Unfortunately ,due to some casual issues, the run was killed in the model time 0007-02-15. Then, I switched 'CONTINUE_RUN' to 'TRUE' to restart this run from restart file 0007-01-01. However, in the restart run, I found the output data values are different from the previous run which is not killed during model time 0007-01 (even if the differences are marginal). I don't know why the output data values are different. Can anyone give me some advice? Thank you in advance!
In the code 'forcing_coupled.F90', I modified the codes after calculating STF(:,:,i,iblock):
Code:
!$OMP PARALLEL DO PRIVATE(iblock)
do iblock = 1, nblocks_clinic
STF(:,:,1,iblock) = (EVAP_F(:,:,iblock)*latent_heat_vapor_mks &
+ SENH_F(:,:,iblock) + LWUP_F(:,:,iblock) &
+ LWDN_F(:,:,iblock) + MELTH_F(:,:,iblock) &
-(SNOW_F(:,:,iblock)+IOFF_F(:,:,iblock)) * latent_heat_fusion_mks)* &
RCALCT(:,:,iblock)*hflux_factor
enddo
! The following codes are which I modified:
real (r8), dimension(1:320,1:384,1:365) :: &
SST_RES
real (r8), dimension(1:320,1:384) :: &
lat_RES
real (r8), dimension(1:320,1:384) :: &
lon_RES
real (r8) :: &
tlatd, &
tlond, &
relfac, &
relfac1, &
relfac2, &
tau_RES, &
Tm_POP
real (r8) :: &
Tr_RES
integer (int_kind) :: &
ilon, &
jlat, &
status_RES, &
ncid_RES, &
varid_RES, &
i_RES, &
j_RES
tau_RES = 10.*24.*3600.
status_RES = nf90_open("/scratch/gaba/CESM/CESM2.0/CESM2_Out/clm100yrsmni.nc",nf90_nowrite,ncid_RES)
status_RES = nf90_inq_varid(ncid_RES,"sst",varid_RES)
status_RES = nf90_get_var(ncid_RES,varid_RES,SST_RES)
status_RES = nf90_inq_varid(ncid_RES,"lat",varid_RES)
status_RES = nf90_get_var(ncid_RES,varid_RES,lat_RES)
status_RES = nf90_inq_varid(ncid_RES,"lon",varid_RES)
status_RES = nf90_get_var(ncid_RES,varid_RES,lon_RES)
status_RES = nf90_close(ncid_RES)
do iblock=1,nblocks_clinic
do jlat=1,ny_block
do ilon=1,nx_block
tlatd = TLAT(ilon,jlat,iblock)*radian
tlond = TLON(ilon,jlat,iblock)*radian
if (tlatd.gt.-20. .and. tlatd.lt.20. .and. tlond.gt.40. .and. tlond.lt.100.) then
relfac1 = 1.0
relfac2 = 1.0
if (tlatd.lt.-15. .or. tlatd.gt.15.) then
relfac1 = ABS((ABS(tlatd)-20.))*0.2
endif
if (tlond.lt.45. .or. tlond.gt.95.) then
relfac2 = ABS((ABS(tlond-70.)-30.))*0.2
endif
relfac = MIN(relfac1,relfac2)
do i_RES=1,320 ! lon
do j_RES=1,384 ! lat
if ( lat_RES(i_RES,j_RES).eq.tlatd .and. lon_RES(i_RES,j_RES).eq.tlond ) then
Tr_RES = SST_RES(i_RES,j_RES,iday_of_year)
Tm_POP = TRACER(ilon,jlat,1,1,curtime,iblock)
STF(ilon,jlat,1,iblock) = STF(ilon,jlat,1,iblock) + relfac*(Tr_RES+1.-Tm_POP)*HMXL(ilon,jlat,iblock)/tau_RES
endif
end do
end do
endif
end do
end do
end do
!$OMP END PARALLEL DO