! +-======-+ ! Copyright (c) 2003-2007 United States Government as represented by ! the Admistrator of the National Aeronautics and Space Administration. ! All Rights Reserved. ! ! THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, ! REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN ! COMPUTER SOFTWARE ORIGINALLY RELEASED BY THE UNITED STATES GOVERNMENT AS ! REPRESENTED BY THE GOVERNMENT AGENCY LISTED BELOW ("GOVERNMENT AGENCY"). ! THE UNITED STATES GOVERNMENT, AS REPRESENTED BY GOVERNMENT AGENCY, IS AN ! INTENDED THIRD-PARTY BENEFICIARY OF ALL SUBSEQUENT DISTRIBUTIONS OR ! REDISTRIBUTIONS OF THE SUBJECT SOFTWARE. ANYONE WHO USES, REPRODUCES, ! DISTRIBUTES, MODIFIES OR REDISTRIBUTES THE SUBJECT SOFTWARE, AS DEFINED ! HEREIN, OR ANY PART THEREOF, IS, BY THAT ACTION, ACCEPTING IN FULL THE ! RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS AGREEMENT. ! ! Government Agency: National Aeronautics and Space Administration ! Government Agency Original Software Designation: GSC-15354-1 ! Government Agency Original Software Title: GEOS-5 GCM Modeling Software ! User Registration Requested. Please Visit http://opensource.gsfc.nasa.gov ! Government Agency Point of Contact for Original Software: ! Dale Hithon, SRA Assistant, (301) 286-2691 ! ! +-======-+ ! $Id: GEOS_mkiauGridComp.F90,v 1.4 2009-10-28 18:31:24 ltakacs Exp $ #include "MAPL_Generic.h" !============================================================================= !BOP ! !MODULE: GEOS_mkiau -- A Module to compute the IAU forcing ! !INTERFACE: module GEOS_mkiauGridCompMod ! !USES: use ESMF_Mod use MAPL_Mod implicit none private ! !PUBLIC MEMBER FUNCTIONS: public SetServices !============================================================================= ! !DESCRIPTION: ! ! !EOP contains !BOP ! ! IROUTINE: SetServices -- Sets ESMF services for this component ! ! INTERFACE: subroutine SetServices ( GC, RC ) ! ! ARGUMENTS: type(ESMF_GridComp), intent(INOUT) :: GC ! gridded component integer, optional :: RC ! return code ! ! DESCRIPTION: This version uses the MAPL_GenericSetServices. This function sets ! the Initialize and Finalize services, as well as allocating ! our instance of a generic state and putting it in the ! gridded component (GC). Here we only need to set the run method and ! add the state variable specifications (also generic) to our instance ! of the generic state. This is the way our true state variables get into ! the ESMF_State INTERNAL, which is in the MAPL_MetaComp. !EOP !============================================================================= ! ! ErrLog Variables character(len=ESMF_MAXSTR) :: IAm integer :: STATUS character(len=ESMF_MAXSTR) :: COMP_NAME character(len=ESMF_MAXSTR) :: uname,vname,tname,qname,psname,dpname,o3name type (MAPL_MetaComp), pointer :: MAPL !============================================================================= ! Begin... ! Get my name and set-up traceback handle ! --------------------------------------- Iam = 'SetServices' call ESMF_GridCompGet( GC, NAME=COMP_NAME, RC=STATUS ) VERIFY_(STATUS) Iam = trim(COMP_NAME) // Iam ! Retrieve the pointer to the state !---------------------------------- call MAPL_GetObjectFromGC ( GC, MAPL, RC=STATUS) VERIFY_(STATUS) ! Set the Run entry point ! ----------------------- call MAPL_GridCompSetEntryPoint ( gc, ESMF_SETRUN, Run, & RC=STATUS) VERIFY_(STATUS) ! Set the state variable specs. ! ----------------------------- ! !IMPORT STATE: call MAPL_AddImportSpec(GC, & SHORT_NAME = 'PLE', & LONG_NAME = 'air_pressure', & UNITS = 'Pa', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationEdge, & RC=STATUS ) VERIFY_(STATUS) call MAPL_AddImportSpec ( gc, & SHORT_NAME = 'T', & LONG_NAME = 'air_temperature', & UNITS = 'K', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) call MAPL_AddImportSpec(GC, & SHORT_NAME = 'U', & LONG_NAME = 'eastward_wind', & UNITS = 'm s-1', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, & RC=STATUS ) VERIFY_(STATUS) call MAPL_AddImportSpec(GC, & SHORT_NAME = 'V', & LONG_NAME = 'northward_wind', & UNITS = 'm s-1', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, & RC=STATUS ) VERIFY_(STATUS) call MAPL_AddImportSpec(GC, & SHORT_NAME = 'O3PPMV', & LONG_NAME = 'ozone_volume_mixing_ratio', & UNITS = 'ppmv', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, & RC=STATUS ) VERIFY_(STATUS) ! we need the analysis tracers' bundle (for QV and O3) call MAPL_AddImportSpec(GC, & SHORT_NAME = 'TRANA', & LONG_NAME = 'analyzed_quantities', & UNITS = 'X', & DATATYPE = MAPL_BundleItem, & RC=STATUS ) VERIFY_(STATUS) ! !EXPORT STATE: call MAPL_AddExportSpec ( gc, & SHORT_NAME = 'DUDT', & LONG_NAME = 'eastward_wind_analysis_increment', & UNITS = 'm s-1', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) call MAPL_AddExportSpec ( gc, & SHORT_NAME = 'DVDT', & LONG_NAME = 'northward_wind_analysis_increment', & UNITS = 'm s-1', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) call MAPL_AddExportSpec ( gc, & SHORT_NAME = 'DTDT', & LONG_NAME = 'temperature_analysis_increment', & UNITS = 'K', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) call MAPL_AddExportSpec ( gc, & SHORT_NAME = 'DPEDT', & LONG_NAME = 'edge_pressure_analysis_increment', & UNITS = 'Pa', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationEdge, RC=STATUS ) VERIFY_(STATUS) call MAPL_AddExportSpec ( gc, & SHORT_NAME = 'DQVDT', & LONG_NAME = 'specific_humidity_analysis_increment', & UNITS = 'kg kg-1', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) call MAPL_AddExportSpec ( gc, & SHORT_NAME = 'DO3DT', & LONG_NAME = 'ozone_analysis_increment', & UNITS = 'ppmv', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) ! Internal State ! -------------- call MAPL_GetResource(MAPL, psname, Label="REPLAY_PSNAME:", Default="ps", RC=status ) VERIFY_(STATUS) call MAPL_GetResource(MAPL, dpname, Label="REPLAY_DPNAME:", Default="delp", RC=status ) VERIFY_(STATUS) call MAPL_GetResource(MAPL, uname, Label="REPLAY_UNAME:", Default="u", RC=status ) VERIFY_(STATUS) call MAPL_GetResource(MAPL, vname, Label="REPLAY_VNAME:", Default="v", RC=status ) VERIFY_(STATUS) call MAPL_GetResource(MAPL, tname, Label="REPLAY_TNAME:", Default="theta", RC=status ) VERIFY_(STATUS) call MAPL_GetResource(MAPL, qname, Label="REPLAY_QNAME:", Default="sphu", RC=status ) VERIFY_(STATUS) call MAPL_GetResource(MAPL, o3name, Label="REPLAY_O3NAME:", Default="ozone", RC=status ) VERIFY_(STATUS) if( trim(psname).ne.'NULL' ) then call MAPL_AddInternalSpec ( gc, & SHORT_NAME = trim(psname), & LONG_NAME = 'surface_pressure', & UNITS = 'PA', & DIMS = MAPL_DimsHorzOnly, & VLOCATION = MAPL_VLocationNone, RC=STATUS ) VERIFY_(STATUS) endif if( trim(dpname).ne.'NULL' ) then call MAPL_AddInternalSpec ( gc, & SHORT_NAME = trim(dpname), & LONG_NAME = 'surface_pressure', & UNITS = 'PA', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) endif if( trim(uname).ne.'NULL' ) then call MAPL_AddInternalSpec ( gc, & SHORT_NAME = trim(uname), & LONG_NAME = 'eastward_wind', & UNITS = 'm/s', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) endif if( trim(vname).ne.'NULL' ) then call MAPL_AddInternalSpec ( gc, & SHORT_NAME = trim(vname), & LONG_NAME = 'northward_wind', & UNITS = 'm/s', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) endif if( trim(tname).ne.'NULL' ) then call MAPL_AddInternalSpec ( gc, & SHORT_NAME = trim(tname), & LONG_NAME = 'potential_temperature', & UNITS = 'K', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) endif if( trim(qname).ne.'NULL' ) then call MAPL_AddInternalSpec ( gc, & SHORT_NAME = trim(qname), & LONG_NAME = 'specific_humidity', & UNITS = 'N/A', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) endif if( trim(o3name).ne.'NULL' ) then call MAPL_AddInternalSpec ( gc, & SHORT_NAME = trim(o3name), & LONG_NAME = 'ozone', & UNITS = 'ppmv', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) endif ! Set the Profiling timers ! ------------------------ call MAPL_TimerAdd(GC, name="DRIVER" ,RC=STATUS) VERIFY_(STATUS) call MAPL_TimerAdd(GC, name="-INTR" ,RC=STATUS) VERIFY_(STATUS) ! Set generic init and final methods ! ---------------------------------- call MAPL_GenericSetServices ( gc, RC=STATUS) VERIFY_(STATUS) RETURN_(ESMF_SUCCESS) end subroutine SetServices !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !BOP ! ! IROUTINE: RUN -- Run method for the MAKEIAU component ! !INTERFACE: subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC ) ! !ARGUMENTS: type(ESMF_GridComp), intent(inout) :: GC ! Gridded component type(ESMF_State), intent(inout) :: IMPORT ! Import state type(ESMF_State), intent(inout) :: EXPORT ! Export state type(ESMF_Clock), intent(inout) :: CLOCK ! The clock integer, optional, intent( out) :: RC ! Error code: ! ! DESCRIPTION: This version uses the MAPL_GenericSetServices. This function sets ! the Initialize and Finalize services, as well as allocating !EOP ! ErrLog Variables character(len=ESMF_MAXSTR) :: IAm integer :: STATUS character(len=ESMF_MAXSTR) :: COMP_NAME character(len=ESMF_MAXSTR) :: uname,vname,tname,qname,psname,dpname,o3name,tvar ! Local derived type aliases type (MAPL_MetaComp), pointer :: MAPL type (ESMF_State ) :: INTERNAL integer :: IM, JM, LM real, pointer, dimension(:,:,:) :: u_bkg, du real, pointer, dimension(:,:,:) :: v_bkg, dv real, pointer, dimension(:,:,:) :: t_bkg, dt real, pointer, dimension(:,:,:) :: q_bkg, dq real, pointer, dimension(:,:,:) :: o3_bkg, do3 real, pointer, dimension(:,:,:) :: ple_bkg, dple real, pointer, dimension(:,:) :: ps_ana real, pointer, dimension(:,:,:) :: dp_ana real, pointer, dimension(:,:,:) :: u_ana real, pointer, dimension(:,:,:) :: v_ana real, pointer, dimension(:,:,:) :: o3_ana real, pointer, dimension(:,:,:) :: q_ana real, pointer, dimension(:,:,:) :: tmp_ana real, allocatable, dimension(:,:,:) :: t_ana real, allocatable, dimension(:,:,:) :: ple_ana real, allocatable, dimension(:,:,:) :: pk_ana real, allocatable, dimension(:,:,:) :: pke_ana real, allocatable, dimension(:,:) :: pl, alf real, parameter :: EPS = MAPL_RVAP/MAPL_RGAS-1.0 character(len=ESMF_MAXSTR) :: FILETMPL type(ESMF_FieldBundle) :: bundle type(ESMF_Grid) :: grid type(ESMF_Time) :: currtime real :: DAMPBEG, DAMPEND integer :: L !============================================================================= ! Begin... ! Get the target components name and set-up traceback handle. ! ----------------------------------------------------------- Iam = "Run" call ESMF_GridCompGet( GC, name=COMP_NAME, RC=STATUS ) VERIFY_(STATUS) Iam = trim(COMP_NAME) // Iam ! Retrieve the pointer to the state !---------------------------------- call MAPL_GetObjectFromGC ( GC, MAPL, RC=STATUS) VERIFY_(STATUS) ! Local aliases to the state, grid, and configuration ! --------------------------------------------------- call MAPL_TimerOn(MAPL,"TOTAL") ! Get parameters from generic state. !----------------------------------- call MAPL_Get( MAPL, IM=IM, JM=JM, LM=LM, & INTERNAL_ESMF_STATE=INTERNAL, & RC=STATUS ) VERIFY_(STATUS) call ESMF_GridCompGet(GC, grid=grid, rc=status) VERIFY_(STATUS) ! Get Resource Parameters !------------------------ call MAPL_GetResource(MAPL, FILETMPL, LABEL="REPLAY_FILE:", RC=status) VERIFY_(STATUS) call MAPL_GetResource(MAPL, DAMPBEG, LABEL="REPLAY_DAMPBEG:", default=20.0, RC=status) VERIFY_(STATUS) call MAPL_GetResource(MAPL, DAMPEND, LABEL="REPLAY_DAMPEND:", default=40.0, RC=status) VERIFY_(STATUS) ASSERT_(DAMPBEG.le.DAMPEND ) call MAPL_GetResource(MAPL, psname, Label="REPLAY_PSNAME:", Default="ps", RC=status ) VERIFY_(STATUS) call MAPL_GetResource(MAPL, dpname, Label="REPLAY_DPNAME:", Default="delp", RC=status ) VERIFY_(STATUS) call MAPL_GetResource(MAPL, uname, Label="REPLAY_UNAME:", Default="u", RC=status ) VERIFY_(STATUS) call MAPL_GetResource(MAPL, vname, Label="REPLAY_VNAME:", Default="v", RC=status ) VERIFY_(STATUS) call MAPL_GetResource(MAPL, tname, Label="REPLAY_TNAME:", Default="theta", RC=status ) VERIFY_(STATUS) call MAPL_GetResource(MAPL, qname, Label="REPLAY_QNAME:", Default="sphu", RC=status ) VERIFY_(STATUS) call MAPL_GetResource(MAPL, o3name, Label="REPLAY_O3NAME:", Default="ozone", RC=status ) VERIFY_(STATUS) call MAPL_GetResource(MAPL, tvar, Label="REPLAY_TVAR:", Default="THETAV",RC=status ) VERIFY_(STATUS) ! ********************************************************************** ! **** READ Internal STATE from REPLAY File **** ! ********************************************************************** call ESMF_ClockGet(clock, currTime=currTime, rc=status) VERIFY_(STATUS) call MAPL_CFIORead ( FILETMPL, currTime, Internal, RC=status) VERIFY_(STATUS) ! ********************************************************************** ! **** Get Pointers to BKG Import Data **** ! ********************************************************************** call MAPL_GetPointer(import, u_bkg, 'U', RC=STATUS) VERIFY_(STATUS) call MAPL_GetPointer(import, v_bkg, 'V', RC=STATUS) VERIFY_(STATUS) call MAPL_GetPointer(import, t_bkg, 'T', RC=STATUS) VERIFY_(STATUS) call MAPL_GetPointer(import, ple_bkg, 'PLE', RC=STATUS) VERIFY_(STATUS) call MAPL_GetPointer(import, o3_bkg, 'O3PPMV', RC=STATUS) VERIFY_(STATUS) call ESMF_StateGet(import, 'TRANA', bundle, rc=status) VERIFY_(STATUS) call ESMFL_BundleGetPointerToData(bundle, 'Q', q_bkg, RC=STATUS) VERIFY_(STATUS) ! ********************************************************************** ! **** Get Pointers to ANA Internal Data **** ! ********************************************************************** if( trim(psname).ne.'NULL' ) then call MAPL_GetPointer(internal, ps_ana, trim(psname), RC=STATUS) VERIFY_(STATUS) endif if( trim(dpname).ne.'NULL' ) then call MAPL_GetPointer(internal, dp_ana, trim(dpname), RC=STATUS) VERIFY_(STATUS) endif if( trim(uname).ne.'NULL' ) then call MAPL_GetPointer(internal, u_ana, trim(uname), RC=STATUS) VERIFY_(STATUS) endif if( trim(vname).ne.'NULL' ) then call MAPL_GetPointer(internal, v_ana, trim(vname), RC=STATUS) VERIFY_(STATUS) endif if( trim(tname).ne.'NULL' ) then call MAPL_GetPointer(internal, tmp_ana, trim(tname), RC=STATUS) VERIFY_(STATUS) endif if( trim(qname).ne.'NULL' ) then call MAPL_GetPointer(internal, q_ana, trim(qname), RC=STATUS) VERIFY_(STATUS) endif if( trim(o3name).ne.'NULL' ) then call MAPL_GetPointer(internal, o3_ana, trim(o3name), RC=STATUS) VERIFY_(STATUS) endif ! Construct Pressure Variables ! ---------------------------- allocate(ple_ana(IM,JM,0:LM), stat=status) VERIFY_(STATUS) if( trim(psname).ne.'NULL' .and. trim(dpname).ne.'NULL' ) then ple_ana(:,:,0) = 1.0 do L=1,lm-1 ple_ana(:,:,L) = ple_ana(:,:,L-1) + dp_ana(:,:,L) end do ple_ana(:,:,LM) = ps_ana else ple_ana = ple_bkg endif ! Create ANA Dry Temperature from REPLAY Variables ! ------------------------------------------------ allocate( t_ana(IM,JM,LM), stat=status) if( trim(tname).ne.'NULL' ) then if( trim(tvar).eq.'T' ) t_ana = tmp_ana if( trim(tvar).eq.'TV' ) then if( trim(qname).ne.'NULL' ) then t_ana = tmp_ana/(1.0+eps*q_ana) else t_ana = tmp_ana/(1.0+eps*q_bkg) endif endif if( trim(tvar).eq.'THETA' .or. & trim(tvar).eq.'THETAV' ) then allocate( pk_ana(IM,JM,LM), stat=status) VERIFY_(STATUS) allocate(pke_ana(IM,JM,0:LM), stat=status) VERIFY_(STATUS) pke_ana(:,:,:) = ple_ana(:,:,:)**MAPL_KAPPA do L=1,lm pk_ana(:,:,L) = ( pke_ana(:,:,L)-pke_ana(:,:,L-1) ) & / ( MAPL_KAPPA*log(ple_ana(:,:,L)/ple_ana(:,:,L-1)) ) enddo if( trim(tvar).eq.'THETA' ) t_ana = tmp_ana*pk_ana if( trim(tvar).eq.'THETAV' ) then if( trim(qname).ne.'NULL' ) then t_ana = tmp_ana*pk_ana/(1.0+eps*q_ana) else t_ana = tmp_ana*pk_ana/(1.0+eps*q_bkg) endif endif deallocate( pk_ana) deallocate(pke_ana) endif else t_ana = t_bkg endif ! ********************************************************************** ! **** Blend ANA and BKG Variables between DAMPBEG and DAMPEND **** ! ********************************************************************** if( DAMPBEG.ne.DAMPEND ) then allocate ( pl(IM,JM) ) allocate ( alf(IM,JM) ) do L=1,lm pl(:,:)= 0.5*(ple_ana(:,:,L-1)+ple_ana(:,:,L)) alf(:,:)= max( 0.0, (pl(:,:)-DAMPBEG)/(DAMPEND-DAMPBEG) ) if( trim(uname).ne.'NULL' ) then where( pl(:,:).lt.DAMPEND ) u_ana(:,:,L) = u_bkg(:,:,L) + ( u_ana(:,:,L)- u_bkg(:,:,L))*alf(:,:) endwhere endif if( trim(vname).ne.'NULL' ) then where( pl(:,:).lt.DAMPEND ) v_ana(:,:,L) = v_bkg(:,:,L) + ( v_ana(:,:,L)- v_bkg(:,:,L))*alf(:,:) endwhere endif if( trim(qname).ne.'NULL' ) then where( pl(:,:).lt.DAMPEND ) q_ana(:,:,L) = q_bkg(:,:,L) + ( q_ana(:,:,L)- q_bkg(:,:,L))*alf(:,:) endwhere endif if( trim(o3name).ne.'NULL' ) then where( pl(:,:).lt.DAMPEND ) o3_ana(:,:,L) = o3_bkg(:,:,L) + ( o3_ana(:,:,L)- o3_bkg(:,:,L))*alf(:,:) endwhere endif ! Note: t_ana and ple_ana have already been created ! ------------------------------------------------- where( pl(:,:).lt.DAMPEND ) t_ana(:,:,L) = t_bkg(:,:,L) + ( t_ana(:,:,L)- t_bkg(:,:,L))*alf(:,:) ple_ana(:,:,L) = ple_bkg(:,:,L) + (ple_ana(:,:,L)-ple_bkg(:,:,L))*alf(:,:) endwhere enddo deallocate ( pl ) deallocate ( alf ) endif ! ********************************************************************** ! **** Create IAU Increment **** ! ********************************************************************** call MAPL_GetPointer(export, du, 'DUDT', RC=STATUS) VERIFY_(STATUS) call MAPL_GetPointer(export, dv, 'DVDT', RC=STATUS) VERIFY_(STATUS) call MAPL_GetPointer(export, dt, 'DTDT', RC=STATUS) VERIFY_(STATUS) call MAPL_GetPointer(export, dq, 'DQVDT', RC=STATUS) VERIFY_(STATUS) call MAPL_GetPointer(export, do3, 'DO3DT', RC=STATUS) VERIFY_(STATUS) call MAPL_GetPointer(export, dple, 'DPEDT', RC=STATUS) VERIFY_(STATUS) if(associated(du)) then if( trim(uname).ne.'NULL' ) then du = u_ana-u_bkg else du = 0.0 endif endif if(associated(dv)) then if( trim(vname).ne.'NULL' ) then dv = v_ana-v_bkg else dv = 0.0 endif endif if(associated(dt)) then if( trim(tname).ne.'NULL' ) then dt = t_ana-t_bkg else dt = 0.0 endif endif if(associated(dq)) then if( trim(qname).ne.'NULL' ) then dq = q_ana-q_bkg else dq = 0.0 endif endif if(associated(do3)) then if( trim(o3name).ne.'NULL' ) then do3 = o3_ana-o3_bkg else do3 = 0.0 endif endif if(associated(dple)) then if( trim(psname).ne.'NULL' .and. trim(dpname).ne.'NULL' ) then dple = ple_ana-ple_bkg else dple = 0.0 endif endif deallocate( t_ana ) deallocate( ple_ana ) RETURN_(ESMF_SUCCESS) end subroutine RUN end module GEOS_mkiauGridCompMod