Skip to content

Commit

Permalink
Merge pull request #1040 from GEOS-ESM/bugfix/zhaobin74/a-few-fixes-D…
Browse files Browse the repository at this point in the history
…ataAtm

a few fixes to DataAtm with corrections to SW, SH and EVAP etc.
  • Loading branch information
sdrabenh authored Jan 7, 2025
2 parents fa9a559 + 580aeba commit 6195266
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions GEOSdataatm_GridComp/GEOS_DataAtmGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ subroutine SetServices ( GC, RC )
LONG_NAME = 'surface_temperature', &
UNITS = 'K', &
DIMS = MAPL_DimsHorzOnly, &
DEFAULT = -1000.0, &
VLOCATION = MAPL_VLocationNone, __RC__)

call MAPL_AddInternalSpec(GC, &
Expand Down Expand Up @@ -424,6 +425,7 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
real, dimension(:,:), pointer :: ALW, BLW, SPEED, DISCHARGE, rPCU, rPLS, sSNO
real, dimension(:,:), pointer :: CT, CQ, CM, SH, EVAP, TAUX, TAUY, Tskin, lwdnsrf
real, dimension(:,:), pointer :: DRPARN, DFPARN, DRNIRN, DFNIRN, DRUVRN, DFUVRN
real, dimension(:,:), pointer :: DSH, DEVAP
real, dimension(:,:), pointer :: EMISSRF

real, allocatable, dimension(:,:) :: ZTH
Expand Down Expand Up @@ -479,7 +481,7 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
! real LATSO, LONSO

real, parameter :: HW_hack = 2.
logical :: firsttime = .true.
logical :: firsttime = .false.

real :: TAU_TS
real :: DT
Expand Down Expand Up @@ -614,11 +616,13 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
call SetVarToZero('DEWL', __RC__)
call SetVarToZero('FRSL', __RC__)

call MAPL_GetPointer(SurfImport, DSH, 'DSH', __RC__)
call MAPL_GetPointer(SurfImport, DEVAP, 'DEVAP', __RC__)
! these should be set to 0 (for now)
call SetVarToZero('DSH', __RC__)
!call SetVarToZero('DSH', __RC__)
call SetVarToZero('DFU', __RC__)
call SetVarToZero('DFV', __RC__)
call SetVarToZero('DEVAP', __RC__)
!call SetVarToZero('DEVAP', __RC__)
call SetVarToZero('DDEWL', __RC__)
call SetVarToZero('DFRSL', __RC__)

Expand Down Expand Up @@ -658,7 +662,10 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
!------------------------------------------------------

call ESMF_ClockGet(CLOCK, TIMESTEP=DELT, __RC__)
DELT = DELT * NINT((86400./DT)) ! emulate daily Solar
! the line below only works for daily forcing e..g. CORE I
! for JRA55-DO or any dataset at higher frequency, this line makes SW much
! higher than what data prescribed
!DELT = DELT * NINT((86400./DT)) ! emulate daily Solar

call MAPL_SunGetInsolation(LONS, LATS, &
ORBIT, ZTH, SLR, &
Expand Down Expand Up @@ -716,6 +723,10 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_GetPointer(SurfImport, ALW, 'ALW', __RC__)
call MAPL_GetPointer(SurfImport, BLW, 'BLW', __RC__)

if(any(Tskin<0.0)) then !only when DATAATM restart is bootstrapped
firsttime = .true.
end if

if (firsttime) then
firsttime = .false.
Tskin = TA
Expand Down Expand Up @@ -773,6 +784,10 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
TAUX = CM * (Uskin - Uair)
TAUY = CM * (Vskin - Vair)

! these derivatives are important for sea ice
DSH = CT !* MAPL_CP (MAPL_CP got multiplied in Surf)
DEVAP = CQ

101 format (A, e20.12, 3I3.2)

!!! if (mapl_am_i_root()) PRINT*, __FILE__, __LINE__
Expand Down

0 comments on commit 6195266

Please sign in to comment.