When I tried to restart from 'ocean_his.nc' file with WET_DRY,
'wetdry_mask_psi' data was required with error message.
Maybe this request is related to recent modification of wetting & drying algorithm.
The 'wetdry_mask_psi' recording codes for 'ocean_rst.nc' has been already incorporated,
so to restart from 'ocean_rst.nc' has been no problem.
But the 'wetdry_mask_psi' recording codes for 'ocean_his.nc' has not been incorporated.
Thus, if we want to restart from 'ocean_his.nc' with WET_DRY,
we need to add the codes in def_his.F according to the manner of def_rst.F.
In my solution, firstly add the declaration statement to line 55 in def_his.F:
Code: Select all
integer :: p2dgrd(3)
Code: Select all
!
! Define dimension vectors for staggered type variables at PSI-points.
!
p2dgrd(1)=DimIDs( 4)
p2dgrd(2)=DimIDs( 8)
p2dgrd(3)=DimIDs(12)
Code: Select all
!
! Define wet/dry mask on PSI-points.
!
Vinfo( 1)=Vname(1,idPwet)
Vinfo( 2)=Vname(2,idPwet)
Vinfo( 3)=Vname(3,idPwet)
Vinfo( 9)='land'
Vinfo(10)='water'
Vinfo(14)=Vname(4,idPwet)
Vinfo(16)=Vname(1,idtime)
Vinfo(22)='coordinates'
Aval(5)=REAL(Iinfo(1,idPwet,ng),r8)
status=def_var(ng, iNLM, HIS(ng)%ncid, HIS(ng)%Vid(idPwet), &
& NF_FOUT, nvd3, p2dgrd, Aval, Vinfo, ncname, &
& SetFillVal = .FALSE.)
IF (exit_flag.ne.NoError) RETURN
Code: Select all
!
! Write out wet/dry mask at PSI-points.
!
scale=1.0_r8
gtype=gfactor*p2dvar
status=nf_fwrite2d(ng, iNLM, HIS(ng)%ncid, HIS(ng)%Vid(idPwet), &
& HIS(ng)%Rindex, gtype, &
& LBi, UBi, LBj, UBj, scale, &
# ifdef MASKING
& GRID(ng) % pmask, &
# endif
& GRID(ng) % pmask_wet, &
& SetFillVal = .FALSE.)
IF (status.ne.nf90_noerr) THEN
IF (Master) THEN
WRITE (stdout,10) TRIM(Vname(1,idPwet)), HIS(ng)%Rindex
END IF
exit_flag=3
ioerror=status
RETURN
END IF