diff --git a/CMakeLists.txt b/CMakeLists.txt index 66a45a2bb..82cd5f540 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,9 @@ if(POLICY CMP0079) cmake_policy(SET CMP0079 NEW) endif() +# Add GEOS-Chem CMake helpers to MODULE_PATH +list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/CMakeScripts) +include(GC-Helpers) #----------------------------------------------------------------------------- # Print header #----------------------------------------------------------------------------- diff --git a/GeosCore/diagnostics_mod.F90 b/GeosCore/diagnostics_mod.F90 index 2993dab22..f72698e6b 100644 --- a/GeosCore/diagnostics_mod.F90 +++ b/GeosCore/diagnostics_mod.F90 @@ -27,6 +27,9 @@ MODULE Diagnostics_mod PUBLIC :: Set_Diagnostics_EndofTimestep PUBLIC :: Zero_Diagnostics_StartofTimestep PUBLIC :: Compute_Budget_Diagnostics +#ifdef ADJOINT + PUBLIC :: Set_SpcAdj_Diagnostic +#endif ! ! !PRIVATE MEMBER FUNCTIONS ! @@ -125,6 +128,25 @@ SUBROUTINE Set_Diagnostics_EndofTimestep( Input_Opt, State_Chm, State_Diag, & RETURN ENDIF +#ifdef ADJOINT + !----------------------------------------------------------------------- + ! Set species concentration diagnostic in units specified in state_diag_mod + !----------------------------------------------------------------------- + IF ( State_Diag%Archive_SpeciesAdj ) THEN + ! if (Input_Opt%IS_FD_SPOT_THIS_PET) THEN + ! write(*,*) 'Before diagnostic ', & + ! State_Chm%SpeciesAdj(Input_Opt%IFD,Input_Opt%JFD,Input_Opt%LFD,Input_opt%NFD) + ! ENDIF + CALL Set_SpcAdj_Diagnostic( Input_Opt, State_Chm, State_Diag, & + State_Grid, State_Met, RC ) + + ! Trap potential errors + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error encountered setting species adoint diagnostic' + CALL GC_ERROR( ErrMsg, RC, ThisLoc ) + ENDIF + ENDIF +#endif !----------------------------------------------------------------------- ! Set total dry deposition flux !----------------------------------------------------------------------- @@ -312,6 +334,142 @@ SUBROUTINE Zero_Diagnostics_StartofTimestep( Input_Opt, State_Diag, RC ) END SUBROUTINE Zero_Diagnostics_StartofTimestep !EOC +#ifdef ADJOINT +!------------------------------------------------------------------------------ +! GEOS-Chem Global Chemical Transport Model ! +!------------------------------------------------------------------------------ +!BOP +! +! !IROUTINE: Set_SpcAdj_Diagnostic +! +! !DESCRIPTION: Subroutine Set_SpcAdj\_Diagnostic sets the passed species +! adjoint diagnostic array stored in State_Diag to the instantaneous +! State_Chm%SpeciesAdj values converted to the diagnostic unit stored in +! the State_Diag metadata. +!\\ +!\\ +! !INTERFACE: +! + SUBROUTINE Set_SpcAdj_Diagnostic( Input_Opt, State_Chm, State_Diag, & + State_Grid, State_Met, RC ) +! +! !USES: +! + USE Input_Opt_Mod, ONLY : OptInput + USE State_Met_Mod, ONLY : MetState + USE State_Chm_Mod, ONLY : ChmState + USE State_Diag_Mod, ONLY : DgnMap + USE State_Diag_Mod, ONLY : DgnState + USE State_Grid_Mod, ONLY : GrdState + USE UnitConv_Mod, ONLY : Convert_Spc_Units +! +! !INPUT PARAMETERS: +! + TYPE(OptInput), INTENT(IN) :: Input_Opt ! Input Options object + TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid state object + TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology state object +! +! !INPUT/OUTPUT PARAMETERS: +! + TYPE(ChmState), INTENT(INOUT) :: State_Chm ! Chemistry State object + TYPE(DgnState), INTENT(INOUT) :: State_Diag ! Diagnostics State object +! +! !OUTPUT PARAMETERS: +! + INTEGER, INTENT(OUT) :: RC ! Success or failure? +! +! !REMARKS: +! +! !REVISION HISTORY: +! 15 Dec 2019 - C. Lee - Initial version +! 17 Dec 2020 - C. Lee - Updated to account for changes to Set_SpcConcs +!EOP +!------------------------------------------------------------------------------ +!BOC +! +! !LOCAL VARIABLES: +! + ! Scalars + LOGICAL :: Found + INTEGER :: D, I, J, L, N, S + REAL(fp) :: TmpVal, Conv + + ! Strings + CHARACTER(LEN=255) :: ErrMsg, ThisLoc, Units, OrigUnit + + ! Objects + TYPE(DgnMap), POINTER :: mapData + + ! Arrays + REAL(fp) :: TmpSpcArr(State_Grid%NX,State_Grid%NY, & + State_Grid%NZ,State_Chm%nSpecies) + + !==================================================================== + ! Set_SpcAdj_Diagnostic begins here! + !==================================================================== + + ! Assume success + RC = GC_SUCCESS + Found = .FALSE. + ThisLoc = ' -> Set_SpcAdj_Diagnostic (in GeosCore/diagnostics_mod.F90)' + + + ! Verify that incoming State_Chm%Species units are kg/kg dry air. + IF ( TRIM( State_Chm%Spc_Units ) /= 'kg/kg dry' ) THEN + ErrMsg = 'Incorrect species units in Set_SpcConc_Diags_VVDry!' + CALL GC_Error( ErrMsg, RC, ThisLoc ) + RETURN + ENDIF + + !$OMP PARALLEL DO & + !$OMP DEFAULT( SHARED ) & + !$OMP PRIVATE( I, J, L, N ) + DO N = 1, State_Chm%nSpecies + DO L = 1, State_Grid%NZ + DO J = 1, State_Grid%NY + DO I = 1, State_Grid%NX + ! Forward code + ! TmpSpcArr(I,J,L,N) = State_Chm%Species(I,J,L,N) * & + ! ( AIRMW / State_Chm%SpcData(N)%Info%MW_g ) + TmpSpcArr(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) + ENDDO + ENDDO + ENDDO + ENDDO + !$OMP END PARALLEL DO + + !======================================================================= + ! Copy species to SpeciesConc (concentrations diagnostic) [v/v dry] + !======================================================================= + IF ( Input_Opt%Is_Adjoint ) THEN + + ! Point to mapping obj specific to SpeciesConc diagnostic collection + mapData => State_Diag%Map_SpeciesConc + + !$OMP PARALLEL DO & + !$OMP DEFAULT( SHARED ) & + !$OMP PRIVATE( N, S ) + DO S = 1, mapData%nSlots + N = mapData%slot2id(S) + State_Diag%SpeciesAdj(:,:,:,S) = TmpSpcArr(:,:,:,N) + ENDDO + !$OMP END PARALLEL DO + + ! Free pointer + mapData => NULL() + + ENDIF + + ! Error handling + IF ( RC /= GC_SUCCESS ) THEN + ErrMsg = 'Error converting species units for archiving diagnostics #2' + CALL GC_Error( ErrMsg, RC, ThisLoc ) + RETURN + ENDIF + + END SUBROUTINE Set_SpcAdj_Diagnostic +!EOC +#endif !------------------------------------------------------------------------------ ! GEOS-Chem Global Chemical Transport Model ! !------------------------------------------------------------------------------ diff --git a/GeosCore/hco_interface_gc_mod.F90 b/GeosCore/hco_interface_gc_mod.F90 index d053fbd0a..278c9be1d 100644 --- a/GeosCore/hco_interface_gc_mod.F90 +++ b/GeosCore/hco_interface_gc_mod.F90 @@ -422,6 +422,10 @@ SUBROUTINE HCOI_GC_Init( Input_Opt, State_Chm, State_Grid, & ! Set misc. parameter !======================================================================= +#ifdef ADJOINT + if ( Input_Opt%amIRoot ) WRITE(*,*) 'Setting isAdjoint to ', Input_Opt%is_adjoint + HcoState%isAdjoint = Input_opt%is_adjoint +#endif ! Emission, chemistry and dynamics timestep in seconds HcoState%TS_EMIS = GET_TS_EMIS() HcoState%TS_CHEM = GET_TS_CHEM() @@ -1179,6 +1183,9 @@ SUBROUTINE HCOI_GC_WriteDiagn( Input_Opt, Restart, RC ) USE Time_Mod, ONLY : Get_Year, Get_Month, Get_Day, GET_DAY_OF_YEAR USE Time_Mod, ONLY : GET_HOUR, GET_MINUTE, GET_SECOND +#if defined( ADJOINT ) + USE MAPL_CommsMod, ONLY : MAPL_AM_I_ROOT +#endif ! ! !INPUT/OUTPUT PARAMETERS: ! diff --git a/GeosCore/input_mod.F90 b/GeosCore/input_mod.F90 index 2d592997b..8ed55256a 100644 --- a/GeosCore/input_mod.F90 +++ b/GeosCore/input_mod.F90 @@ -5393,6 +5393,17 @@ SUBROUTINE CHECK_TIME_STEPS( Input_Opt, State_Grid, RC) TS_DYN = Input_Opt%TS_DYN TS_RAD = Input_Opt%TS_RAD + ! If we're doing the reverse integration + ! multiply all the timesteps by -1 here + if (TS_DYN < 0) THEN + TS_CHEM = TS_CHEM * -1 + TS_EMIS = TS_EMIS * -1 + TS_CONV = TS_CONV * -1 + TS_DYN = TS_DYN * -1 + TS_RAD = TS_RAD * -1 + endif + + ! NUNIT is time step in minutes for unit conversion TS_UNIT = -1 diff --git a/GeosCore/mixing_mod.F90 b/GeosCore/mixing_mod.F90 index ffeebfd32..f7217b2c7 100644 --- a/GeosCore/mixing_mod.F90 +++ b/GeosCore/mixing_mod.F90 @@ -282,6 +282,10 @@ SUBROUTINE DO_TEND( Input_Opt, State_Chm, State_Diag, State_Grid, & ! Strings CHARACTER(LEN=255) :: ErrMsg, ErrorMsg, ThisLoc +#ifdef ADJOINT + LOGICAL :: IS_ADJ +#endif + !================================================================= ! DO_TEND begins here! !================================================================= @@ -338,6 +342,16 @@ SUBROUTINE DO_TEND( Input_Opt, State_Chm, State_Diag, State_Grid, & ENDIF ENDIF +#if defined( ADJOINT ) && defined ( DEBUG ) + IF (Input_Opt%is_adjoint .and. Input_Opt%IS_FD_SPOT_THIS_PET) THEN + WRITE(*,*) ' SpcAdj(IFD,JFD) before unit converstion: ', & + State_Chm%SpeciesAdj(Input_Opt%IFD, Input_Opt%JFD, & + Input_Opt%LFD, Input_Opt%NFD) + WRITE(*,*) ' Spc(IFD,JFD) before unit converstion: ', & + State_Chm%Species(Input_Opt%IFD, Input_Opt%JFD, & + Input_Opt%LFD, Input_Opt%NFD) + ENDIF +#endif ! DO_TEND previously operated in units of kg. The species arrays are in ! v/v for mixing, hence needed to convert before and after. ! Now use units kg/m2 as State_Chm%SPECIES units in DO_TEND to @@ -345,6 +359,17 @@ SUBROUTINE DO_TEND( Input_Opt, State_Chm, State_Diag, State_Grid, & CALL Convert_Spc_Units( Input_Opt, State_Chm, State_Grid, State_Met, & 'kg/m2', RC, OrigUnit=OrigUnit ) +#if defined( ADJOINT ) && defined ( DEBUG ) + IF (Input_Opt%is_adjoint .and. Input_Opt%IS_FD_SPOT_THIS_PET) THEN + WRITE(*,*) ' SpcAdj(IFD,JFD) after unit converstion: ', & + State_Chm%SpeciesAdj(Input_Opt%IFD, Input_Opt%JFD, & + Input_Opt%LFD, Input_Opt%NFD) + WRITE(*,*) ' Spc(IFD,JFD) after unit converstion: ', & + State_Chm%Species(Input_Opt%IFD, Input_Opt%JFD, & + Input_Opt%LFD, Input_Opt%NFD) + ENDIF +#endif + ! Trap potential error IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Unit conversion error!' @@ -358,6 +383,11 @@ SUBROUTINE DO_TEND( Input_Opt, State_Chm, State_Diag, State_Grid, & ELSE TS = GET_TS_DYN() ENDIF +#ifdef ADJOINT + if (Input_Opt%Is_Adjoint) then + TS = TS * -1 + endif +#endif ! First-time setup IF ( FIRST ) THEN @@ -473,7 +503,7 @@ SUBROUTINE DO_TEND( Input_Opt, State_Chm, State_Diag, State_Grid, & ! dry deposition and/or emissions !-------------------------------------------------------------------- IF ( .NOT. DryDepSpec .AND. .NOT. EmisSpec ) CYCLE - + ! Loop over all grid boxes DO J = 1, State_Grid%NY DO I = 1, State_Grid%NX @@ -606,6 +636,12 @@ SUBROUTINE DO_TEND( Input_Opt, State_Chm, State_Diag, State_Grid, & State_Chm%Species(I,J,L,N) = FRAC * & State_Chm%Species(I,J,L,N) +#ifdef ADJOINT + if (Input_Opt%Is_Adjoint) then + State_Chm%SpeciesAdj(I,J,L,N) = FRAC * & + State_Chm%SpeciesAdj(I,J,L,N) + endif +#endif ! Eventually add PARANOX loss. PNOXLOSS is in kg/m2/s. ! Make sure PARANOx loss is applied to tracers. (ckeller, ! 3/29/16). @@ -682,6 +718,15 @@ SUBROUTINE DO_TEND( Input_Opt, State_Chm, State_Diag, State_Grid, & ! Flux: [kg/m2] = [kg m-2 s-1 ] x [s] FLUX = TMP * TS +#ifdef ADJOINT + IF ( I .eq. Input_Opt%IFD .and. J .eq. Input_Opt%JFD .and. & + L .eq. Input_Opt%LFD .and. N .eq. Input_Opt%NFD) THEN + WRITE(*,*) ' GetHcoVal(IFD,JFD) = ', TMP, ' FLUX = ', FLUX + IF ( Input_Opt%is_adjoint ) THEN + WRITE(*,*) ' SpeciesAdj(FD) = ', State_Chm%SpeciesAdj(I,J,L,N) + ENDIF + ENDIF +#endif ! Add to species array State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & @@ -820,6 +865,17 @@ SUBROUTINE DO_TEND( Input_Opt, State_Chm, State_Diag, State_Grid, & ENDIF +#if defined( ADJOINT ) && defined ( DEBUG ) + IF (Input_Opt%is_adjoint .and. Input_Opt%IS_FD_SPOT_THIS_PET) THEN + WRITE(*,*) ' SpcAdj(IFD,JFD) before unit converstion: ', & + State_Chm%SpeciesAdj(Input_Opt%IFD, Input_Opt%JFD, & + Input_Opt%LFD, Input_Opt%NFD) + WRITE(*,*) ' Spc(IFD,JFD) before unit converstion: ', & + State_Chm%Species(Input_Opt%IFD, Input_Opt%JFD, & + Input_Opt%LFD, Input_Opt%NFD) + ENDIF + +#endif ! Convert State_Chm%Species back to original units CALL Convert_Spc_Units( Input_Opt, State_Chm, State_Grid, State_Met, & OrigUnit, RC ) @@ -828,6 +884,17 @@ SUBROUTINE DO_TEND( Input_Opt, State_Chm, State_Diag, State_Grid, & CALL GC_Error( ErrMsg, RC, ThisLoc ) RETURN ENDIF +#if defined( ADJOINT ) && defined ( DEBUG ) + IF (Input_Opt%is_adjoint .and. Input_Opt%IS_FD_SPOT_THIS_PET) THEN + WRITE(*,*) ' SpcAdj(IFD,JFD) after unit converstion: ', & + State_Chm%SpeciesAdj(Input_Opt%IFD, Input_Opt%JFD, & + Input_Opt%LFD, Input_Opt%NFD) + WRITE(*,*) ' Spc(IFD,JFD) after unit converstion: ', & + State_Chm%Species(Input_Opt%IFD, Input_Opt%JFD, & + Input_Opt%LFD, Input_Opt%NFD) + ENDIF + +#endif !------------------------------------------------------------------------ ! Emissions/dry deposition budget diagnostics - Part 2 of 2 @@ -869,5 +936,6 @@ SUBROUTINE DO_TEND( Input_Opt, State_Chm, State_Diag, State_Grid, & DepFreq => NULL() END SUBROUTINE DO_TEND + !EOC END MODULE MIXING_MOD diff --git a/GeosUtil/unitconv_mod.F90 b/GeosUtil/unitconv_mod.F90 index 3cb7afa60..a88a88323 100644 --- a/GeosUtil/unitconv_mod.F90 +++ b/GeosUtil/unitconv_mod.F90 @@ -173,6 +173,7 @@ SUBROUTINE Convert_Spc_Units ( Input_Opt, State_Chm, State_Grid, State_Met, & ! !LOCAL VARIABLES: ! CHARACTER(LEN=255) :: ErrMsg_noIn, ErrMsg_noOut, ErrMsg_RC, LOC, InUnit + LOGICAL :: IS_ADJOINT ! Is this the reverse integration !==================================================================== ! Convert_Spc_Units begins here! @@ -212,6 +213,14 @@ SUBROUTINE Convert_Spc_Units ( Input_Opt, State_Chm, State_Grid, State_Met, & RETURN ENDIF +#ifdef ADJOINT +! check if this is the adjoint run + IS_ADJOINT = Input_Opt%Is_Adjoint +#else +! if ADJOINT is not defined, this can never be the adjoint run + IS_ADJOINT = .FALSE. +#endif + ! Convert based on input and output units SELECT CASE ( TRIM(InUnit) ) @@ -221,19 +230,24 @@ SUBROUTINE Convert_Spc_Units ( Input_Opt, State_Chm, State_Grid, State_Met, & CASE ( 'kg/kg dry' ) SELECT CASE ( TRIM(OutUnit) ) CASE ( 'v/v dry' ) - CALL ConvertSpc_KgKgDry_to_VVDry( State_Chm, State_Grid, RC ) + CALL ConvertSpc_KgKgDry_to_VVDry( State_Chm, State_Grid, & + IS_ADJOINT, RC ) CASE ( 'kg/kg total' ) CALL ConvertSpc_KgKgDry_to_KgKgTotal( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, & + IS_ADJOINT, RC ) CASE ( 'kg' ) - CALL ConvertSpc_KgKgDry_to_Kg( State_Chm, State_Grid, & - State_Met, RC ) + CALL ConvertSpc_KgKgDry_to_Kg( State_Chm, State_Grid, & + State_Met, IS_ADJOINT, & + RC ) CASE ( 'kg/m2' ) - CALL ConvertSpc_KgKgDry_to_Kgm2( State_Chm, State_Grid, & - State_Met, RC ) + CALL ConvertSpc_KgKgDry_to_Kgm2( State_Chm, State_Grid, & + State_Met, IS_ADJOINT, & + RC ) CASE ( 'molec/cm3' ) - CALL ConvertSpc_KgKgDry_to_MND( State_Chm, State_Grid, & - State_Met, RC ) + CALL ConvertSpc_KgKgDry_to_MND( State_Chm, State_Grid, & + State_Met, IS_ADJOINT, & + RC ) CASE DEFAULT CALL GC_Error( ErrMsg_noOut, RC, LOC ) END SELECT @@ -245,12 +259,14 @@ SUBROUTINE Convert_Spc_Units ( Input_Opt, State_Chm, State_Grid, State_Met, & SELECT CASE ( TRIM(OutUnit) ) CASE ( 'kg/kg dry' ) CALL ConvertSpc_KgKgTotal_to_KgKgDry( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, & + IS_ADJOINT, RC ) CASE ( 'kg' ) CALL ConvertSpc_KgKgTotal_to_KgKgDry( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, & + IS_ADJOINT, RC ) CALL ConvertSpc_KgKgDry_to_Kg( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, IS_ADJOINT, RC ) CASE DEFAULT CALL GC_Error( ErrMsg_noOut, RC, LOC ) END SELECT @@ -261,14 +277,17 @@ SUBROUTINE Convert_Spc_Units ( Input_Opt, State_Chm, State_Grid, State_Met, & CASE ( 'v/v dry' ) SELECT CASE ( TRIM(OutUnit) ) CASE ( 'kg/kg dry' ) - CALL ConvertSpc_VVDry_to_KgKgDry( State_Chm, State_Grid, RC ) + CALL ConvertSpc_VVDry_to_KgKgDry( State_Chm, State_Grid, & + IS_ADJOINT, RC ) CASE ( 'kg' ) CALL ConvertSpc_VVDry_to_Kg( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, IS_ADJOINT, RC ) CASE ( 'kg/m2' ) - CALL ConvertSpc_VVDry_to_KgKgDry( State_Chm, State_Grid, RC ) + CALL ConvertSpc_VVDry_to_KgKgDry( State_Chm, State_Grid, & + IS_ADJOINT, RC ) CALL ConvertSpc_KgKgDry_to_Kgm2 ( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, & + IS_ADJOINT, RC ) CASE DEFAULT CALL GC_Error( ErrMsg_noOut, RC, LOC ) END SELECT @@ -280,18 +299,22 @@ SUBROUTINE Convert_Spc_Units ( Input_Opt, State_Chm, State_Grid, State_Met, & SELECT CASE ( TRIM(OutUnit) ) CASE ( 'kg/kg dry' ) CALL ConvertSpc_Kg_to_KgKgDry( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, & + IS_ADJOINT, RC ) CASE ( 'kg/kg total' ) CALL ConvertSpc_Kg_to_KgKgDry( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, & + IS_ADJOINT, RC ) CALL ConvertSpc_KgKgDry_to_KgKgTotal( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, & + IS_ADJOINT, RC ) CASE ( 'v/v dry' ) CALL ConvertSpc_Kg_to_VVDry( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, & + IS_ADJOINT, RC ) CASE ( 'molec/cm3' ) CALL ConvertSpc_Kg_to_MND( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, IS_ADJOINT, RC ) CASE DEFAULT CALL GC_Error( ErrMsg_noOut, RC, LOC ) END SELECT @@ -303,11 +326,14 @@ SUBROUTINE Convert_Spc_Units ( Input_Opt, State_Chm, State_Grid, State_Met, & SELECT CASE ( TRIM(OutUnit) ) CASE( 'kg/kg dry' ) CALL ConvertSpc_Kgm2_to_KgKgDry( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, & + IS_ADJOINT, RC ) CASE ( 'v/v dry' ) CALL ConvertSpc_Kgm2_to_KgKgDry( State_Chm, State_Grid, & - State_Met, RC ) - CALL ConvertSpc_KgKgDry_to_VVDry( State_Chm, State_Grid, RC ) + State_Met, & + IS_ADJOINT, RC ) + CALL ConvertSpc_KgKgDry_to_VVDry( State_Chm, State_Grid, & + IS_ADJOINT, RC ) CASE DEFAULT CALL GC_Error( ErrMsg_noOut, RC, LOC ) END SELECT @@ -319,10 +345,12 @@ SUBROUTINE Convert_Spc_Units ( Input_Opt, State_Chm, State_Grid, State_Met, & SELECT CASE ( TRIM(OutUnit) ) CASE ( 'kg' ) CALL ConvertSpc_MND_to_Kg( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, & + IS_ADJOINT, RC ) CASE ( 'kg/kg dry' ) CALL ConvertSpc_MND_to_KgKgDry( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, & + IS_ADJOINT, RC ) CASE DEFAULT CALL GC_Error( ErrMsg_noOut, RC, LOC ) END SELECT @@ -481,11 +509,12 @@ END SUBROUTINE Print_Global_Species_Kg !\\ ! !INTERFACE: ! - SUBROUTINE ConvertSpc_KgKgDry_to_VVDry( State_Chm, State_Grid, RC ) + SUBROUTINE ConvertSpc_KgKgDry_to_VVDry( State_Chm, State_Grid, Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -570,6 +599,10 @@ SUBROUTINE ConvertSpc_KgKgDry_to_VVDry( State_Chm, State_Grid, RC ) DO J = 1, State_Grid%NY DO I = 1, State_Grid%NX State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) * MwRatio +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) * MwRatio +#endif ENDDO ENDDO ENDDO @@ -595,11 +628,12 @@ END SUBROUTINE ConvertSpc_KgKgDry_to_VVDry !\\ ! !INTERFACE: ! - SUBROUTINE ConvertSpc_VVDry_to_KgKgDry( State_Chm, State_Grid, RC ) + SUBROUTINE ConvertSpc_VVDry_to_KgKgDry( State_Chm, State_Grid, Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -679,6 +713,11 @@ SUBROUTINE ConvertSpc_VVDry_to_KgKgDry( State_Chm, State_Grid, RC ) DO I = 1, State_Grid%NX State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & / ( AIRMW / MW_G ) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + / ( AIRMW / MW_G ) +#endif ENDDO ENDDO ENDDO @@ -706,12 +745,13 @@ END SUBROUTINE ConvertSpc_VVDry_to_KgKgDry ! !INTERFACE: ! SUBROUTINE ConvertSpc_KgKgDry_to_KgKgTotal( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -768,6 +808,11 @@ SUBROUTINE ConvertSpc_KgKgDry_to_KgKgTotal( State_Chm, State_Grid, & DO I = 1, State_Grid%NX State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & * ( 1e0_fp - ( State_Met%SPHU(I,J,L) * 1e-3_fp ) ) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + * ( 1e0_fp - ( State_Met%SPHU(I,J,L) * 1e-3_fp ) ) +#endif ENDDO ENDDO ENDDO @@ -794,12 +839,13 @@ END SUBROUTINE ConvertSpc_KgKgDry_to_KgKgTotal ! !INTERFACE: ! SUBROUTINE ConvertSpc_KgKgTotal_to_KgKgDry( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -857,6 +903,11 @@ SUBROUTINE ConvertSpc_KgKgTotal_to_KgKgDry( State_Chm, State_Grid, & DO I = 1, State_Grid%NX State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & / ( 1e0_fp - ( State_Met%SPHU(I,J,L) * 1e-3_fp ) ) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + / ( 1e0_fp - ( State_Met%SPHU(I,J,L) * 1e-3_fp ) ) +#endif ENDDO ENDDO ENDDO @@ -884,12 +935,13 @@ END SUBROUTINE ConvertSpc_KgKgTotal_to_KgKgDry ! !INTERFACE: ! SUBROUTINE ConvertSpc_KgKgDry_to_Kgm2( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology state object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -956,6 +1008,12 @@ SUBROUTINE ConvertSpc_KgKgDry_to_Kgm2( State_Chm, State_Grid, & State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & * ( g0_100 & * State_Met%DELP_DRY(I,J,L) ) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + * ( g0_100 & + * State_Met%DELP_DRY(I,J,L) ) +#endif ENDDO ENDDO ENDDO @@ -982,12 +1040,13 @@ END SUBROUTINE ConvertSpc_KgKgDry_to_Kgm2 ! !INTERFACE: ! SUBROUTINE ConvertSpc_Kgm2_to_KgKgDry( State_Chm, State_Grid, & - State_Met, RC ) + State_Met, Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology state object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -1056,6 +1115,13 @@ SUBROUTINE ConvertSpc_Kgm2_to_KgKgDry( State_Chm, State_Grid, & * ( 1.0e+0_fp & / ( g0_100 & * State_Met%DELP_DRY(I,J,L) ) ) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + * ( 1.0e+0_fp & + / ( g0_100 & + * State_Met%DELP_DRY(I,J,L) ) ) +#endif ENDDO ENDDO ENDDO @@ -1081,12 +1147,14 @@ END SUBROUTINE ConvertSpc_Kgm2_to_KgKgDry !\\ ! !INTERFACE: ! - SUBROUTINE ConvertSpc_KgKgDry_to_MND( State_Chm, State_Grid, State_Met, RC ) + SUBROUTINE ConvertSpc_KgKgDry_to_MND( State_Chm, State_Grid, State_Met, & + Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology state object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -1170,7 +1238,13 @@ SUBROUTINE ConvertSpc_KgKgDry_to_MND( State_Chm, State_Grid, State_Met, RC ) State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & * State_Met%AIRDEN(I,J,L) & * ( AVO / MW_kg ) / 1e+6_fp - +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + * State_Met%AIRDEN(I,J,L) & + * ( AVO / MW_kg ) & + / 1e+6_fp +#endif ENDDO ENDDO ENDDO @@ -1197,12 +1271,14 @@ END SUBROUTINE ConvertSpc_KgKgDry_to_MND !\\ ! !INTERFACE: ! - SUBROUTINE ConvertSpc_MND_to_KgKgDry( State_Chm, State_Grid, State_Met, RC ) + SUBROUTINE ConvertSpc_MND_to_KgKgDry( State_Chm, State_Grid, State_Met, & + Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology state object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -1290,6 +1366,12 @@ SUBROUTINE ConvertSpc_MND_to_KgKgDry( State_Chm, State_Grid, State_Met, RC ) State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & * 1e+6_fp / ( AVO / MW_kg ) & / State_Met%AIRDEN(I,J,L) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + * 1e+6_fp / ( AVO / MW_kg ) & + / State_Met%AIRDEN(I,J,L) +#endif ENDDO ENDDO ENDDO @@ -1316,12 +1398,14 @@ END SUBROUTINE ConvertSpc_MND_to_KgKgDry !\\ ! !INTERFACE: ! - SUBROUTINE ConvertSpc_VVDry_to_Kg( State_Chm, State_Grid, State_Met, RC ) + SUBROUTINE ConvertSpc_VVDry_to_Kg( State_Chm, State_Grid, State_Met, & + Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology state object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -1408,6 +1492,12 @@ SUBROUTINE ConvertSpc_VVDry_to_Kg( State_Chm, State_Grid, State_Met, RC ) State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & * State_Met%AD(I,J,L) & / ( AIRMW / MW_g ) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + * State_Met%AD(I,J,L) & + / ( AIRMW / MW_g ) +#endif ENDDO ENDDO ENDDO @@ -1434,12 +1524,14 @@ END SUBROUTINE ConvertSpc_VVDry_to_Kg !\\ ! !INTERFACE: ! - SUBROUTINE ConvertSpc_Kg_to_VVDry( State_Chm, State_Grid, State_Met, RC ) + SUBROUTINE ConvertSpc_Kg_to_VVDry( State_Chm, State_Grid, State_Met, & + Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology state object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -1525,6 +1617,12 @@ SUBROUTINE ConvertSpc_Kg_to_VVDry( State_Chm, State_Grid, State_Met, RC ) State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & * ( AIRMW / MW_g ) & / State_Met%AD(I,J,L) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + * ( AIRMW / MW_g ) & + / State_Met%AD(I,J,L) +#endif ENDDO ENDDO ENDDO @@ -1551,12 +1649,14 @@ END SUBROUTINE ConvertSpc_Kg_to_VVDry !\\ ! !INTERFACE: ! - SUBROUTINE ConvertSpc_KgKgDry_to_Kg( State_Chm, State_Grid, State_Met, RC ) + SUBROUTINE ConvertSpc_KgKgDry_to_Kg( State_Chm, State_Grid, State_Met, & + Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology state object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -1629,6 +1729,11 @@ SUBROUTINE ConvertSpc_KgKgDry_to_Kg( State_Chm, State_Grid, State_Met, RC ) DO I = 1, State_Grid%NX State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & * State_Met%AD(I,J,L) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + * State_Met%AD(I,J,L) +#endif ENDDO ENDDO ENDDO @@ -1654,12 +1759,14 @@ END SUBROUTINE ConvertSpc_KgKgDry_to_Kg !\\ ! !INTERFACE: ! - SUBROUTINE ConvertSpc_Kg_to_KgKgDry( State_Chm, State_Grid, State_Met, RC ) + SUBROUTINE ConvertSpc_Kg_to_KgKgDry( State_Chm, State_Grid, State_Met, & + Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology state object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -1731,6 +1838,11 @@ SUBROUTINE ConvertSpc_Kg_to_KgKgDry( State_Chm, State_Grid, State_Met, RC ) DO I = 1, State_Grid%NX State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & / State_Met%AD(I,J,L) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + / State_Met%AD(I,J,L) +#endif ENDDO ENDDO ENDDO @@ -1756,12 +1868,14 @@ END SUBROUTINE ConvertSpc_Kg_to_KgKgDry !\\ ! !INTERFACE: ! - SUBROUTINE ConvertSpc_MND_to_Kg( State_Chm, State_Grid, State_Met, RC ) + SUBROUTINE ConvertSpc_MND_to_Kg( State_Chm, State_Grid, State_Met, & + Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology state object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -1851,6 +1965,13 @@ SUBROUTINE ConvertSpc_MND_to_Kg( State_Chm, State_Grid, State_Met, RC ) State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & / ( AVO / MW_kg ) & * ( State_Met%AIRVOL(I,J,L) * 1e+6_fp ) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + / ( AVO / MW_kg ) & + * ( State_Met%AIRVOL(I,J,L) & + * 1e+6_fp ) +#endif ENDDO ENDDO ENDDO @@ -1877,12 +1998,14 @@ END SUBROUTINE ConvertSpc_MND_to_Kg !\\ ! !INTERFACE: ! - SUBROUTINE ConvertSpc_Kg_to_MND( State_Chm, State_Grid, State_Met, RC ) + SUBROUTINE ConvertSpc_Kg_to_MND( State_Chm, State_Grid, State_Met, & + Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology state object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -1967,6 +2090,13 @@ SUBROUTINE ConvertSpc_Kg_to_MND( State_Chm, State_Grid, State_Met, RC ) State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & * ( AVO / MW_kg ) & / ( State_Met%AIRVOL(I,J,L) * 1e+6_fp ) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + * ( AVO / MW_kg ) & + / ( State_Met%AIRVOL(I,J,L) & + * 1e+6_fp ) +#endif ENDDO ENDDO ENDDO @@ -1994,12 +2124,13 @@ END SUBROUTINE ConvertSpc_Kg_to_MND !\\ ! !INTERFACE: ! - SUBROUTINE ConvertBox_KgKgDry_to_Kg( I, J, L, State_Met, State_Chm, RC ) + SUBROUTINE ConvertBox_KgKgDry_to_Kg( I, J, L, State_Met, State_Chm, Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! INTEGER, INTENT(IN) :: I, J, L ! Grid box indexes TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology state object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -2044,6 +2175,11 @@ SUBROUTINE ConvertBox_KgKgDry_to_Kg( I, J, L, State_Met, State_Chm, RC ) DO N = 1, State_Chm%nSpecies State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & * State_Met%AD(I,J,L) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + * State_Met%AD(I,J,L) +#endif ENDDO !$OMP END PARALLEL DO @@ -2065,12 +2201,13 @@ END SUBROUTINE ConvertBox_KgKgDry_to_Kg !\\ ! !INTERFACE: ! - SUBROUTINE ConvertBox_Kg_to_KgKgDry( I, J, L, State_Met, State_Chm, RC ) + SUBROUTINE ConvertBox_Kg_to_KgKgDry( I, J, L, State_Met, State_Chm, Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! INTEGER, INTENT(IN) :: I, J, L ! Grid box indexes TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology state object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -2114,6 +2251,11 @@ SUBROUTINE ConvertBox_Kg_to_KgKgDry( I, J, L, State_Met, State_Chm, RC ) DO N = 1, State_Chm%nSpecies State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & / State_Met%AD(I,J,L) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + / State_Met%AD(I,J,L) +#endif ENDDO !$OMP END PARALLEL DO @@ -2133,12 +2275,13 @@ END SUBROUTINE ConvertBox_Kg_to_KgKgDry !\\ ! !INTERFACE: ! - SUBROUTINE ConvertBox_Kgm2_to_Kg( I, J, L, State_Chm, State_Grid, RC ) + SUBROUTINE ConvertBox_Kgm2_to_Kg( I, J, L, State_Chm, State_Grid, Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! INTEGER, INTENT(IN) :: I, J, L ! Grid box indexes TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -2181,6 +2324,11 @@ SUBROUTINE ConvertBox_Kgm2_to_Kg( I, J, L, State_Chm, State_Grid, RC ) DO N = 1, State_Chm%nSpecies State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & * State_Grid%Area_M2(I,J) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + * State_Grid%Area_M2(I,J) +#endif ENDDO !$OMP END PARALLEL DO @@ -2200,12 +2348,13 @@ END SUBROUTINE ConvertBox_Kgm2_to_Kg !\\ ! !INTERFACE: ! - SUBROUTINE ConvertBox_Kg_to_Kgm2( I, J, L, State_Chm, State_Grid, RC ) + SUBROUTINE ConvertBox_Kg_to_Kgm2( I, J, L, State_Chm, State_Grid, Is_Adjoint, RC ) ! ! !INPUT PARAMETERS: ! INTEGER, INTENT(IN) :: I, J, L ! Grid box indexes TYPE(GrdState), INTENT(IN) :: State_Grid ! Grid State object + LOGICAL, INTENT(IN) :: Is_Adjoint ! Is this the reverse integration? ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -2248,6 +2397,11 @@ SUBROUTINE ConvertBox_Kg_to_Kgm2( I, J, L, State_Chm, State_Grid, RC ) DO N = 1, State_Chm%nSpecies State_Chm%Species(I,J,L,N) = State_Chm%Species(I,J,L,N) & / State_Grid%Area_M2(I,J) +#ifdef ADJOINT + if (Is_Adjoint) & + State_Chm%SpeciesAdj(I,J,L,N) = State_Chm%SpeciesAdj(I,J,L,N) & + / State_Grid%Area_M2(I,J) +#endif ENDDO !$OMP END PARALLEL DO diff --git a/Headers/diaglist_mod.F90 b/Headers/diaglist_mod.F90 index 1088f945e..a1ac30f92 100644 --- a/Headers/diaglist_mod.F90 +++ b/Headers/diaglist_mod.F90 @@ -624,6 +624,11 @@ SUBROUTINE Init_DiagList ( am_I_Root, historyConfigFile, DiagList, RC ) nameAllCaps(1:3) == 'INV' .OR. & nameAllCaps(1:3) == 'HCO') THEN state = 'HEMCO' +#ifdef ADJOINT + ! Emissions scaling factor sensitivites are included in HISTORY.rc in GCHP only + ELSEIF ( nameAllCaps(1:6) == 'SFEMIS' ) THEN + state = 'HEMCO' +#endif #ifdef MODEL_GEOS ! GEOS might have custom diagnostics outside of the standard states ELSEIF ( nameAllCaps(1:5) == 'GEOS_' ) THEN diff --git a/Headers/input_opt_mod.F90 b/Headers/input_opt_mod.F90 index 15601da28..5ff4c9194 100644 --- a/Headers/input_opt_mod.F90 +++ b/Headers/input_opt_mod.F90 @@ -412,6 +412,21 @@ MODULE Input_Opt_Mod LOGICAL :: ddVel_CLM = .TRUE. ! Use dry deposition velocities as computed by the Community Land Model LOGICAL :: applyQtend = .TRUE. ! Apply water vapor tendency to specific humidity #endif + +#ifdef ADJOINT + !---------------------------------------- + ! GCHP adjoint fields + !--------------------------------------- + LOGICAL :: IS_ADJOINT + LOGICAL :: IS_FD_SPOT, IS_FD_GLOBAL + INTEGER :: FD_STEP + LOGICAL :: IS_FD_SPOT_THIS_PET + INTEGER :: IFD, JFD, NFD, LFD, NFD_ADJ + INTEGER :: CF_IMIN, CF_IMAX + INTEGER :: CF_JMIN, CF_JMAX + INTEGER :: CF_LMIN, CF_LMAX +#endif + !---------------------------------------- ! Fields for LINOZ strat chem !---------------------------------------- @@ -923,6 +938,21 @@ SUBROUTINE Set_Input_Opt( am_I_Root, Input_Opt, RC ) Input_Opt%TurnOffHetRates = .FALSE. #endif +#ifdef ADJOINT + !---------------------------------------- + ! Fields for adoint + !--------------------------------------- + Input_Opt%IS_ADJOINT = .FALSE. + Input_Opt%IS_FD_SPOT = .FALSE. + Input_Opt%IS_FD_GLOBAL = .FALSE. + Input_Opt%IS_FD_SPOT_THIS_PET = .FALSE. + Input_Opt%FD_STEP = -999 + Input_Opt%IFD = -999 + Input_Opt%JFD = -999 + Input_Opt%NFD = -999 + Input_Opt%LFD = -999 +#endif + !---------------------------------------- ! Fields for LINOZ strat chem !---------------------------------------- diff --git a/Headers/registry_mod.F90 b/Headers/registry_mod.F90 index 956d29f26..d775227b6 100644 --- a/Headers/registry_mod.F90 +++ b/Headers/registry_mod.F90 @@ -606,6 +606,9 @@ SUBROUTINE Registry_Lookup( am_I_Root, Registry, RegDict, & ! Point to head of linked list Current => Registry + if (.not. ASSOCIATED( Current ) .and. am_I_Root) & + WRITE(*,*) ' Registry head not associated.' + ! As long as this entry of the linked list isn't NULL DO WHILE( ASSOCIATED( Current ) ) diff --git a/Headers/state_chm_mod.F90 b/Headers/state_chm_mod.F90 index 235ced0ab..5dcfe106d 100644 --- a/Headers/state_chm_mod.F90 +++ b/Headers/state_chm_mod.F90 @@ -192,7 +192,12 @@ MODULE State_Chm_Mod ! [kg/kg dry air] CHARACTER(LEN=20) :: Spc_Units ! Species units - !----------------------------------------------------------------------- +#ifdef ADJOINT + REAL(fp), POINTER :: SpeciesAdj (:,:,:,:) ! Species adjoint variables + REAL(fp), POINTER :: CostFuncMask(:,:,:) ! cost function volume mask +#endif + + !---------------------------------------------------------------------- ! Boundary conditions !----------------------------------------------------------------------- REAL(fp), POINTER :: BoundaryCond(:,:,:,:)! Boundary conditions @@ -462,6 +467,12 @@ SUBROUTINE Zero_State_Chm( State_Chm, RC ) State_Chm%Spc_Units = '' State_Chm%BoundaryCond => NULL() +#ifdef ADJOINT + ! Chemical species adjoint variables + State_Chm%SpeciesAdj => NULL() + State_Chm%CostFuncMask => NULL() +#endif + ! RRTMG state State_Chm%RRTMG_iSeed = 0 State_Chm%RRTMG_iCld = 0 @@ -834,6 +845,45 @@ SUBROUTINE Init_State_Chm( Input_Opt, State_Chm, State_Grid, RC ) RETURN ENDIF +#ifdef ADJOINT + !======================================================================== + ! Allocate and initialize chemical species fields + !======================================================================== + chmID = 'SpeciesAdj' + CALL Init_and_Register( & + Input_Opt = Input_Opt, & + State_Chm = State_Chm, & + State_Grid = State_Grid, & + chmId = chmId, & + Ptr2Data = State_Chm%SpeciesAdj, & + nSlots = State_Chm%nSpecies, & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + errMsg = TRIM( errMsg_ir ) // TRIM( chmId ) + CALL GC_Error( errMsg, RC, thisLoc ) + RETURN + ENDIF + + !======================================================================== + ! Allocate and initialize chemical species fields + !======================================================================== + chmID = 'CostFuncMask' + CALL Init_and_Register( & + Input_Opt = Input_Opt, & + State_Chm = State_Chm, & + State_Grid = State_Grid, & + chmId = chmId, & + Ptr2Data = State_Chm%CostFuncMask, & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + errMsg = TRIM( errMsg_ir ) // TRIM( chmId ) + CALL GC_Error( errMsg, RC, thisLoc ) + RETURN + ENDIF +#endif + !======================================================================== ! Boundary conditions (only needed for nested grid simulations) !======================================================================== @@ -3270,6 +3320,18 @@ SUBROUTINE Get_Metadata_State_Chm( am_I_Root, metadataID, Found, & IF ( isRank ) Rank = 3 IF ( isSpc ) PerSpc = 'ALL' +#ifdef ADJOINT + CASE ( 'SPECIESADJ' ) + IF ( isDesc ) Desc = 'Adjoint variables for species' + IF ( isUnits ) Units = 'varies' + IF ( isRank ) Rank = 3 + IF ( isSpc ) PerSpc = 'ALL' + CASE ( 'COSTFUNCMASK' ) + IF ( isDesc ) Desc = 'Cost function volume mask' + IF ( isUnits ) Units = 'none' + IF ( isRank ) Rank = 3 +#endif + CASE( 'BOUNDARYCOND' ) IF ( isDesc ) Desc = 'Transport boundary conditions for species' IF ( isUnits ) Units = 'v/v' diff --git a/Headers/state_diag_mod.F90 b/Headers/state_diag_mod.F90 index a83ac06e8..6a2bbf654 100644 --- a/Headers/state_diag_mod.F90 +++ b/Headers/state_diag_mod.F90 @@ -113,6 +113,18 @@ MODULE State_Diag_Mod TYPE(DgnMap), POINTER :: Map_SpeciesConc LOGICAL :: Archive_SpeciesConc +#ifdef ADJOINT + ! Adjoint variables for diagnostic output + REAL(f8), POINTER :: SpeciesAdj(:,:,:,:) + TYPE(DgnMap), POINTER :: Map_SpeciesAdj + LOGICAL :: Archive_SpeciesAdj + + ! Concentrations + REAL(f8), POINTER :: ScaleICsAdj(:,:,:,:) + TYPE(DgnMap), POINTER :: Map_ScaleICsAdj + LOGICAL :: Archive_ScaleICsAdj +#endif + !%%%%% Budget diagnostics %%%%% REAL(f8), POINTER :: BudgetEmisDryDepFull(:,:,:) @@ -1087,6 +1099,16 @@ SUBROUTINE Zero_State_Diag( State_Diag, RC ) State_Diag%Map_SpeciesConc => NULL() State_Diag%Archive_SpeciesConc = .FALSE. +#ifdef ADJOINT + State_Diag%SpeciesAdj => NULL() + State_Diag%Map_SpeciesAdj => NULL() + State_Diag%Archive_SpeciesAdj = .FALSE. + + State_Diag%ScaleICsAdj => NULL() + State_Diag%Map_ScaleICSAdj => NULL() + State_Diag%Archive_ScaleICsAdj = .FALSE. +#endif + State_Diag%FracOfTimeInTrop => NULL() State_Diag%Archive_FracOfTimeInTrop = .FALSE. @@ -2055,6 +2077,57 @@ SUBROUTINE Init_State_Diag( Input_Opt, State_Chm, State_Grid, & RETURN ENDIF +#ifdef ADJOINT + !------------------------------------------------------------------------ + ! Species adjoint diagnostic + !------------------------------------------------------------------------ + diagId = 'SpeciesAdj' + CALL Init_and_Register( & + Input_Opt = Input_Opt, & + State_Chm = State_Chm, & + State_Diag = State_Diag, & + State_Grid = State_Grid, & + DiagList = Diag_List, & + TaggedDiagList = TaggedDiag_List, & + Ptr2Data = State_Diag%SpeciesAdj, & + archiveData = State_Diag%Archive_SpeciesAdj, & + mapData = State_Diag%Map_SpeciesAdj, & + diagId = diagId, & + diagFlag = 'S', & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + errMsg = TRIM( errMsg_ir ) // TRIM( diagId ) + CALL GC_Error( errMsg, RC, thisLoc ) + RETURN + ENDIF + + !------------------------------------------------------------------------ + ! Species adjoint diagnostic + !------------------------------------------------------------------------ + diagId = 'ScaleICsAdj' + CALL Init_and_Register( & + Input_Opt = Input_Opt, & + State_Chm = State_Chm, & + State_Diag = State_Diag, & + State_Grid = State_Grid, & + DiagList = Diag_List, & + TaggedDiagList = TaggedDiag_List, & + Ptr2Data = State_Diag%ScaleICsAdj, & + archiveData = State_Diag%Archive_ScaleICsAdj, & + mapData = State_Diag%Map_ScaleICsAdj, & + diagId = diagId, & + diagFlag = 'S', & + RC = RC ) + + IF ( RC /= GC_SUCCESS ) THEN + errMsg = TRIM( errMsg_ir ) // TRIM( diagId ) + CALL GC_Error( errMsg, RC, thisLoc ) + RETURN + ENDIF + +#endif + !------------------------------------------------------------------------ ! Fraction of total time each grid box spent in the troposphere !------------------------------------------------------------------------ @@ -8345,6 +8418,20 @@ SUBROUTINE Cleanup_State_Diag( State_Diag, RC ) RC = RC ) IF ( RC /= GC_SUCCESS ) RETURN +#ifdef ADJOINT + CALL Finalize( diagId = 'SpeciesAdj', & + Ptr2Data = State_Diag%SpeciesAdj, & + mapData = State_Diag%Map_SpeciesAdj, & + RC = RC ) + IF ( RC /= GC_SUCCESS ) RETURN + + CALL Finalize( diagId = 'ScaleICsAdj', & + Ptr2Data = State_Diag%ScaleICsAdj, & + mapData = State_Diag%Map_ScaleICsAdj, & + RC = RC ) + IF ( RC /= GC_SUCCESS ) RETURN +#endif + CALL Finalize( diagId = 'FracOfTimeInTrop', & Ptr2Data = State_Diag%FracOfTimeInTrop, & RC = RC ) diff --git a/Interfaces/GCHP/Chem_GridCompMod.F90 b/Interfaces/GCHP/Chem_GridCompMod.F90 index 7d9315bec..998f83225 100644 --- a/Interfaces/GCHP/Chem_GridCompMod.F90 +++ b/Interfaces/GCHP/Chem_GridCompMod.F90 @@ -47,6 +47,7 @@ MODULE Chem_GridCompMod USE CMN_Size_Mod USE ESMF ! ESMF library USE MAPL_Mod ! MAPL library + USE MAPL_IOMod USE Charpak_Mod ! String functions USE DiagList_Mod ! Internal state prefixes USE Hco_Types_Mod, ONLY : ConfigObj @@ -122,6 +123,10 @@ MODULE Chem_GridCompMod ! For mapping State_Chm%Tracers/Species arrays onto the internal state. TYPE(Int2SpcMap), POINTER :: Int2Spc(:) => NULL() +#ifdef ADJOINT + ! For mapping State_Chm%Tracers/Species arrays onto the internal state. + TYPE(Int2SpcMap), POINTER :: Int2Adj(:) => NULL() +#endif ! Objects for GEOS-Chem TYPE(OptInput) :: Input_Opt ! Input Options @@ -426,6 +431,10 @@ SUBROUTINE SetServices( GC, RC ) CHARACTER(LEN=127) :: FullName LOGICAL :: FriendDyn, FriendTurb #endif +#ifdef ADJOINT + INTEGER :: restartAttrAdjoint + LOGICAL :: useCFMaskFile +#endif __Iam__('SetServices') @@ -565,6 +574,22 @@ SUBROUTINE SetServices( GC, RC ) CALL MetVars_For_Lightning_Init( GC, MyState%myCF, __RC__ ) #endif +#ifdef ADJOINT + CALL ESMF_ConfigGetAttribute( myState%myCF, useCFMaskFile, & + Label="USE_CF_MASK_FILE:", Default=.false., __RC__ ) + + IF (useCFMaskFile) THEN + call MAPL_AddImportSpec(GC, & + SHORT_NAME = 'CFN_MASK', & + LONG_NAME = 'cost_function_Mask', & + UNITS = '1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RC=STATUS ) + _VERIFY(STATUS) + Endif +#endif + ! ! !INTERNAL STATE: ! @@ -589,6 +614,9 @@ SUBROUTINE SetServices( GC, RC ) restartAttr = MAPL_RestartOptional ! try to read species from file; ! use background vals if not found ENDIF +#ifdef ADJOINT + restartAttrAdjoint = MAPL_RestartSkip +#endif #endif !-- Read in species from input.geos and set FRIENDLYTO @@ -686,6 +714,20 @@ SUBROUTINE SetServices( GC, RC ) NADV = NADV+1 AdvSpc(NADV) = TRIM(SUBSTRS(1)) #endif +#ifdef ADJOINT + if (MAPL_am_I_Root()) & + WRITE(*,*) ' Adding internal spec for '''//TRIM(SPFX) // TRIM(SUBSTRS(1)) // '_ADJ''' + call MAPL_AddInternalSpec(GC, & + SHORT_NAME = TRIM(SPFX) // TRIM(SUBSTRS(1)) // '_ADJ', & + LONG_NAME = TRIM(SUBSTRS(1)) // ' adjoint variable', & + UNITS = 'mol mol-1', & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + PRECISION = ESMF_KIND_R8, & + FRIENDLYTO = 'DYNAMICS:TURBULENCE:MOIST', & + RESTART = restartAttrAdjoint, & + RC = RC ) +#endif ENDIF ENDDO @@ -774,8 +816,24 @@ SUBROUTINE SetServices( GC, RC ) VLOCATION = MAPL_VLocationCenter, & RESTART = restartAttr, & RC = STATUS ) +#ifdef ADJOINT + if (MAPL_am_I_Root()) & + WRITE(*,*) ' Adding internal spec for '''//TRIM(SPFX) // TRIM(SpcName) // '_ADJ''' + call MAPL_AddInternalSpec(GC, & + SHORT_NAME = TRIM(SPFX) // TRIM(SpcName) // '_ADJ', & + LONG_NAME = SpcName // ' adjoint variable', & + UNITS = 'mol mol-1', & + PRECISION = ESMF_KIND_R8, & + DIMS = MAPL_DimsHorzVert, & + VLOCATION = MAPL_VLocationCenter, & + RESTART = restartAttrAdjoint, & + RC = STATUS ) + + #endif Endif + +#endif ENDDO ENDIF @@ -1806,6 +1864,10 @@ SUBROUTINE Initialize_( GC, Import, Export, Clock, RC ) INTEGER :: h, m, s ! Hour, minute, seconds INTEGER :: doy + INTEGER :: IL_WORLD, JL_WORLD ! # lower indices in global grid + INTEGER :: IU_WORLD, JU_WORLD ! # upper indices in global grid + + __Iam__('Initialize_') !======================================================================= @@ -1831,6 +1893,10 @@ SUBROUTINE Initialize_( GC, Import, Export, Clock, RC ) ! Initialize MAPL Generic CALL MAPL_GenericInitialize( GC, Import, Export, Clock, __RC__ ) +#ifdef ADJOINT + CALL MAPL_GenericStateClockAdd( GC, name='--AdjointCheckpoint', __RC__ ) +#endif + ! Get Internal state. CALL MAPL_Get ( STATE, INTERNAL_ESMF_STATE=INTSTATE, __RC__ ) @@ -1855,6 +1921,10 @@ SUBROUTINE Initialize_( GC, Import, Export, Clock, RC ) IM_WORLD = IM_WORLD, & ! # of lons in global grid JM_WORLD = JM_WORLD, & ! # of lats in global grid LM_WORLD = LM_WORLD, & ! # of levels in global grid + IL_WORLD = IL_WORLD, & ! start index of lons in global grid on this PET + IU_WORLD = IU_WORLD, & ! end index of lons in global grid on this PET + JL_WORLD = JL_WORLD, & ! start index of lats in global grid on this PET + JU_WORLD = JU_WORLD, & ! end index of lats in global grid on this PET nymdB = nymdB, & ! YYYYMMDD @ start of sim nhmsB = nhmsB, & ! hhmmss @ end of sim nymdE = nymdE, & ! YYYMMDD @ start of sim @@ -2410,6 +2480,56 @@ SUBROUTINE Initialize_( GC, Import, Export, Clock, RC ) SpcInfo => NULL() ENDDO + +#ifdef ADJOINT + if (Input_Opt%is_Adjoint) THEN + ! Now do the same for adjoint variables + ALLOCATE( Int2Adj(nFlds), STAT=STATUS ) + _ASSERT(STATUS==0,'informative message here') + + ! Do for every tracer in State_Chm + DO I = 1, nFlds + + ! Get info about this species from the species database + N = State_Chm%Map_Advect(I) + ThisSpc => State_Chm%SpcData(N)%Info + + ! Pass tracer name + Int2Adj(I)%Name = TRIM(ThisSpc%Name) + + ! Get tracer ID + Int2Adj(I)%ID = IND_( TRIM(Int2Spc(I)%Name) ) + + ! If tracer ID is not valid, make sure all vars are at least defined. + IF ( Int2Spc(I)%ID <= 0 ) THEN + Int2Spc(I)%Internal => NULL() + CYCLE + ENDIF + + ! Get internal state field + CALL ESMF_StateGet( INTSTATE, TRIM(SPFX) // TRIM(Int2Spc(I)%Name) // '_ADJ', & + GcFld, RC=STATUS ) + + ! This is mostly for testing + IF ( STATUS /= ESMF_SUCCESS ) THEN + IF( am_I_Root ) THEN + WRITE(*,*) 'Cannot find in internal state: ', TRIM(SPFX) & + //TRIM(Int2Spc(I)%Name)//'_ADJ',I + ENDIF + _ASSERT(.FALSE.,'informative message here') + ENDIF + + ! Get pointer to field + CALL ESMF_FieldGet( GcFld, 0, Ptr3D, __RC__ ) + Int2Adj(I)%Internal => Ptr3D + + ! Free pointers + Ptr3D => NULL() + ThisSpc => NULL() + + ENDDO + ENDIF +#endif !#if defined( MODEL_GEOS ) ! !======================================================================= @@ -3109,9 +3229,19 @@ SUBROUTINE Run_( GC, Import, Export, Clock, Phase, RC ) ! Alarms type(GC_run_alarms), pointer :: GC_alarms type(GCRA_wrap) :: GC_alarm_wrapper - + ! First call? LOGICAL, SAVE :: FIRST = .TRUE. + INTEGER :: NFD, K + LOGICAL :: LAST + TYPE(ESMF_Time ) :: currTime, stopTime + TYPE(ESMF_TimeInterval) :: tsChemInt + CHARACTER(len=ESMF_MAXSTR) :: timestring1, timestring2 +#ifdef ADJOINT + LOGICAL :: isStartTime + REAL(ESMF_KIND_r8), POINTER :: CostFuncMask(:,:,:) => NULL() +#endif + __Iam__('Run_') @@ -3149,9 +3279,10 @@ SUBROUTINE Run_( GC, Import, Export, Clock, Phase, RC ) CALL MAPL_Get(STATE, RUNALARM=ALARM, __RC__) IsChemTime = ESMF_AlarmIsRinging(ALARM, __RC__) + ! if (am_I_Root) WRITE(*,*) ' Chem clock is reverse? ', ESMF_ClockIsReverse(CLOCK) ! Turn off alarm: only if it was on and this is phase 2 (don't turn off ! after phase 1 since this would prevent phase 2 from being executed). - IF ( IsChemTime .AND. PHASE /= 1 ) THEN + IF ( IsChemTime .AND. PHASE /= 1 .and. .not. ESMF_ClockIsReverse(CLOCK)) THEN CALL ESMF_AlarmRingerOff(ALARM, __RC__ ) ENDIF @@ -3209,6 +3340,13 @@ SUBROUTINE Run_( GC, Import, Export, Clock, Phase, RC ) !IsRunTime = .TRUE. #endif +#ifdef ADJOINT + if (Input_Opt%is_adjoint .and. first) THEN + ! the forward model doesn't actually trigger on the final + ! timestep, so we should skip the first one + IsRunTime = .false. + end if +#endif ! Is it time to update tendencies? ! Tendencies shall only be updated when chemistry is done, which is ! Phase -1 or 2. @@ -3289,6 +3427,13 @@ SUBROUTINE Run_( GC, Import, Export, Clock, Phase, RC ) HcoState%IMPORT => IMPORT HcoState%EXPORT => EXPORT #endif +#ifdef ADJOINT + call MAPL_GetPointer( IMPORT, CostFuncMask, & + 'CFN_MASK', notFoundOK=.TRUE., & + __RC__ ) + if (MAPL_Am_I_Root() .and. .not. ASSOCIATED(CostFuncMask)) & + WRITE(*,*) ' No CFN_MASK import variable found' +#endif ! Run when it's time to do so ! Always run on first call to make sure that all variables become @@ -3500,6 +3645,36 @@ SUBROUTINE Run_( GC, Import, Export, Clock, Phase, RC ) _VERIFY(STATUS) ENDIF +#ifdef ADJOINT + IF (IsRunTime) THEN + IF (Input_opt%IS_ADJOINT) THEN + call WRITE_PARALLEL(' Resetting state from checkpoint file') + ! call MAPL_GenericRefresh(GC, Import, Export, Clock, RC) + call Adjoint_StateRefresh( GC, IMPORT, EXPORT, CLOCK, RC ) + ! Loop over all species and get info from spc db + DO N = 1, State_Chm%nSpecies + ThisSpc => State_Chm%SpcData(N)%Info + !IF (ThisSpc%Is_Advected) CYCLE + IF ( TRIM(ThisSpc%Name) == '' ) CYCLE + IND = IND_( TRIM(ThisSpc%Name ) ) + IF ( IND < 0 ) CYCLE + ! Get data from internal state and copy to species array + CALL MAPL_GetPointer( INTERNAL, Ptr3D_R8, TRIM(SPFX) // & + TRIM(ThisSpc%Name), notFoundOK=.TRUE., & + __RC__ ) + State_Chm%Species(:,:,:,IND) = Ptr3D_R8(:,:,State_Grid%NZ:1:-1) + if ( MAPL_am_I_Root()) WRITE(*,*) & + 'Initialized species from INTERNAL state: ', TRIM(ThisSpc%Name) + + enddo + ELSE + call WRITE_PARALLEL(' Recording state to checkpoint file') + call Adjoint_StateRecord( GC, IMPORT, EXPORT, CLOCK, RC ) + ! call WRITE_PARALLEL(' Done recording state to checkpoint files') + ENDIF + ENDIF +#endif + ! !======================================================================= ! ! pre-Run method array assignments. This passes the tracer arrays from ! ! the internal state to State_Chm. On the first call, it also fills the @@ -3522,6 +3697,17 @@ SUBROUTINE Run_( GC, Import, Export, Clock, Phase, RC ) ! Flip in the vertical State_Chm%Species = State_Chm%Species(:,:,State_Grid%NZ:1:-1,:) +#ifdef ADJOINT + IF (Input_Opt%Is_Adjoint) THEN + DO I = 1, SIZE(Int2Adj,1) + IF ( Int2Adj(I)%ID <= 0 ) CYCLE + State_Chm%SpeciesAdj(:,:,:,Int2Adj(I)%ID) = Int2Adj(I)%Internal + ENDDO + + ! Flip in the vertical + State_Chm%SpeciesAdj = State_Chm%SpeciesAdj( :, :, State_Grid%NZ:1:-1, : ) + ENDIF +#endif !======================================================================= ! On first call, also need to initialize the species from restart file. ! Only need to do this for species that are not advected, i.e. species @@ -3532,7 +3718,11 @@ SUBROUTINE Run_( GC, Import, Export, Clock, Phase, RC ) ! (advected species will be updated with tracers) ! ckeller, 10/27/2014 !======================================================================= +#ifdef ADJOINT + IF ( FIRST .or. Input_Opt%IS_ADJOINT) THEN +#else IF ( FIRST ) THEN +#endif ! Get Generic State call MAPL_GetObjectFromGC ( GC, STATE, RC=STATUS) @@ -3543,6 +3733,7 @@ SUBROUTINE Run_( GC, Import, Export, Clock, Phase, RC ) ! Loop over all species and get info from spc db DO N = 1, State_Chm%nSpecies ThisSpc => State_Chm%SpcData(N)%Info + IF (ThisSpc%Is_Advected) CYCLE IF ( TRIM(ThisSpc%Name) == '' ) CYCLE IND = IND_( TRIM(ThisSpc%Name ) ) IF ( IND < 0 ) CYCLE @@ -3857,13 +4048,15 @@ SUBROUTINE Run_( GC, Import, Export, Clock, Phase, RC ) ! Fix negatives! ! These can be brought in as an artifact of convection. +#ifndef ADJOINT WHERE ( State_Chm%Species < 0.0e0 ) State_Chm%Species = 1.0e-36 END WHERE +#endif ! Execute GEOS-Chem if it's time to run it IF ( IsRunTime ) THEN - + ! This is mostly for testing #if defined( MODEL_GEOS ) IF ( FIRST .AND. Input_Opt%haveImpRst ) THEN @@ -3900,6 +4093,32 @@ SUBROUTINE Run_( GC, Import, Export, Clock, Phase, RC ) second = 0 #endif +#ifdef ADJOINT + !======================================================================= + ! If this is an adjoint run, we need to check for the final (first) + ! timestep and multiply the scaling factor adjoint by the initial concs + !======================================================================= + isStartTime = .false. + IF (Input_Opt%IS_ADJOINT) THEN + call ESMF_ClockGet(clock, currTime=currTime, startTime=stopTime, __RC__ ) + else + call ESMF_ClockGet(clock, currTime=currTime, stopTime=stopTime, __RC__ ) + Endif + + ! call ESMF_TimeIntervalSet(tsChemInt, s_r8=real(-tsChem, 8), __RC__ ) + ! this variable is set to zero but I'm leaving it in case I need this code later + call ESMF_TimeIntervalSet(tsChemInt, s_r8=real(0, 8), __RC__ ) + + call ESMF_TimeGet(currTime + tsChemInt, timeString=timestring1, __RC__ ) + call ESMF_TimeGet(stopTime, timeString=timestring2, __RC__ ) + + if (memdebuglevel > 0 .and. am_I_Root) & + WRITE(*,*) ' Adjoint checking if ' // trim(timestring1) // ' == ' // trim(timestring2) + + if (currTime + tsChemInt == stopTime) THEN + isStartTime = .TRUE. + ENDIF +#endif ! Run the GEOS-Chem column chemistry code for the given phase CALL GCHP_Chunk_Run( GC = GC, & ! Grid comp ref. nymd = nymd, & ! Current YYYYMMDD @@ -3923,9 +4142,12 @@ SUBROUTINE Run_( GC, Import, Export, Clock, Phase, RC ) IsRadTime = IsRadTime, & ! Time for RRTMG? #if defined( MODEL_GEOS ) FrstRewind = FirstRewind,& ! First rewind? +#endif +#ifdef ADJOINT + isStartTime = isStartTime, & !back to the first timestep in the reverse run? #endif __RC__ ) ! Success or fail? - + CALL MAPL_TimerOff(STATE, "DO_CHEM") #if !defined( MODEL_GEOS ) @@ -3975,6 +4197,17 @@ SUBROUTINE Run_( GC, Import, Export, Clock, Phase, RC ) IF ( Int2Spc(I)%ID <= 0 ) CYCLE Int2Spc(I)%Internal = State_Chm%Species(:,:,:,Int2Spc(I)%ID) ENDDO +#ifdef ADJOINT + IF (Input_Opt%Is_Adjoint) THEN + State_Chm%SpeciesAdj = State_Chm%SpeciesAdj(:,:,State_Grid%NZ:1:-1,:) + + DO I = 1, SIZE(Int2Adj,1) + WRITE(*,*) 'Copying adjoint ', Int2Adj(I)%ID, ' to ', I + IF ( Int2Adj(I)%ID <= 0 ) CYCLE + Int2Adj(I)%Internal = State_Chm%SpeciesAdj(:,:,:,Int2Adj(I)%ID) + ENDDO + ENDIF +#endif #endif CALL MAPL_TimerOff(STATE, "CP_AFTR") @@ -4519,8 +4752,18 @@ SUBROUTINE Finalize_( GC, Import, Export, Clock, RC ) REAL, POINTER :: Ptr3D(:,:,:) => NULL() REAL(ESMF_KIND_R8), POINTER :: Ptr2D_R8(:,:) => NULL() REAL(ESMF_KIND_R8), POINTER :: Ptr3D_R8(:,:,:) => NULL() + + INTEGER :: N, K, NFD + CHARACTER(LEN=ESMF_MAXSTR) :: TrcName +#endif +#ifdef ADJOINT + ! Finite difference test variables + INTEGER :: IFD, JFD, LFD + REAL*8 :: CFN + CHARACTER(len=ESMF_MAXSTR) :: FD_SPEC #endif + __Iam__('Finalize_') !======================================================================= @@ -4576,12 +4819,30 @@ SUBROUTINE Finalize_( GC, Import, Export, Clock, RC ) ! Is this a tracer? IND = IND_( TRIM(ThisSpc%Name) ) +#ifndef ADJOINT IF ( IND >= 0 ) CYCLE +#else + IF ( IND >= 0 ) THEN + ! Get data from internal state and copy to species array + CALL MAPL_GetPointer( INTSTATE, Ptr3D_R8, TRIM(SPFX) // & + TRIM(ThisSpc%Name), & + notFoundOK=.TRUE., __RC__ ) + IF ( .NOT. ASSOCIATED(Ptr3D_R8) .and. MAPL_am_I_Root() ) & + WRITE(*,999) TRIM(SPFX) // TRIM(ThisSpc%Name), IND + IF ( .NOT. ASSOCIATED(Ptr3D_R8) ) CYCLE +999 FORMAT(' No INTERNAL pointer found for ', a12, ' with IND ', i3) + + State_Chm%Species(:,:,:,IND) = Ptr3D_R8(:,:,State_Grid%NZ:1:-1) + ! Verbose + if ( MAPL_am_I_Root()) write(*,*) & + 'Species copied from INTERNAL state: ', & + TRIM(ThisSpc%Name) + ELSE +#endif ! Get data from internal state and copy to species array CALL MAPL_GetPointer( INTSTATE, Ptr3D_R8, TRIM(ThisSpc%Name), & notFoundOK=.TRUE., __RC__ ) - IF ( .NOT. ASSOCIATED(Ptr3D_R8) ) CYCLE Ptr3D_R8 = State_Chm%Species(:,:,State_Grid%NZ:1:-1,IND) Ptr3D_R8 => NULL() @@ -4589,6 +4850,9 @@ SUBROUTINE Finalize_( GC, Import, Export, Clock, RC ) if ( MAPL_am_I_Root()) write(*,*) & 'Species written to INTERNAL state: ', & TRIM(ThisSpc%Name) +#ifdef ADJOINT + endif +#endif ENDDO CALL MAPL_GetPointer( INTSTATE, Ptr3d_R8, 'H2O2AfterChem', & @@ -4726,6 +4990,31 @@ SUBROUTINE Finalize_( GC, Import, Export, Clock, RC ) HcoState%EXPORT => EXPORT #endif +#ifdef ADJOINT + IF (Input_Opt%IS_FD_SPOT_THIS_PET .and. .not. Input_Opt%IS_FD_GLOBAL) THEN + FD_SPEC = transfer(state_chm%SpcData(Input_Opt%NFD)%Info%Name, FD_SPEC) + IFD = Input_Opt%IFD + JFD = Input_Opt%JFD + LFD = Input_Opt%LFD + NFD = Input_Opt%NFD + ! print out the cost function + WRITE(*,*) ' Computing final cost function' + CFN = 0d0 + DO L = 1, State_Grid%NZ + DO J = 1, State_Grid%NY + DO I = 1, State_Grid%NX + if (State_Chm%CostFuncMask(I,J,L) > 0d0) THEN + WRITE (*, 1047) I, J, L, state_chm%species(I, J, L, NFD) + CFN = CFN + state_chm%Species(I, J, L, NFD) + endif + ENDDO + ENDDO + ENDDO + WRITE(*,'(a7, e22.10)') ' CFN = ', CFN +1047 FORMAT(' SPC(', i2, ', ', i2, ', ', i2, ') = ', e22.10) + ENDIF +#endif + ! Finalize HEMCO CALL HCOI_GC_FINAL( .FALSE., RC ) IF ( Input_Opt%AmIRoot ) THEN @@ -4799,6 +5088,16 @@ SUBROUTINE Finalize_( GC, Import, Export, Clock, RC ) DEALLOCATE(Int2Spc) ENDIF +#ifdef ADJOINT + ! Free Int2Adj pointer + IF ( ASSOCIATED(Int2Adj) ) THEN + DO I=1,SIZE(Int2Adj,1) + Int2Adj(I)%Internal => NULL() + ENDDO + DEALLOCATE(Int2Adj) + ENDIF +#endif + ! Deallocate the history interface between GC States and ESMF Exports CALL Destroy_HistoryConfig( am_I_Root, HistoryConfig, RC ) @@ -4863,6 +5162,7 @@ SUBROUTINE Extract_( GC, Clock, Grid, MaplCF, GeosCF, & localPet, petCount, & IM, JM, LM, & IM_WORLD, JM_WORLD, LM_WORLD, & + IL_WORLD, IU_WORLD, JL_WORLD, JU_WORLD, & lonCtr, latCtr, advCount, & nymdB, nymdE, nymd, nhmsB, nhmsE, & nhms, year, month, day, dayOfYr, & @@ -4910,6 +5210,10 @@ SUBROUTINE Extract_( GC, Clock, Grid, MaplCF, GeosCF, & INTEGER, INTENT(OUT), OPTIONAL :: IM_WORLD ! Global # lons INTEGER, INTENT(OUT), OPTIONAL :: JM_WORLD ! Global # lats INTEGER, INTENT(OUT), OPTIONAL :: LM_WORLD ! Global # levs + INTEGER, INTENT(OUT), OPTIONAL :: IL_WORLD ! Global start lon index on this PET + INTEGER, INTENT(OUT), OPTIONAL :: IU_WORLD ! Global end lon index on this PET + INTEGER, INTENT(OUT), OPTIONAL :: JL_WORLD ! Global start lat index on this PET + INTEGER, INTENT(OUT), OPTIONAL :: JU_WORLD ! Global end lat index on this PET !---------------------------------- ! Date and time variables @@ -4996,6 +5300,8 @@ SUBROUTINE Extract_( GC, Clock, Grid, MaplCF, GeosCF, & REAL :: elapsedHours ! Elapsed hours of run REAL(ESMF_KIND_R8) :: dt_r8 ! chemistry timestep + CHARACTER(len=ESMF_MAXSTR) :: OUTSTR ! Parallel write nonsense + __Iam__('Extract_') !======================================================================= @@ -5074,7 +5380,7 @@ SUBROUTINE Extract_( GC, Clock, Grid, MaplCF, GeosCF, & CALL ESMF_TimeIntervalGet( chemInterval, s_r8=dt_r8, __RC__ ) tsChem = real(dt_r8) - IF(tsChem < tsDyn) THEN + IF(abs(tsChem) < abs(tsDyn)) THEN IF( MAPL_AM_I_ROOT() ) THEN #if defined( MODEL_GEOS ) WRITE(6,*) 'GEOSCHEMCHEM_DT cannot be less than RUN_DT' @@ -5234,6 +5540,11 @@ SUBROUTINE Extract_( GC, Clock, Grid, MaplCF, GeosCF, & ! Get the upper and lower bounds of on each PET using MAPL CALL MAPL_GridGetInterior( Grid, IL, IU, JL, JU ) #endif + ! if (PRESENT(localPet)) THEN + ! WRITE (*,1141) localPet, IL, IU, JL, JU + ! endif + +1141 FORMAT(' Process ', i5, ' goes from I = ', i3, ':', i3, ' J = ', i3, ':', i3) ENDIF @@ -5245,6 +5556,11 @@ SUBROUTINE Extract_( GC, Clock, Grid, MaplCF, GeosCF, & IF ( PRESENT( JM_WORLD ) ) JM_WORLD = globDims(2) IF ( PRESENT( LM_WORLD ) ) LM_WORLD = globDims(3) + IF ( PRESENT( IL_WORLD ) ) IL_WORLD = IL + IF ( PRESENT( IU_WORLD ) ) IU_WORLD = IU + IF ( PRESENT( JL_WORLD ) ) JL_WORLD = JL + IF ( PRESENT( JU_WORLD ) ) JU_WORLD = JU + ! Longitude values on this PET IF ( PRESENT( lonCtr ) ) THEN CALL MAPL_Get( STATE, lons=lonCtr, __RC__ ) @@ -5288,6 +5604,7 @@ SUBROUTINE Extract_( GC, Clock, Grid, MaplCF, GeosCF, & END SUBROUTINE Extract_ !EOC + #if defined( MODEL_GEOS ) !------------------------------------------------------------------------------ ! GEOS-Chem Global Chemical Model ! @@ -8316,8 +8633,169 @@ end function monin_obukhov_length !EOC #endif +#ifdef ADJOINT + subroutine Adjoint_StateRecord( GC, IMPORT, EXPORT, CLOCK, RC ) + + ! !ARGUMENTS: + + type(ESMF_GridComp), intent(inout) :: GC ! composite 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: + ! = 0 all is well + ! otherwise, error + !EOPI + + ! LOCAL VARIABLES + + character(len=ESMF_MAXSTR) :: IAm + character(len=ESMF_MAXSTR) :: COMP_NAME + integer :: STATUS + + type (MAPL_MetaComp), pointer :: STATE + type (ESMF_State) :: INTERNAL + integer :: hdr + character(len=ESMF_MAXSTR) :: FILETYPE + character(len=ESMF_MAXSTR) :: FNAME, DATESTAMP + + !============================================================================= + + ! Begin... + + _UNUSED_DUMMY(EXPORT) + + Iam = "Adjoint_StateRecord" + call ESMF_GridCompGet(GC, name=COMP_NAME, RC=STATUS ) + _VERIFY(STATUS) + Iam = trim(COMP_NAME) // Iam + + ! Get my MAPL_Generic state + ! ------------------------- + CALL MAPL_GetObjectFromGC(GC, STATE, RC=STATUS) + _VERIFY(STATUS) + + ! Get Internal State + call MAPL_Get( STATE, INTERNAL_ESMF_STATE=INTERNAL, __RC__ ) + + hdr = 0 + ! call MAPL_GetResource( STATE , hdr, & + ! default=0, & + ! LABEL="INTERNAL_HEADER:", & + ! RC=STATUS) + ! _VERIFY(STATUS) + + call MAPL_DateStampGet(clock, datestamp, __RC__ ) + + FILETYPE = 'pnc4' + FNAME = 'gcadj_import_checkpoint.' // trim(datestamp) // '.nc4' + + call MAPL_CheckpointState(IMPORT, CLOCK, & + FNAME, & + FILETYPE, STATE, hdr/=0, & + RC=STATUS) + _VERIFY(STATUS) + + FNAME = 'gcadj_internal_checkpoint.' // trim(datestamp) // '.nc4' + + call MAPL_CheckpointState(INTERNAL, CLOCK, & + FNAME, & + FILETYPE, STATE, hdr/=0, & + RC=STATUS) + _VERIFY(STATUS) + + + _RETURN(ESMF_SUCCESS) + end subroutine Adjoint_StateRecord + + subroutine Adjoint_StateRefresh( GC, IMPORT, EXPORT, CLOCK, RC ) + + ! !ARGUMENTS: + + type(ESMF_GridComp), intent(inout) :: GC ! composite 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: + ! = 0 all is well + ! otherwise, error + !EOPI + + ! LOCAL VARIABLES + + character(len=ESMF_MAXSTR) :: IAm + character(len=ESMF_MAXSTR) :: COMP_NAME + integer :: STATUS + + type (MAPL_MetaComp), pointer :: STATE + type (ESMF_State) :: INTERNAL + integer :: hdr + integer :: unit + + character(len=ESMF_MAXSTR) :: FNAME, datestamp + + !============================================================================= + + _UNUSED_DUMMY(EXPORT) + + ! Begin... + + Iam = "Adjoint_StateRefresh" + call ESMF_GridCompGet(GC, name=COMP_NAME, RC=STATUS ) + _VERIFY(STATUS) + Iam = trim(COMP_NAME) // Iam + + ! Get my MAPL_Generic state + ! ------------------------- + CALL MAPL_GetObjectFromGC(GC, STATE, RC=STATUS) + _VERIFY(STATUS) + + ! Get Internal state + CALL MAPL_Get ( STATE, INTERNAL_ESMF_STATE=INTERNAL, __RC__ ) + + call MAPL_DateStampGet(clock, datestamp, rc=status) + _VERIFY(STATUS) + + HDR = 0 + + FNAME = 'gcadj_import_checkpoint.' // trim(datestamp) // '.nc4' + + call MAPL_ESMFStateReadFromFile(IMPORT, CLOCK, & + FNAME, & + STATE, .FALSE., RC=STATUS) + _VERIFY(STATUS) + UNIT = GETFILE(FNAME, RC=STATUS) + _VERIFY(STATUS) + call MAPL_DestroyFile(unit = UNIT, rc=STATUS) + _VERIFY(STATUS) + CALL FREE_FILE(UNIT, RC=STATUS) + _VERIFY(STATUS) + + FNAME = 'gcadj_internal_checkpoint.' // trim(datestamp) // '.nc4' + + call MAPL_ESMFStateReadFromFile(INTERNAL, CLOCK, & + FNAME, & + STATE, hdr/=0, RC=STATUS) + _VERIFY(STATUS) + IF (FNAME(1:1) .eq. '-' .or. & + FNAME(1:1) .eq. '+') THEN + UNIT = GETFILE(FNAME(2:), RC=STATUS) + else + UNIT = GETFILE(FNAME, RC=STATUS) + endif + _VERIFY(STATUS) + call MAPL_DestroyFile(unit = UNIT, rc=STATUS) + _VERIFY(STATUS) + CALL FREE_FILE(UNIT, RC=STATUS) + _VERIFY(STATUS) + + _RETURN(ESMF_SUCCESS) + end subroutine Adjoint_StateRefresh + +#endif + #ifdef MODEL_GEOS - END MODULE GEOSCHEMchem_GridCompMod +END MODULE GEOSCHEMchem_GridCompMod #else - END MODULE Chem_GridCompMod +END MODULE Chem_GridCompMod #endif diff --git a/Interfaces/GCHP/Includes_Before_Run.H b/Interfaces/GCHP/Includes_Before_Run.H index 255d06ca5..9f18a0ae1 100644 --- a/Interfaces/GCHP/Includes_Before_Run.H +++ b/Interfaces/GCHP/Includes_Before_Run.H @@ -121,6 +121,7 @@ End Do End Do + ! Read MODIS leaf area index (LAI) from imports of post-processed MODIS files. ! The third dimension is land type and not level, possible to do with MAPL ! only because the # of land types is the same as # of level edges. @@ -156,3 +157,35 @@ !========================================================================= State_Met%FLASH_DENS = FLASH_DENS ! #/km2/s State_Met%CONV_DEPTH = CONV_DEPTH ! m + +#ifdef ADJOINT + IF (ASSOCIATED(CostFuncMask)) THEN + if (MAPL_Am_I_Root()) & + WRITE(*,*) ' Loading adjoint cost function mask' + ! cost function mask + State_Chm%CostFuncMask = CostFuncMask + ELSEIF (Input_Opt%CF_IMIN > 0 .and. Input_Opt%CF_JMIN > 0) THEN + IF (FIRST) THEN + if (MAPL_Am_I_Root()) & + WRITE(*,*) ' Cost function range supplied.' + WRITE(*,1027) Input_Opt%thisCPU, & + Input_Opt%CF_IMIN, Input_Opt%CF_IMAX, & + Input_Opt%CF_JMIN, Input_Opt%CF_JMAX, & + Input_Opt%CF_LMIN, Input_Opt%CF_LMAX +1027 FORMAT('CF on Pet ', i3, ' I = (', i3, ', ', i3, ') & + J = ( ', i3, ', ', i3, ') & + L = (', i3, ', ', i3, ')') + + + State_Chm%CostFuncMask = 0d0 + DO L=Input_Opt%CF_LMIN,Input_Opt%CF_LMAX + DO J=Input_Opt%CF_JMIN,Input_opt%CF_JMAX + DO I=Input_opt%CF_IMIN, Input_Opt%CF_IMAX + State_Chm%CostFuncMask(I,J,L) = 1d0 + ENDDO + ENDDO + ENDDO + ENDIF + ENDIF + +#endif diff --git a/Interfaces/GCHP/gchp_chunk_mod.F90 b/Interfaces/GCHP/gchp_chunk_mod.F90 index 3dae3e51d..5fc9b8557 100644 --- a/Interfaces/GCHP/gchp_chunk_mod.F90 +++ b/Interfaces/GCHP/gchp_chunk_mod.F90 @@ -79,7 +79,8 @@ SUBROUTINE GCHP_Chunk_Init( nymdB, nhmsB, nymdE, & USE Linoz_Mod, ONLY : Linoz_Read USE PhysConstants, ONLY : PI_180 USE Pressure_Mod, ONLY : Init_Pressure - USE State_Chm_Mod, ONLY : ChmState + USE Roundoff_Mod, ONLY : RoundOff + USE State_Chm_Mod, ONLY : ChmState, Ind_ USE State_Diag_Mod, ONLY : DgnState USE State_Grid_Mod, ONLY : GrdState, Init_State_Grid USE State_Met_Mod, ONLY : MetState @@ -90,6 +91,9 @@ SUBROUTINE GCHP_Chunk_Init( nymdB, nhmsB, nymdE, & USE Time_Mod, ONLY : Set_Timesteps USE UCX_MOD, ONLY : INIT_UCX USE UnitConv_Mod, ONLY : Convert_Spc_Units +#ifdef ADJOINT + USE Charpak_Mod, ONLY : To_UpperCase +#endif #if defined( RRTMG ) USE RRTMG_RAD_TRANSFER_MOD, ONLY : Init_RRTMG_Rad_Transfer USE RRTMG_LW_Init, ONLY : RRTMG_LW_Ini @@ -141,6 +145,32 @@ SUBROUTINE GCHP_Chunk_Init( nymdB, nhmsB, nymdE, & CHARACTER(LEN=ESMF_MAXSTR) :: Iam TYPE(ESMF_Config) :: CF ! Grid comp config object +#ifdef ADJOINT + ! Adoint variables + ! Local Finite Difference variables + REAL(fp) :: FD_LAT, FD_LON + INTEGER :: FD_STEP + CHARACTER(LEN=ESMF_MAXSTR) :: FD_SPEC + REAL(fp) :: d, dmin + INTEGER :: imin, jmin, NFD, LFD + INTEGER :: IFD, JFD + CHARACTER(LEN=ESMF_MAXSTR) :: FD_TYPE + + ! At present, we are unable to load cube-sphere files through ExtData + ! so we will define the cost function region thusly in GCHP.rc + INTEGER :: CF_IMIN, CF_IMAX + INTEGER :: CF_JMIN, CF_JMAX + INTEGER :: CF_LMIN, CF_LMAX + + ! Need to get gloabl grid information for some FD spot tests + TYPE(ESMF_Grid) :: grid ! ESMF Grid object + INTEGER :: IL_PET, IU_PET ! Global lon bounds on this PET + INTEGER :: JL_PET, JU_PET ! Global lat bounds on this PET + + ! Model phase: fwd, TLM, ADJOINT + CHARACTER(LEN=ESMF_MAXSTR) :: ModelPhase +#endif + !======================================================================= ! GCHP_CHUNK_INIT begins here !======================================================================= @@ -220,6 +250,252 @@ SUBROUTINE GCHP_Chunk_Init( nymdB, nhmsB, nymdE, & State_Chm, State_Diag, State_Grid, State_Met, RC ) _ASSERT(RC==GC_SUCCESS, 'Error calling GC_Init_StateObj') +#ifdef ADJOINT + ! Are we running the adjoint? + call ESMF_ConfigGetAttribute(CF, ModelPhase, & + Label="MODEL_PHASE:" , & + Default="FORWARD", RC=STATUS) + _VERIFY(STATUS) + call WRITE_PARALLEL('Checking if this is adjoint. Model phase = "' // trim(ModelPhase) // '"') + input_opt%IS_ADJOINT = .FALSE. + if (TRIM(ModelPhase) .eq. 'ADJOINT') THEN + call WRITE_PARALLEL('Yes! Setting IS_ADJOINT to true.') + input_opt%IS_ADJOINT = .TRUE. + endif + + call ESMF_ConfigGetAttribute(CF, FD_TYPE, & + Label="FD_TYPE:" , Default='NONE', RC=STATUS) + _VERIFY(STATUS) + + Input_Opt%IS_FD_GLOBAL = TRIM(To_UpperCase(FD_TYPE(1:4))) == 'GLOB' + Input_Opt%IS_FD_SPOT = TRIM(To_UpperCase(FD_TYPE(1:4))) == 'SPOT' + IF (MAPL_Am_I_Root()) THEN + WRITE(*,1091) TRIM(FD_TYPE), Input_Opt%IS_FD_GLOBAL, Input_Opt%IS_FD_SPOT + ENDIF +1091 FORMAT('FD_TYPE = ', a6, ', FD_GLOB = ', L1, ', FD_SPOT = ', L1) + + + + call ESMF_ConfigGetAttribute(CF, FD_STEP, & + Label="FD_STEP:" , Default=-1, RC=STATUS) + _VERIFY(STATUS) + + IF (Input_Opt%IS_FD_GLOBAL .or. Input_Opt%IS_FD_SPOT) THEN + _ASSERT(FD_STEP /= -1, 'FD_GLOB or FD_SPOT require FD_STEP') + ENDIF + + + if (.not. FD_STEP == -1 .and. input_opt%IS_ADJOINT) THEN + Input_Opt%FD_STEP = FD_STEP + + call ESMF_ConfigGetAttribute(CF, FD_SPEC, & + Label="FD_SPEC:", default="", RC=STATUS) + _VERIFY(STATUS) + IF (TRIM(FD_SPEC ) == "") THEN + NFD = -1 + ELSE + NFD = Ind_(FD_SPEC) + ENDIF + + call ESMF_ConfigGetAttribute(CF, IFD, & + Label="IFD:", default=-1, RC=STATUS) + _VERIFY(STATUS) + + call ESMF_ConfigGetAttribute(CF, JFD, & + Label="JFD:", default=-1, RC=STATUS) + _VERIFY(STATUS) + + ! Get the ESMF grid attached to this gridded component + CALL ESMF_GridCompGet( GC, grid=Grid, __RC__ ) + + ! Get the upper and lower bounds of on each PET using MAPL + CALL MAPL_GridGetInterior( Grid, IL_PET, IU_PET, JL_PET, JU_PET ) + + ! See if we specified IFD and JFD in GCHP.rc + IF ( IFD > 0 .and. JFD > 0 ) THEN + + if (IL_PET .le. IFD .and. IFD .le. IU_PET .and. & + JL_PET .le. JFD .and. JFD .le. JU_PET) THEN + Input_Opt%IS_FD_SPOT_THIS_PET = .true. + Input_opt%IFD = IFD - IL_PET + 1 + Input_Opt%JFD = JFD - JL_PET + 1 + + ! set these for debug printing + DMIN = 0.0 + IMIN = Input_Opt%IFD + JMIN = Input_Opt%JFD + ENDIF + + ELSE + + call ESMF_ConfigGetAttribute(CF, FD_LAT, & + Label="FD_LAT:", default=-999.0d0, RC=STATUS) + _VERIFY(STATUS) + + call ESMF_ConfigGetAttribute(CF, FD_LON, & + Label="FD_LON:", default=-999.0d0, RC=STATUS) + _VERIFY(STATUS) + + _ASSERT( FD_LAT .ne. -999.0d0 .and. FD_LON .ne. -999.0d0, 'FD_SPOT requires either IFD and JFD or FD_LAT and FD_LON be set in GCHP.rc') + + + dmin = 99999.9 + imin = -1 + jmin = -1 + ! try to find lat lon grid cell closest to 44.65, -63.58 (Halifax, NS) + DO I = 1, state_grid%nx + DO J = 1, state_grid%ny + d = sqrt((state_grid%XMID(I,J) - FD_LON)**2 + & + (state_grid%YMID(I,J) - FD_LAT)**2) + if (d < dmin) then + dmin = d + imin = i + jmin = j + endif + enddo + enddo + ! this is terrible. We need a better way to figure out if we're really in + ! a grid cell, bbut I don't know how to do that. For now we're just hardcoding + ! to the value for C24 and hoping for no points near cubed-sphere face + ! boundaries + if (dmin < 3.2) then + ! getting the global grid offset is possible, see Chem_GridCompMod.F90:Extract_ + Input_Opt%IS_FD_SPOT_THIS_PET = .true. + Input_Opt%IFD = IMIN + Input_Opt%JFD = JMIN + + end if + ENDIF + + Input_Opt%NFD = NFD + + call ESMF_ConfigGetAttribute(CF, LFD, & + Label="LFD:", RC=STATUS) + _VERIFY(STATUS) + + Input_Opt%LFD = LFD + + ! Read in cost function region + + call ESMF_ConfigGetAttribute(CF, CF_IMIN, & + Label="CF_IMIN:", default=-1, RC=STATUS) + _VERIFY(STATUS) + + CF_IMIN = CF_IMIN - IL_PET + 1 + + call ESMF_ConfigGetAttribute(CF, CF_IMAX, & + Label="CF_IMAX:", default=-1, RC=STATUS) + _VERIFY(STATUS) + + CF_IMAX = CF_IMAX - IL_PET + 1 + + call ESMF_ConfigGetAttribute(CF, CF_JMIN, & + Label="CF_JMIN:", default=-1, RC=STATUS) + _VERIFY(STATUS) + + CF_JMIN = CF_JMIN - JL_PET + 1 + + call ESMF_ConfigGetAttribute(CF, CF_JMAX, & + Label="CF_JMAX:", default=-1, RC=STATUS) + _VERIFY(STATUS) + + CF_JMAX = CF_JMAX - JL_PET + 1 + + call ESMF_ConfigGetAttribute(CF, CF_LMIN, & + Label="CF_LMIN:", default=-1, RC=STATUS) + _VERIFY(STATUS) + + call ESMF_ConfigGetAttribute(CF, CF_LMAX, & + Label="CF_LMAX:", default=-1, RC=STATUS) + _VERIFY(STATUS) + + IF (CF_IMIN < 1 .OR. CF_IMIN > State_Grid%NX .OR. & + CF_IMAX < 1 .OR. CF_IMAX > State_Grid%NX .OR. & + CF_JMIN < 1 .OR. CF_JMIN > State_Grid%NY .OR. & + CF_JMAX < 1 .OR. CF_JMAX > State_Grid%NY) THEN + WRITE(*,1028) Input_Opt%thisCPU, & + Input_Opt%CF_IMIN, Input_Opt%CF_IMAX, & + Input_Opt%CF_JMIN, Input_Opt%CF_JMAX, & + Input_Opt%CF_LMIN, Input_Opt%CF_LMAX +1028 FORMAT('Pre-CF on Pet ', i3, ' I = (', i3, ', ', i3, ') & + J = ( ', i3, ', ', i3, ') & + L = (', i3, ', ', i3, ')') + + CF_IMIN = -1 + CF_IMAX = -1 + CF_JMIN = -1 + CF_JMAX = -1 + CF_LMIN = -1 + CF_LMAX = -1 + ENDIF + + _ASSERT(CF_IMIN * CF_IMAX > 0, 'Please define both max and min for CF_I') + _ASSERT(CF_JMIN * CF_JMAX > 0, 'Please define both max and min for CF_J') + _ASSERT(CF_LMIN * CF_LMAX > 0, 'Please define both max and min for CF_L') + + _ASSERT(CF_LMIN * CF_IMIN > 0, 'If CF_I: is defined, please define CF_L') + _ASSERT(CF_JMIN * CF_IMIN > 0, 'If CF_I: is defined, please define CF_J') + + ! At this point, they should all be set or all be negative (probably -1) + IF (CF_IMIN > 0) THEN + Input_Opt%CF_IMIN = CF_IMIN + Input_Opt%CF_IMAX = CF_IMAX + Input_Opt%CF_JMIN = CF_JMIN + Input_Opt%CF_JMAX = CF_JMAX + Input_Opt%CF_LMIN = CF_LMIN + Input_Opt%CF_LMAX = CF_LMAX + ELSEIF (Input_Opt%IS_FD_SPOT_THIS_PET) THEN + Input_Opt%CF_IMIN = Input_Opt%IFD + Input_Opt%CF_IMAX = Input_Opt%IFD + Input_Opt%CF_JMIN = Input_Opt%JFD + Input_Opt%CF_JMAX = Input_Opt%JFD + Input_Opt%CF_LMIN = Input_Opt%LFD + Input_Opt%CF_LMAX = Input_Opt%LFD + WRITE(*,1027) Input_Opt%thisCPU, & + Input_Opt%CF_IMIN, Input_Opt%CF_IMAX, & + Input_Opt%CF_JMIN, Input_Opt%CF_JMAX, & + Input_Opt%CF_LMIN, Input_Opt%CF_LMAX +1027 FORMAT('CF on Pet ', i3, ' I = (', i3, ', ', i3, ') & + J = ( ', i3, ', ', i3, ') & + L = (', i3, ', ', i3, ')') + + ELSE + Input_Opt%CF_IMIN = -1 + Input_Opt%CF_IMAX = -1 + Input_Opt%CF_JMIN = -1 + Input_Opt%CF_JMAX = -1 + Input_Opt%CF_LMIN = -1 + Input_Opt%CF_LMAX = -1 + ENDIF + + IF ( Input_Opt%IS_FD_SPOT_THIS_PET ) THEN + write (*,1011) Input_Opt%thisCPU, dmin, imin, jmin, & + state_grid%YMID(IMIN,JMIN), state_grid%XMID(IMIN,JMIN) + +#ifdef DEBUG + ! Get the ESMF grid attached to this gridded component + CALL ESMF_GridCompGet( GC, grid=Grid, __RC__ ) + + ! Get the upper and lower bounds of on each PET using MAPL + CALL MAPL_GridGetInterior( Grid, IL_PET, IU_PET, JL_PET, JU_PET ) + WRITE(*,1013) IL_PET, IU_PET + WRITE(*,1014) JL_PET, JU_PET +#endif + + ENDIF + +1011 FORMAT('Found FD_SPOT on PET ', i5, ' ', f7.2, & + ' degrees from cell ', i3, ', ', i3, ' (', f7.2, ', ', f7.2, ')') +1012 FORMAT('Did not find FD_SPOT on PET ', i5, ' ', f7.2,& + ' degrees from cell ', i3, ', ', i3, ' (', f7.2, ', ', f7.2, ')') +1013 FORMAT(' XminOffset = ', i3, ' XmaxOffset = ', i3) +1014 FORMAT(' YminOffset = ', i3, ' YmaxOffset = ', i3) +1015 FORMAT(' GlobalXMid(', i3, ', ', i3, ') = (', f7.2, ', ' f7.2, ')') +1016 FORMAT(' SPC(', a10, ', FD_SPOT) = ', e22.10) +1019 FORMAT(' SPC_ADJ(', a10, ', FD_SPOT) = ', e22.10) + ENDIF +#endif + ! Initialize other GEOS-Chem modules CALL GC_Init_Extra( HistoryConfig%DiagList, Input_Opt, & State_Chm, State_Diag, State_Grid, RC ) @@ -320,6 +596,9 @@ SUBROUTINE GCHP_Chunk_Run( GC, & Phase, IsChemTime, IsRadTime, & #if defined( MODEL_GEOS ) FrstRewind, & +#endif +#if defined( ADJOINT ) + IsStarttime, & #endif RC ) ! @@ -365,11 +644,14 @@ SUBROUTINE GCHP_Chunk_Run( GC, & USE Pressure_Mod, ONLY : Accept_External_Pedge USE State_Chm_Mod, ONLY : IND_ USE Time_Mod, ONLY : Accept_External_Date_Time - USE UnitConv_Mod, ONLY : Convert_Spc_Units + USE UnitConv_Mod, ONLY : Convert_Spc_Units, Print_Global_Species_Kg ! Diagnostics USE Diagnostics_Mod, ONLY : Zero_Diagnostics_StartofTimestep USE Diagnostics_Mod, ONLY : Set_Diagnostics_EndofTimestep +#ifdef ADJOINT + USE Diagnostics_Mod, ONLY : Set_SpcAdj_Diagnostic +#endif USE Aerosol_Mod, ONLY : Set_AerMass_Diagnostic #if defined( RRTMG ) @@ -381,6 +663,8 @@ SUBROUTINE GCHP_Chunk_Run( GC, & USE Calc_Met_Mod, ONLY : GET_COSINE_SZA USE HCO_Interface_GC_Mod, ONLY : HCOI_GC_WriteDiagn #endif + USE Species_Mod, ONLY : Species + ! ! !INPUT PARAMETERS: ! @@ -401,6 +685,10 @@ SUBROUTINE GCHP_Chunk_Run( GC, & #if defined( MODEL_GEOS ) LOGICAL, INTENT(IN) :: FrstRewind ! Is it the first rewind? #endif +#if defined ( ADJOINT ) + LOGICAL, INTENT(IN) :: IsStarttime ! Have we reached the start time + ! in an adjoint run +#endif ! ! !INPUT/OUTPUT PARAMETERS: ! @@ -466,6 +754,17 @@ SUBROUTINE GCHP_Chunk_Run( GC, & ! Whether to scale mixing ratio with meteorology update in AirQnt LOGICAL, SAVE :: scaleMR = .FALSE. + ! Debug variables + INTEGER, parameter :: I_DBG = 6, J_DBG = 5, L_DBG=1 +#ifdef ADJOINT + ! Adjoint Finitie Difference Variables + INTEGER :: IFD, JFD, LFD, NFD + INTEGER :: I, J, L + REAL*8 :: CFN + CHARACTER(len=ESMF_MAXSTR) :: FD_SPEC, TRACNAME + TYPE(Species), POINTER :: ThisSpc +#endif + !======================================================================= ! GCHP_CHUNK_RUN begins here !======================================================================= @@ -714,6 +1013,111 @@ SUBROUTINE GCHP_Chunk_Run( GC, & CALL GET_COSINE_SZA( Input_Opt, State_Grid, State_Met, RC ) _ASSERT(RC==GC_SUCCESS, 'Error calling GET_COSINE_SZA') #endif +#ifdef ADJOINT + if (.not. first) & + CALL Print_Global_Species_Kg( I_DBG, J_DBG, L_DBG, & + 'CO2', Input_Opt, State_Chm, & + State_Grid, State_Met, trim(Iam) // & + ' before first unit conversion', RC) + CALL GCHP_PRINT_MET( I_DBG, J_DBG, L_DBG, Input_Opt,& + State_Grid, State_Met, trim(Iam) // ' before first unit conversion.', RC) + + IF (first .and. Input_Opt%IS_FD_SPOT_THIS_PET .and. Input_Opt%IS_FD_SPOT) THEN + FD_SPEC = transfer(state_chm%SpcData(Input_Opt%NFD)%Info%Name, FD_SPEC) + IFD = Input_Opt%IFD + JFD = Input_Opt%JFD + LFD = Input_Opt%LFD + NFD = Input_Opt%NFD + WRITE (*, 1017) TRIM(FD_SPEC), state_chm%species(IFD, JFD, LFD, NFD) + IF (Input_Opt%IS_ADJOINT) THEN + WRITE(*,*) ' Computing final cost function' + CFN = 0d0 + state_chm%SpeciesAdj(:,:,:,NFD) = 0d0 + DO L = 1,State_Grid%NZ + DO J = 1,State_Grid%NY + DO I = 1,State_Grid%NX + if (State_chm%CostFuncMask(I,J,L) > 0d0) THEN + WRITE (*, 1047) I, J, L, state_chm%species(I, J, L, NFD) + state_chm%SpeciesAdj(I,J,L, NFD) = 1.0d0 + CFN = CFN + state_chm%species(I,J,L,NFD) + endif + ENDDO + ENDDO + ENDDO + WRITE(*,'(a7, e22.10)') ' CFN = ', CFN +1047 FORMAT(' SPC(', i2, ', ', i2, ', ', i2, ') = ', e22.10) + ELSE + IF (Input_Opt%FD_STEP .eq. 0) THEN + WRITE(*, *) ' Not perturbing' + ELSEIF (Input_Opt%FD_STEP .eq. 1) THEN + WRITE(*, *) ' Perturbing +0.1' + state_chm%species(IFD, JFD, LFD, NFD) = state_chm%species(IFD, JFD, LFD, NFD) * 1.1d0 + ELSEIF (Input_Opt%FD_STEP .eq. 2) THEN + WRITE(*, *) ' Perturbing -0.1' + state_chm%species(IFD, JFD, LFD, NFD) = state_chm%species(IFD, JFD, LFD, NFD) * 0.9d0 + ELSE + WRITE(*, *) ' FD_STEP = ', Input_Opt%FD_STEP, ' NOT SUPPORTED!' + ENDIF + WRITE (*, 1017) TRIM(FD_SPEC), state_chm%species(IFD, JFD, LFD, NFD) + ENDIF + ENDIF + + IF (first .and. Input_Opt%IS_FD_GLOBAL) THEN + FD_SPEC = transfer(state_chm%SpcData(Input_Opt%NFD)%Info%Name, FD_SPEC) + NFD = Input_Opt%NFD + LFD = Input_Opt%LFD + IF (Input_Opt%IS_FD_SPOT_THIS_PET) THEN + IFD = Input_Opt%IFD + JFD = Input_Opt%JFD + WRITE (*, 1017) TRIM(FD_SPEC), state_chm%species(IFD, JFD, LFD, NFD) + IF (Input_Opt%Is_Adjoint) & + WRITE (*, 1018) TRIM(FD_SPEC), state_chm%SpeciesAdj(IFD, JFD, LFD, NFD) + ENDIF + IF (.not. Input_Opt%IS_ADJOINT) THEN + IF (Input_Opt%FD_STEP .eq. 0) THEN + WRITE(*, *) ' Not perturbing' + ELSEIF (Input_Opt%FD_STEP .eq. 1) THEN + WRITE(*, *) ' Perturbing +0.1' + state_chm%species(:, :, :, NFD) = state_chm%species(:, :, :, NFD) * 1.1d0 + ELSEIF (Input_Opt%FD_STEP .eq. 2) THEN + WRITE(*, *) ' Perturbing -0.1' + state_chm%species(:, :, :, NFD) = state_chm%species(:, :, :, NFD) * 0.9d0 + ELSE + WRITE(*, *) ' FD_STEP = ', Input_Opt%FD_STEP, ' NOT SUPPORTED!' + ENDIF + IF (Input_Opt%IS_FD_SPOT_THIS_PET) & + WRITE (*, 1017) TRIM(FD_SPEC), state_chm%species(IFD, JFD, LFD, NFD) + ELSE + state_chm%SpeciesAdj(:,:,:,:) = 0d0 + IF (NFD > 0) THEN + IF (LFD > 0) THEN + IF (Input_opt%amIRoot) THEN + WRITE(*,*) ' Setting Level ', LFD, ' forcing to 1' + ENDIF + state_chm%SpeciesAdj(:,:,LFD,NFD) = 1d0 + ELSE + IF (Input_opt%amIRoot) THEN + WRITE(*,*) ' Setting all forcing to 1' + ENDIF + state_chm%SpeciesAdj(:,:,:,NFD) = 1d0 + ENDIF + ENDIF + ENDIF + ENDIF + +1017 FORMAT(' SPC(', a10, ', FD_SPOT) = ', e22.10) +1018 FORMAT(' SPC_ADJ(', a10, ', FD_SPOT) = ', e22.10) + IF (Input_Opt%IS_FD_SPOT_THIS_PET ) THEN + FD_SPEC = transfer(state_chm%SpcData(Input_Opt%NFD)%Info%Name, FD_SPEC) + NFD = Input_Opt%NFD + IFD = Input_Opt%IFD + JFD = Input_Opt%JFD + LFD = Input_Opt%LFD + WRITE(*,1017) TRIM(FD_SPEC), state_chm%species(IFD, JFD, LFD, NFD) + IF (Input_Opt%Is_Adjoint) & + WRITE (*, 1018) TRIM(FD_SPEC), state_chm%SpeciesAdj(IFD, JFD, LFD, NFD) + ENDIF +#endif !======================================================================= ! EMISSIONS. Pass HEMCO Phase 1 which only updates the HEMCO clock @@ -1119,6 +1523,39 @@ SUBROUTINE GCHP_Chunk_Run( GC, & State_Met%SPHU_PREV = State_Met%SPHU #endif +#ifdef ADJOINT + if (Input_Opt%IS_FD_SPOT_THIS_PET .and. Input_opt%IFD > 0) THEN + DO N = 1, State_Chm%nSpecies + ThisSpc => State_Chm%SpcData(N)%Info + write(*,*) 'SpcAdj(', TRIM(thisSpc%Name), ') = ', & + State_Chm%SpeciesAdj(Input_Opt%IFD,Input_Opt%JFD,Input_Opt%LFD,N) + ENDDO + ENDIF + !======================================================================= + ! If this is an adjoint run, we need to check for the final (first) + ! timestep and multiply the scaling factor adjoint by the initial concs + !======================================================================= + IF (Input_Opt%IS_ADJOINT .and. IsStarttime) THEN + if (Input_opt%amIRoot) WRITE(*,*) ' Adjoint multiplying SF_ADJ by ICS' + DO N = 1, State_Chm%nSpecies + ThisSpc => State_Chm%SpcData(N)%Info + + ! Find the non-adjoint variable or this + TRACNAME = ThisSpc%Name + + State_Chm%SpeciesAdj(:,:,:,N) = State_Chm%SpeciesAdj(:,:,:,N) * State_Chm%Species(:,:,:,N) + if (Input_Opt%IS_FD_SPOT_THIS_PET .and. Input_Opt%IFD > 0) THEN + write(*,*) 'After conversion ', & + State_Chm%SpeciesAdj(Input_Opt%IFD,Input_Opt%JFD,Input_Opt%LFD,N) + ENDIF + ENDDO + + CALL Set_SpcAdj_Diagnostic( Input_Opt, State_Chm, State_Diag, & + State_Grid, State_Met, RC ) + ENDIF +#endif + + !======================================================================= ! Clean up !======================================================================= @@ -1134,4 +1571,97 @@ SUBROUTINE GCHP_Chunk_Run( GC, & END SUBROUTINE GCHP_Chunk_Run !EOC + +!BOP + SUBROUTINE GCHP_PRINT_MET(I, J, L, & + Input_Opt, State_Grid, State_Met, LOC, RC ) + + ! + ! !USES: + ! + USE State_Met_Mod, ONLY : MetState + USE Input_Opt_Mod, ONLY : OptInput + USE State_Grid_Mod, ONLY : GrdState + + ! + ! !INPUT PARAMETERS: + ! + INTEGER, INTENT(IN) :: I ! Grid cell lat index + INTEGER, INTENT(IN) :: J ! Grid cell lon index + INTEGER, INTENT(IN) :: L ! Grid cell lev index + CHARACTER(LEN=*), INTENT(IN) :: LOC ! Call location string + TYPE(OptInput), INTENT(IN) :: Input_Opt ! Input Options object + TYPE(GrdState), INTENT(IN) :: State_Grid! Grid State object + TYPE(MetState), INTENT(IN) :: State_Met ! Meteorology State object + ! + ! !INPUT/OUTPUT PARAMETERS: + ! + + ! + ! !OUTPUT PARAMETERS: + ! + INTEGER, INTENT(OUT) :: RC ! Success or failure?! + ! !REMARKS: + ! + ! !REVISION HISTORY: + !EOP + !------------------------------------------------------------------------------ + !BOC + ! + ! !LOCAL VARIABLES: + ! + CHARACTER(LEN=255) :: ErrorMsg, ThisLoc + + + !========================================================================= + ! GCHP_PRINT_MET begins here! + !========================================================================= + + ErrorMsg = '' + ThisLoc = ' -> at GCHP_Print_Met (in module ' // & + 'Interfaces/GCHP/gchp_chunk_mod.F)' + + ! Assume success + RC = GC_SUCCESS + + ! Echo info + IF ( Input_Opt%amIRoot ) THEN + WRITE( 6, 100 ) TRIM( LOC ) + WRITE( 6, 113 ) State_Grid%YMid(I,J), State_Grid%XMid(I,J) + ENDIF +100 FORMAT( /, '%%%%% GCHP_PRINT_MET at ', a ) +113 FORMAT( 'Lat: ', f5.1, ' Lon: ', f5.1 ) + + ! Write formatted output + IF ( Input_Opt%amIRoot ) THEN + ! 2-D Fields + WRITE( 6, 114 ) 'PBLH', State_Met%PBLH(I,J), I, J + WRITE( 6, 114 ) 'PSC2_WET', State_Met%PSC2_WET(I,J), I, J + WRITE( 6, 114 ) 'PSC2_DRY', State_Met%PSC2_DRY(I,J), I, J + WRITE( 6, 114 ) 'PS1_WET', State_Met%PS1_WET(I,J), I, J + WRITE( 6, 114 ) 'PS1_DRY', State_Met%PS1_DRY(I,J), I, J + WRITE( 6, 114 ) 'PS2_WET', State_Met%PS2_WET(I,J), I, J + WRITE( 6, 114 ) 'PS2_DRY', State_Met%PS2_DRY(I,J), I, J + WRITE( 6, 114 ) 'TS', State_Met%TS(I,J), I, J + WRITE( 6, 114 ) 'U10M', State_Met%U10M(I,J), I, J + ! 3-D Fields + WRITE( 6, 115 ) 'CLDF', State_Met%CLDF(I,J,L), I, J, L + WRITE( 6, 115 ) 'OMEGA', State_Met%OMEGA(I,J,L), I, J, L + WRITE( 6, 115 ) 'PEDGE', State_Met%PEDGE(I,J,L), I, J, L + WRITE( 6, 115 ) 'T', State_Met%T(I,J,L), I, J, L + WRITE( 6, 115 ) 'U', State_Met%U(I,J,L), I, J, L + WRITE( 6, 115 ) 'V', State_Met%V(I,J,L), I, J, L + WRITE( 6, 115 ) 'AD', State_Met%AD(I,J,L), I, J, L + WRITE( 6, 115 ) 'PREVSPHU', State_Met%SPHU_PREV(I,J,L), I, J, L + WRITE( 6, 115 ) 'SPHU', State_Met%SPHU(I,J,L), I, J, L + ! terminator + WRITE( 6, 120 ) + ENDIF +114 FORMAT( 'Grid cell for ', a8, ' = ', es24.16, ', I,J = ',2I4 ) +115 FORMAT( 'Grid cell for ', a8, ' = ', es24.16, ', I,J,L= ',3I4 ) +120 FORMAT( / ) + + + END SUBROUTINE GCHP_PRINT_MET +!EOC END MODULE GCHP_Chunk_Mod diff --git a/Interfaces/GCHP/gchp_historyexports_mod.F90 b/Interfaces/GCHP/gchp_historyexports_mod.F90 index eb8e70881..4ec244c15 100644 --- a/Interfaces/GCHP/gchp_historyexports_mod.F90 +++ b/Interfaces/GCHP/gchp_historyexports_mod.F90 @@ -159,7 +159,7 @@ SUBROUTINE Init_HistoryConfig ( am_I_Root, HistoryConfig, configFile, RC ) RETURN ENDIF ! Optional debugging - !CALL Print_DiagList( am_I_Root, HistoryConfig%DiagList, RC ) + ! CALL Print_DiagList( am_I_Root, HistoryConfig%DiagList, RC ) CALL Init_TaggedDiagList( am_I_Root, HistoryConfig%DiagList, & HistoryConfig%TaggedDiagList, RC ) @@ -813,7 +813,10 @@ SUBROUTINE CopyGCStates2Exports( am_I_Root, Input_Opt, HistoryConfig, RC ) ! Loop over the History Exports list current => HistoryConfig%HistoryExportsList%head DO WHILE ( ASSOCIATED( current ) ) - + + ! if (MAPL_Am_I_Root()) THEN + ! print *, ' Copying ' // TRIM(current%name) + ! endif IF ( current%rank == 2 ) THEN IF ( ASSOCIATED( current%GCStateData2d ) ) THEN current%ExportData2d = current%GCStateData2d @@ -865,6 +868,7 @@ SUBROUTINE CopyGCStates2Exports( am_I_Root, Input_Opt, HistoryConfig, RC ) ! Copy emissions data to MAPL exports via HEMCO CALL HCOI_GC_WriteDiagn( Input_Opt, .FALSE., RC ) + ! IF ( MAPL_Am_I_Root() ) WRITE(*,*) "Back from HCOI_GC_WriteDiagn, RC = ", RC IF ( RC == GC_FAILURE ) THEN ErrMsg = "Error copying emissions data to MAPL via HEMCO" CALL GC_ERROR( ErrMsg, RC, Iam ) diff --git a/run/GCHP/ExtData.rc.templates/ExtData.rc.CO2 b/run/GCHP/ExtData.rc.templates/ExtData.rc.CO2 new file mode 100644 index 000000000..d6ebe68e4 --- /dev/null +++ b/run/GCHP/ExtData.rc.templates/ExtData.rc.CO2 @@ -0,0 +1,415 @@ +Ext_AllowExtrap: .true. +DEBUG_LEVEL: 1 +# +PrimaryExports%% +#--------|-------|------|------------|---------------|--------|-------|---------------------| +# Export | | | |___ Refresh ___|____ Factors ___|___ External File ___| +# Name | Units | Clim |Conservative| Time Template | Offset | Scale | Variable | Template | +#--------|-------|------|------------|---------------|--------|-------|----------|----------| +# +# Notes: +# Units should be in single quotes if they contain whitespace +# V Loc should be C if the data is vertically centered +# Climatology should be Y if the file contains monthly climatology; otherwise it should be N +# Conservative should be Y if units imply mass conservation dependency on regrid method (e.g. value per area) +# Refresh Time Template should be: +# 1. - if the file contains time-invariant constants +# 2. prefixed with F if no time interpolation between data reads (F = fixed) +# 3. 0 if data should be kept up-to-date at all times +# 4. 0:HHMMSS if data occurs in file with frequency HHMMSS and should be updated at that frequency +# 5. %y4-%m2-%d2T%h2:00:00, with any tokens replaced by appropriate constant time value, if multiple time +# values are in the same file. Note that including an F prefix indicates the data should be treated +# as constant until the next refresh time. Omission of the F prefix will time-interpolate between +# the values. + +############################################################################### +### +### Meteorology data +### +############################################################################### + +# --- 2D variables, 1-hr averaged --- +ALBD '1' N Y F0;003000 none none ALBEDO /dev/null +CLDFRC '1' N Y F0;003000 none none CLDTOT /dev/null +EFLUX '1' N Y F0;003000 none none EFLUX /dev/null +EVAP '1' N Y F0;003000 none none EVAP /dev/null +FRSEAICE '1' N Y F0;003000 none none FRSEAICE /dev/null +FRSNO '1' N Y F0;003000 none none FRSNO /dev/null +GRN '1' N Y F0;003000 none none GRN /dev/null +GWETROOT '1' N Y F0;003000 none none GWETROOT /dev/null +GWETTOP '1' N Y F0;003000 none none GWETTOP /dev/null +HFLUX '1' N Y F0;003000 none none HFLUX /dev/null +LAI '1' N Y F0;003000 none none LAI /dev/null +LWI '1' N Y F0;003000 none none LWI /dev/null +RADLWG '1' N Y F0;003000 none none LWGNT /dev/null +PARDF '1' N Y F0;003000 none none PARDF /dev/null +PARDR '1' N Y F0;003000 none none PARDR /dev/null +PBLH '1' N Y F0;003000 none none PBLH ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A1.{MET_RES}.{MET_EXT} +PRECANV '1' N Y F0;003000 none none PRECANV /dev/null +PRECCON '1' N Y F0;003000 none none PRECCON /dev/null +PRECLSC '1' N Y F0;003000 none none PRECLSC /dev/null +PRECSNO '1' N Y F0;003000 none none PRECSNO /dev/null +PRECTOT '1' N Y F0;003000 none none PRECTOT /dev/null +SEAICE00 '1' N Y F0;003000 none none SEAICE00 /dev/null +SEAICE10 '1' N Y F0;003000 none none SEAICE10 /dev/null +SEAICE20 '1' N Y F0;003000 none none SEAICE20 /dev/null +SEAICE30 '1' N Y F0;003000 none none SEAICE30 /dev/null +SEAICE40 '1' N Y F0;003000 none none SEAICE40 /dev/null +SEAICE50 '1' N Y F0;003000 none none SEAICE50 /dev/null +SEAICE60 '1' N Y F0;003000 none none SEAICE60 /dev/null +SEAICE70 '1' N Y F0;003000 none none SEAICE70 /dev/null +SEAICE80 '1' N Y F0;003000 none none SEAICE80 /dev/null +SEAICE90 '1' N Y F0;003000 none none SEAICE90 /dev/null +SLP {PRES_UNIT} N Y F0;003000 none {PRES_SCALE} SLP ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A1.{MET_RES}.{MET_EXT} +SNODP '1' N Y F0;003000 none none SNODP /dev/null +SNOMAS '1' N Y F0;003000 none none SNOMAS /dev/null +RADSWG '1' N Y F0;003000 none none SWGDN /dev/null +TO3 'dobson' N Y F0;003000 none none TO3 /dev/null +TROPP {PRES_UNIT} N Y F0;003000 none {PRES_SCALE} TROPPT ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A1.{MET_RES}.{MET_EXT} +TSKIN '1' N Y F0;003000 none none TS /dev/null +TS '1' N Y F0;003000 none none T2M /dev/null +USTAR '1' N Y F0;003000 none none USTAR ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A1.{MET_RES}.{MET_EXT} +U10M 'm s-1' N N F0;003000 none none U10M /dev/null +V10M 'm s-1' N N F0;003000 none none V10M /dev/null +Z0 '1' N Y F0;003000 none none Z0M /dev/null + +# --- Surface pressure, 3-hr instantaneous --- +PS1 {PRES_UNIT} N Y 0 none {PRES_SCALE} PS ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.I3.{MET_RES}.{MET_EXT} +PS2 {PRES_UNIT} N Y 0;001000 none {PRES_SCALE} PS ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.I3.{MET_RES}.{MET_EXT} + +# --- 3D variables, 3-hr instantaneous --- +SPHU1 'kg kg-1' N Y 0 none none QV ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.I3.{MET_RES}.{MET_EXT} +SPHU2 'kg kg-1' N Y 0;001000 none none QV ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.I3.{MET_RES}.{MET_EXT} +TMPU1 'K' N Y 0 none none T ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.I3.{MET_RES}.{MET_EXT} +TMPU2 'K' N Y 0;001000 none none T ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.I3.{MET_RES}.{MET_EXT} + +# --- 3D variables, 3-hr averaged --- +QI '1' N Y F0;013000 none none QI /dev/null +QL '1' N Y F0;013000 none none QL /dev/null +TAUCLI '1' N Y F0;013000 none none TAUCLI /dev/null +TAUCLW '1' N Y F0;013000 none none TAUCLW /dev/null +OPTDEP '1' N Y F0;013000 none none OPTDEPTH /dev/null +CLDF '1' N Y F0;013000 none none CLOUD ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A3cld.{MET_RES}.{MET_EXT} +DTRAIN '1' N Y F0;013000 none none DTRAIN ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A3dyn.{MET_RES}.{MET_EXT} +OMEGA 'Pa s-1' N Y F0;013000 none none OMEGA ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A3dyn.{MET_RES}.{MET_EXT} +RH '-' N Y F0;013000 none none RH ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A3dyn.{MET_RES}.{MET_EXT} +UA;VA 'm s-1' N Y F0;013000 none none U;V ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A3dyn.{MET_RES}.{MET_EXT} +DQRCU '1' N Y F0;013000 none none DQRCU ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A3mstC.{MET_RES}.{MET_EXT} +DQRLSAN '1' N Y F0;013000 none none DQRLSAN /dev/null +REEVAPCN '1' N Y F0;013000 none none REEVAPCN ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A3mstC.{MET_RES}.{MET_EXT} +REEVAPLS '1' N Y F0;013000 none none REEVAPLS /dev/null +CMFMC '1' N Y F0;013000 none none CMFMC ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A3mstE.{MET_RES}.{MET_EXT} +PFICU '1' N Y F0;013000 none none PFICU ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A3mstE.{MET_RES}.{MET_EXT} +PFILSAN '1' N Y F0;013000 none none PFILSAN /dev/null +PFLCU '1' N Y F0;013000 none none PFLCU ./MetDir/%y4/%m2/{MET_SOURCE}.%y4%m2%d2.A3mstE.{MET_RES}.{MET_EXT} +PFLLSAN '1' N Y F0;013000 none none PFLLSAN /dev/null + +# --- Fixed variables, from constants file --- +FRLAKE '1' N Y - none none FRLAKE /dev/null +FRLAND '1' N Y - none none FRLAND /dev/null +FRLANDIC '1' N Y - none none FRLANDIC /dev/null +FROCEAN '1' N Y - none none FROCEAN /dev/null +PHIS 'm2 s-2' N Y - none none PHIS ./MetDir/{MET_CN_YR}/01/{MET_SOURCE}.{MET_CN_YR}0101.CN.{MET_RES}.{MET_EXT} + +# --- Fields for lightning emissions (Extension 103) --- +FLASH_DENS '1' N Y F0;013000 none none LDENS /dev/null +CONV_DEPTH '1' N Y F0;013000 none none CTH /dev/null + +############################################################################### +### +### Land data (not handled by HEMCO) +### +############################################################################### + +#============================================================================== +# Olson land types - conservative frac regridding of OLSON +#============================================================================== +# Use conservative fraction regridding to extract land type fraction +OLSON00 1 N F;0 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON01 1 N F;1 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON02 1 N F;2 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON03 1 N F;3 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON04 1 N F;4 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON05 1 N F;5 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON06 1 N F;6 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON07 1 N F;7 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON08 1 N F;8 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON09 1 N F;9 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON10 1 N F;10 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON11 1 N F;11 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON12 1 N F;12 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON13 1 N F;13 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON14 1 N F;14 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON15 1 N F;15 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON16 1 N F;16 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON17 1 N F;17 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON18 1 N F;18 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON19 1 N F;19 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON20 1 N F;20 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON21 1 N F;21 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON22 1 N F;22 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON23 1 N F;23 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON24 1 N F;24 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON25 1 N F;25 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON26 1 N F;26 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON27 1 N F;27 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON28 1 N F;28 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON29 1 N F;29 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON30 1 N F;30 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON31 1 N F;31 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON32 1 N F;32 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON33 1 N F;33 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON34 1 N F;34 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON35 1 N F;35 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON36 1 N F;36 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON37 1 N F;37 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON38 1 N F;38 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON39 1 N F;39 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON40 1 N F;40 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON41 1 N F;41 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON42 1 N F;42 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON43 1 N F;43 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON44 1 N F;44 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON45 1 N F;45 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON46 1 N F;46 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON47 1 N F;47 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON48 1 N F;48 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON49 1 N F;49 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON50 1 N F;50 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON51 1 N F;51 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON52 1 N F;52 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON53 1 N F;53 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON54 1 N F;54 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON55 1 N F;55 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON56 1 N F;56 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON57 1 N F;57 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON58 1 N F;58 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON59 1 N F;59 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON60 1 N F;60 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON61 1 N F;61 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON62 1 N F;62 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON63 1 N F;63 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON64 1 N F;64 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON65 1 N F;65 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON66 1 N F;66 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON67 1 N F;67 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON68 1 N F;68 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON69 1 N F;69 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON70 1 N F;70 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON71 1 N F;71 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc +OLSON72 1 N F;72 - none none OLSON ./ChemDir/Olson_Land_Map_201203/Olson_2001_Land_Map.025x025.generic.nc + +# Alternatively read files containing land type masks. This implementation needs further testing to assess relative performance. +#OLSON00 1 N Y - none none LANDTYPE00 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON01 1 N Y - none none LANDTYPE01 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON02 1 N Y - none none LANDTYPE02 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON03 1 N Y - none none LANDTYPE03 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON04 1 N Y - none none LANDTYPE04 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON05 1 N Y - none none LANDTYPE05 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON06 1 N Y - none none LANDTYPE06 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON07 1 N Y - none none LANDTYPE07 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON08 1 N Y - none none LANDTYPE08 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON09 1 N Y - none none LANDTYPE09 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON10 1 N Y - none none LANDTYPE10 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON11 1 N Y - none none LANDTYPE11 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON12 1 N Y - none none LANDTYPE12 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON13 1 N Y - none none LANDTYPE13 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON14 1 N Y - none none LANDTYPE14 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON15 1 N Y - none none LANDTYPE15 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON16 1 N Y - none none LANDTYPE16 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON17 1 N Y - none none LANDTYPE17 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON18 1 N Y - none none LANDTYPE18 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON19 1 N Y - none none LANDTYPE19 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON20 1 N Y - none none LANDTYPE20 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON21 1 N Y - none none LANDTYPE21 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON22 1 N Y - none none LANDTYPE22 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON23 1 N Y - none none LANDTYPE23 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON24 1 N Y - none none LANDTYPE24 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON25 1 N Y - none none LANDTYPE25 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON26 1 N Y - none none LANDTYPE26 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON27 1 N Y - none none LANDTYPE27 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON28 1 N Y - none none LANDTYPE28 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON29 1 N Y - none none LANDTYPE29 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON30 1 N Y - none none LANDTYPE30 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON31 1 N Y - none none LANDTYPE31 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON32 1 N Y - none none LANDTYPE32 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON33 1 N Y - none none LANDTYPE33 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON34 1 N Y - none none LANDTYPE34 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON35 1 N Y - none none LANDTYPE35 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON36 1 N Y - none none LANDTYPE36 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON37 1 N Y - none none LANDTYPE37 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON38 1 N Y - none none LANDTYPE38 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON39 1 N Y - none none LANDTYPE39 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON40 1 N Y - none none LANDTYPE40 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON41 1 N Y - none none LANDTYPE41 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON42 1 N Y - none none LANDTYPE42 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON43 1 N Y - none none LANDTYPE43 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON44 1 N Y - none none LANDTYPE44 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON45 1 N Y - none none LANDTYPE45 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON46 1 N Y - none none LANDTYPE46 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON47 1 N Y - none none LANDTYPE47 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON48 1 N Y - none none LANDTYPE48 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON49 1 N Y - none none LANDTYPE49 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON50 1 N Y - none none LANDTYPE50 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON51 1 N Y - none none LANDTYPE51 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON52 1 N Y - none none LANDTYPE52 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON53 1 N Y - none none LANDTYPE53 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON54 1 N Y - none none LANDTYPE54 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON55 1 N Y - none none LANDTYPE55 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON56 1 N Y - none none LANDTYPE56 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON57 1 N Y - none none LANDTYPE57 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON58 1 N Y - none none LANDTYPE58 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON59 1 N Y - none none LANDTYPE59 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON60 1 N Y - none none LANDTYPE60 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON61 1 N Y - none none LANDTYPE61 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON62 1 N Y - none none LANDTYPE62 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON63 1 N Y - none none LANDTYPE63 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON64 1 N Y - none none LANDTYPE64 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON65 1 N Y - none none LANDTYPE65 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON66 1 N Y - none none LANDTYPE66 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON67 1 N Y - none none LANDTYPE67 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON68 1 N Y - none none LANDTYPE68 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON69 1 N Y - none none LANDTYPE69 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON70 1 N Y - none none LANDTYPE70 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON71 1 N Y - none none LANDTYPE71 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc +#OLSON72 1 N Y - none none LANDTYPE72 ./HcoDir/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc + +#============================================================================== +# MODIS Leaf Area Index +# +# NOTE: There are two options for offline MODIS LAI: legacy and Yuan et al. +# Both may be used in GCHP but legacy should be used when comparing with +# GEOS-Chem Classic until it because default. Legacy is default in GCHP. +#============================================================================== + +#--------------------------- +# Option 1: legacy MODIS LAI +#--------------------------- +# Use file with land type stored as 3rd dimension to speed up file read +XLAIMULTI cm2_cm-2 N Y %y4-%m2-%d2T00:00:00 none none XLAIMULTI ./ChemDir/MODIS_LAI_201707/For_Olson_2001/XLAI_for_GCHP/%y4/Condensed_MODIS_XLAI.025x025.%y4%m2.nc + +#--------------------------- +# Option 2: Yuan processed +#--------------------------- +# Use file with land type stored as 3rd dimension to speed up file read +#XLAIMULTI cm2_cm-2 N Y %y4-%m2-%d2T00:00:00 none none XLAIMULTI ./HcoDir/Yuan_XLAI/v2019-03/Condensed_Yuan_proc_MODIS_XLAI.025x025.%y4.nc + +############################################################################### +### +### HEMCO Base Emissions (Update if HEMCO_Config.rc changes) +### +############################################################################### + +#====================================================================================== +# CMS-Flux emissions including +# conversion from kgC/km2/s to kg/m2/s +#===================================================================================== +CMSF_CO2_FF kgC/km2/s N Y F%y4-%m2-%d2T%h2:30:00 none 1e-6 CO2_Flux /nobackup/clee59/CARDAMOM1.3.2/Fossilfuel/ODIAC/%y4/%m2/%d2.nc +CMSF_CO2_OCEAN kgC/km2/s N Y F%y4-%m2-01T00:00:00 none 1e-6 CO2_Flux /nobackup/clee59/CARDAMOM1.3.2/Ocean/ECCO-Darwin-V1-mon/%y4/%m2.nc 2014-09-01T00:00P0000-01-00T00:00 +CMSF_CO2_BIO kgC/km2/s N Y F%y4-%m2-%d2T%h2:30:00 none 1e-6 CO2_Flux /nobackup/clee59/CARDAMOM1.3.2/Balbio/CARDAMOM1.3.2-ocn/%y4/%m2/%d2.nc +CMSF_CO2_BF kgC/km2/s N Y F%y4-%m2-01T00:00:00 none 1e-6 CO2_Flux /nobackup/clee59/CARDAMOM1.3.2/Biofuel/CASA-GFED3-FUEL/%y4/%m2.nc 2014-09-01T00:00P0000-01-00T00:00 +CMSF_CO2_BN kgC/km2/s N Y F%y4-%m2-01T00:00:00 none 1e-6 CO2_Flux /nobackup/clee59/CARDAMOM1.3.2/Bionet/CARDAMOM/%y4/%m2.nc 2014-09-01T00:00P0000-01-00T00:00 + +#============================================================================== +# SF6 emissions from EDGAR v4.2 +#============================================================================== +EDGAR_SF6 1 N Y F%y4-01-01T00:00:00 none none emi_sf6 ./HcoDir/SF6/v2019-01/EDGAR_v42_SF6_IPCC_2.generic.01x01.nc + +#============================================================================== +# --- EDGAR v4.3 (EDGARv4.3) --- +# EDGARv4.3 is turned off by default in HEMCO_Config.rc +#============================================================================== +EDGAR_CO25d_POW kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.CO.POW.0.1x0.1.nc +EDGAR_CO25d_ENG kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.CO.ENG.0.1x0.1.nc +EDGAR_CO25d_IND kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.CO.IND.0.1x0.1.nc +EDGAR_CO25d_TRO kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.CO.TRO.0.1x0.1.nc +EDGAR_CO25d_TNG kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.CO.TNG.0.1x0.1.nc +EDGAR_CO25d_RCO kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.CO.RCO.0.1x0.1.nc +EDGAR_CO25d_PPA kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.CO.PPA.0.1x0.1.nc +#EDGAR_CO25d_AWB kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.CO.AWB.0.1x0.1.nc +EDGAR_CO25d_SWD kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.CO.SWD.0.1x0.1.nc +EDGAR_CO25d_FFF kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.CO.FFF.0.1x0.1.nc + +#============================================================================== +# --- HTAP v2 (HTAP) --- +# HTAP is off by default in HEMCO_Config.rc +#============================================================================== +HTAP_CO25d_IND kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/HTAP/v2015-03/CO/EDGAR_HTAP_CO_INDUSTRY.generic.01x01.nc +HTAP_CO25d_POW kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/HTAP/v2015-03/CO/EDGAR_HTAP_CO_ENERGY.generic.01x01.nc +HTAP_CO25d_RES kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/HTAP/v2015-03/CO/EDGAR_HTAP_CO_RESIDENTIAL.generic.01x01.nc +HTAP_CO25d_TRA kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/HTAP/v2015-03/CO/EDGAR_HTAP_CO_TRANSPORT.generic.01x01.nc +#HTAP_CO25d_AIR1 kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/HTAP/v2015-03/CO/EDGAR_HTAP_CO_AIR_LTO.generic.01x01.nc +#HTAP_CO25d_AIR2 kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/HTAP/v2015-03/CO/EDGAR_HTAP_CO_AIR_CDS.generic.01x01.nc +#HTAP_CO25d_AIR3 kg/m2/s N Y F%y4-01-01T00:00:00 none none emi_co ./HcoDir/HTAP/v2015-03/CO/EDGAR_HTAP_CO_AIR_CRS.generic.01x01.nc + +#============================================================================== +# --- CEDS (CEDS) --- +#============================================================================== +CEDS_CO25d_AGR kg/m2/s N Y F%y4-%m2-01T00:00:00 none none CO_agr ./HcoDir/CEDS/v2018-04/CO-em-anthro_CMIP_CEDS_195001-201412.nc +CEDS_CO25d_ENE kg/m2/s N Y F%y4-%m2-01T00:00:00 none none CO_ene ./HcoDir/CEDS/v2018-04/CO-em-anthro_CMIP_CEDS_195001-201412.nc +CEDS_CO25d_IND kg/m2/s N Y F%y4-%m2-01T00:00:00 none none CO_ind ./HcoDir/CEDS/v2018-04/CO-em-anthro_CMIP_CEDS_195001-201412.nc +CEDS_CO25d_TRA kg/m2/s N Y F%y4-%m2-01T00:00:00 none none CO_tra ./HcoDir/CEDS/v2018-04/CO-em-anthro_CMIP_CEDS_195001-201412.nc +CEDS_CO25d_RCO kg/m2/s N Y F%y4-%m2-01T00:00:00 none none CO_rco ./HcoDir/CEDS/v2018-04/CO-em-anthro_CMIP_CEDS_195001-201412.nc +CEDS_CO25d_SLV kg/m2/s N Y F%y4-%m2-01T00:00:00 none none CO_slv ./HcoDir/CEDS/v2018-04/CO-em-anthro_CMIP_CEDS_195001-201412.nc +CEDS_CO25d_WST kg/m2/s N Y F%y4-%m2-01T00:00:00 none none CO_wst ./HcoDir/CEDS/v2018-04/CO-em-anthro_CMIP_CEDS_195001-201412.nc + +############################################################################### +### +### HEMCO Non-Emissions Data (update if HEMCO_Config.rc changes) +### +############################################################################### + +#============================================================================== +# --- Time zones (offset to UTC) --- +#============================================================================== +TIMEZONES count N V - none none UTC_OFFSET ./HcoDir/TIMEZONES/v2015-02/timezones_voronoi_1x1.nc + +############################################################################### +### +### HEMCO Scale Factors (update if HEMCO_Config.rc changes) +### +############################################################################### + +#============================================================================== +# --- annual scale factors --- +#============================================================================== +LIQFUEL_THISYR 1 N Y F%y4-01-01T00:00:00 none none COscalar ./HcoDir/AnnualScalar/v2014-07/AnnualScalar.geos.1x1.nc +LIQFUEL_2008_2010 1 N Y F%y4-01-01T00:00:00 none none COscalar ./HcoDir/AnnualScalar/v2014-07/AnnualScalar.geos.1x1.nc + +#============================================================================== +# --- seasonal scale factors --- +#============================================================================== +# --- From EDGAR 4.3.1 --- +POW 1 Y Y F2010-%m2-01T00:00:00 none none POW ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc +ENG 1 Y Y F2010-%m2-01T00:00:00 none none ENG ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc +IND 1 Y Y F2010-%m2-01T00:00:00 none none IND ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc +TRO 1 Y Y F2010-%m2-01T00:00:00 none none TRO ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc +TNG 1 Y Y F2010-%m2-01T00:00:00 none none TNG ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc +RCO 1 Y Y F2010-%m2-01T00:00:00 none none RCO ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc +PPA 1 Y Y F2010-%m2-01T00:00:00 none none PPA ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc +AGR 1 Y Y F2010-%m2-01T00:00:00 none none AGR ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc +AWB 1 Y Y F2010-%m2-01T00:00:00 none none AWB ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc +SOL 1 Y Y F2010-%m2-01T00:00:00 none none SOL ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc +SWD 1 Y Y F2010-%m2-01T00:00:00 none none SWD ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc +FFF 1 Y Y F2010-%m2-01T00:00:00 none none FFF ./HcoDir/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc + +############################################################################### +### +### Masks (update if HEMCO_Config.rc changes) +### +############################################################################### + +#============================================================================== +# Country/region masks +#============================================================================== +OCEAN_MASK 1 N Y - none none FROCEAN ./MetDir/{MET_CN_YR}/01/{MET_SOURCE}.{MET_CN_YR}0101.CN.{MET_RES}.{MET_EXT} + +%% + +DerivedExports%% +# ---------|---------|--------------------------------------------| +# Export | Primary |_________________ Mask _____________________| +# Name | Name | Name | Expression | +# ---------|---------|------------|-------------------------------| +# ---------|---------|------------|-------------------------------| +%% diff --git a/run/GCHP/GCHP.rc.template b/run/GCHP/GCHP.rc.template index 8b5286c7d..da91f07b2 100644 --- a/run/GCHP/GCHP.rc.template +++ b/run/GCHP/GCHP.rc.template @@ -60,7 +60,7 @@ BKG_FREQUENCY: 0 # Can exceed 24 hours (e.g. 1680000 for 7 days) # Record ref date (YYYYMMDD): Reference date; set to before sim start date # Record ref time (HHMMSS) : Reference time -RECORD_FREQUENCY: 1680000 +RECORD_FREQUENCY: 1680000 RECORD_REF_DATE: 20000101 RECORD_REF_TIME: 000000 @@ -100,3 +100,8 @@ MEMORY_DEBUG_LEVEL: 0 # %%% Option to write restart files via o-server # WRITE_RESTART_BY_OSERVER: NO + +# +# %%% Adjoint variables +# +MODEL_PHASE: ADJOINT diff --git a/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.CO2 b/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.CO2 new file mode 100644 index 000000000..f387dc304 --- /dev/null +++ b/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.CO2 @@ -0,0 +1,552 @@ +#------------------------------------------------------------------------------ +# Harvard-NASA Emissions Component (HEMCO) ! +#------------------------------------------------------------------------------ +#BOP +# +# !MODULE: HEMCO_Config.rc +# +# !DESCRIPTION: Contains configuration information for HEMCO. Define the +# emissions inventories and corresponding file paths here. Entire +# configuration files can be inserted into this configuration file with +# an '>>>include' statement, e.g. '>>>include HEMCO\_Config\_test.rc' +# The settings of include-files will be ignored. +#\\ +#\\ +# !REMARKS: +# This file has been customized for the Transport Tracers simulation. +# See The HEMCO User's Guide for file details: +# http://wiki.geos-chem.org/The_HEMCO_User%27s_Guide +# +# !REVISION HISTORY: +# Navigate to your unit tester directory and type 'gitk' at the prompt +# to browse the revision history. +#EOP +#------------------------------------------------------------------------------ +#BOC +############################################################################### +### BEGIN SECTION SETTINGS +############################################################################### + +ROOT: {DATA_ROOT}/HEMCO +METDIR: not_used +Logfile: HEMCO.log +DiagnFile: HEMCO_Diagn.rc +DiagnPrefix: ./OutputDir/HEMCO_diagnostics +DiagnFreq: End +Wildcard: * +Separator: / +Unit tolerance: 1 +Negative values: 2 +Only unitless scale factors: false +Verbose: 0 +Warnings: 1 + +### END SECTION SETTINGS ### + +############################################################################### +### BEGIN SECTION EXTENSION SWITCHES +############################################################################### +# ExtNr ExtName on/off Species +0 Base : on * +# ----- MAIN SWITCHES ----------------------- + --> EMISSIONS : true + --> METEOROLOGY : false + --> CHEMISTRY_INPUT : true +# ----- RESTART FIELDS ---------------------- + --> GC_RESTART : false +# ----- GLOBAL INVENTORIES ------------------ + --> EDGARv42_SF6 : false + --> OCEAN_CH3I : false + --> CEDS : false + --> EDGARv43 : false + --> HTAP : false + --> UNIFORM_CO : false +# ----- NON-EMISSIONS DATA ------------------ + --> OLSON_LANDMAP : false + --> YUAN_MODIS_LAI : false +#------------------------------------------------------------------------------ +100 GC_Rn-Pb-Be : on Rn222/Be7/Be7Strat/Be10/Be10Strat + +### END SECTION EXTENSION SWITCHES ### + +############################################################################### +### BEGIN SECTION BASE EMISSIONS +############################################################################### + +# ExtNr Name sourceFile sourceVar sourceTime C/R/E SrcDim SrcUnit Species ScalIDs Cat Hier + +(((EMISSIONS + +#============================================================================== +# CO2 emissions from CMS-Flux +#============================================================================== +0 CMSF_CO2_FF fake.nc CO2_Flux 2000-2019/1-12/1-31/0-23 RF xy kgC/km2/s CO2 - 101 1 +0 CMSF_CO2_OCEAN fake.nc CO2_Flux 2010-2019/1-12/1/0 RF xy kgC/km2/s CO2 - 102 1 +0 CMSF_CO2_BIO fake.nc CO2_Flux 2010-2019/1-12/1-31/0-23 RF xy kgC/km2/s CO2 - 103 1 +0 CMSF_CO2_BF fake.nc CO2_Flux 2010-2019/1-12/1/0 RF xy kgC/km2/s CO2 - 104 1 +0 CMSF_CO2_BN fake.nc CO2_Flux 2000-2019/1-12/1/0 RF xy kgC/km2/s CO2 - 105 1 + + +#============================================================================== +# SF6 emissions from EDGAR v4.2 +#============================================================================== +(((EDGARv42_SF6 +0 EDGAR_SF6 $ROOT/SF6/v2019-01/EDGAR_v42_SF6_IPCC_2.generic.01x01.nc emi_sf6 1970-2008/1/1/0 C xy kg/m2/s SF6Tracer - 1 1 +)))EDGARv42_SF6 + +#============================================================================== +# CH3I emitted over the oceans at rate of 1 molec/cm2/s +#============================================================================== +(((OCEAN_CH3I +0 SRC_2D_CH3I 1.0 - - - xy molec/cm2/s CH3ITracer 1000 1 1 +)))OCEAN_CH3I + +#============================================================================== +# Anthropogenic CO 25-day and 50-day tracers +# +# Choose CEDS, EDGAR, or HTAP +#============================================================================== +(((CEDS +0 CEDS_CO25d_ENE $ROOT/CEDS/v2018-08/$YYYY/CO-em-anthro_CMIP_CEDS_$YYYY.nc CO_ene 1750-2014/1-12/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 26 1/2/12 5 +0 CEDS_CO50d_ENE - - - - - - COAnthroEmis50dayTracer 26 1/2/12 5 +0 CEDS_CO25d_IND $ROOT/CEDS/v2018-08/$YYYY/CO-em-anthro_CMIP_CEDS_$YYYY.nc CO_ind 1750-2014/1-12/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 26 1/2/12 5 +0 CEDS_CO50d_IND - - - - - - COAnthroEmis50dayTracer 26 1/2/12 5 +0 CEDS_CO25d_TRA $ROOT/CEDS/v2018-08/$YYYY/CO-em-anthro_CMIP_CEDS_$YYYY.nc CO_tra 1750-2014/1-12/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 26 1/2/12 5 +0 CEDS_CO50d_TRA - - - - - - COAnthroEmis50dayTracer 26 1/2/12 5 +0 CEDS_CO25d_RCO $ROOT/CEDS/v2018-08/$YYYY/CO-em-anthro_CMIP_CEDS_$YYYY.nc CO_rco 1750-2014/1-12/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 26 1/2/12 5 +0 CEDS_CO50d_RCO - - - - - - COAnthroEmis50dayTracer 26 1/2/12 5 +0 CEDS_CO25d_SLV $ROOT/CEDS/v2018-08/$YYYY/CO-em-anthro_CMIP_CEDS_$YYYY.nc CO_slv 1750-2014/1-12/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 26 1/2/12 5 +0 CEDS_CO50d_SLV - - - - - - COAnthroEmis50dayTracer 26 1/2/12 5 +0 CEDS_CO25d_WST $ROOT/CEDS/v2018-08/$YYYY/CO-em-anthro_CMIP_CEDS_$YYYY.nc CO_wst 1750-2014/1-12/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 26 1/2/12 5 +0 CEDS_CO50d_WST - - - - - - COAnthroEmis50dayTracer 26 1/2/12 5 +)))CEDS + +(((EDGARv43 +0 EDGAR_CO25d_POW $ROOT/EDGARv43/v2016-11/EDGAR_v43.CO.POW.0.1x0.1.nc emi_co 1970-2010/1/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 1201/26/52 1/2 2 +0 EDGAR_CO50d_POW - - - - - - COAnthroEmis50dayTracer 1201/26/52 1/2 2 +0 EDGAR_CO25d_ENG $ROOT/EDGARv43/v2016-11/EDGAR_v43.CO.ENG.0.1x0.1.nc emi_co 1970-2010/1/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 1202/26/52 1/2 2 +0 EDGAR_CO50d_ENG - - - - - - COAnthroEmis50dayTracer 1202/26/52 1/2 2 +0 EDGAR_CO25d_IND $ROOT/EDGARv43/v2016-11/EDGAR_v43.CO.IND.0.1x0.1.nc emi_co 1970-2010/1/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 1203/26/52 1/2 2 +0 EDGAR_CO50d_IND - - - - - - COAnthroEmis50dayTracer 1203/26/52 1/2 2 +0 EDGAR_CO25d_TRO $ROOT/EDGARv43/v2016-11/EDGAR_v43.CO.TRO.0.1x0.1.nc emi_co 1970-2010/1/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 1204/26/52 1/2 2 +0 EDGAR_CO50d_TRO - - - - - - COAnthroEmis50dayTracer 1204/26/52 1/2 2 +0 EDGAR_CO25d_TNG $ROOT/EDGARv43/v2016-11/EDGAR_v43.CO.TNG.0.1x0.1.nc emi_co 1970-2010/1/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 1205/26/52 1/2 2 +0 EDGAR_CO50d_TNG - - - - - - COAnthroEmis50dayTracer 1205/26/52 1/2 2 +0 EDGAR_CO25d_RCO $ROOT/EDGARv43/v2016-11/EDGAR_v43.CO.RCO.0.1x0.1.nc emi_co 1970-2010/1/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 1206/26/52 1/2 2 +0 EDGAR_CO50d_RCO - - - - - - COAnthroEmis50dayTracer 1206/26/52 1/2 2 +0 EDGAR_CO25d_PPA $ROOT/EDGARv43/v2016-11/EDGAR_v43.CO.PPA.0.1x0.1.nc emi_co 1970-2010/1/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 1207/26/52 1/2 2 +0 EDGAR_CO50d_PPA - - - - - - COAnthroEmis50dayTracer 1207/26/52 1/2 2 +#0 EDGAR_CO25d_AWB $ROOT/EDGARv43/v2016-11/EDGAR_v43.CO.AWB.0.1x0.1.nc emi_co 1970-2010/1/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 1209/26/52 1/2 2 +#0 EDGAR_CO50d_AWB - - - - - - COAnthroEmis50dayTracer 1209/26/52 1/2 2 +0 EDGAR_CO25d_SWD $ROOT/EDGARv43/v2016-11/EDGAR_v43.CO.SWD.0.1x0.1.nc emi_co 1970-2010/1/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 1211/26/52 1/2 2 +0 EDGAR_CO50d_SWD - - - - - - COAnthroEmis50dayTracer 1211/26/52 1/2 2 +0 EDGAR_CO25d_FFF $ROOT/EDGARv43/v2016-11/EDGAR_v43.CO.FFF.0.1x0.1.nc emi_co 1970-2010/1/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 1212/26/52 1/2 2 +0 EDGAR_CO50d_FFF - - - - - - COAnthroEmis50dayTracer 1211/26/52 1/2 2 +)))EDGARv43 + +(((HTAP +0 HTAP_CO25d_IND $ROOT/HTAP/v2015-03/CO/EDGAR_HTAP_CO_INDUSTRY.generic.01x01.nc emi_co 2008-2010/1-12/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 6/28/26 1/2 4 +0 HTAP_CO50d_IND - - - - - - COAnthroEmis50dayTracer 6/28/26 1/2 4 +0 HTAP_CO25d_POW $ROOT/HTAP/v2015-03/CO/EDGAR_HTAP_CO_ENERGY.generic.01x01.nc emi_co 2008-2010/1-12/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 6/28/26 1/2 4 +0 HTAP_CO50d_POW - - - - - - COAnthroEmis50dayTracer 6/28/26 1/2 4 +0 HTAP_CO25d_RES $ROOT/HTAP/v2015-03/CO/EDGAR_HTAP_CO_RESIDENTIAL.generic.01x01.nc emi_co 2008-2010/1-12/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 6/28/26 1/2 4 +0 HTAP_CO50d_RES - - - - - - COAnthroEmis50dayTracer 6/28/26 1/2 4 +0 HTAP_CO25d_TRA $ROOT/HTAP/v2015-03/CO/EDGAR_HTAP_CO_TRANSPORT.generic.01x01.nc emi_co 2008-2010/1-12/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 6/28/26 1/2 4 +0 HTAP_CO50d_TRA - - - - - - COAnthroEmis50dayTracer 6/28/26 1/2 4 +#0 HTAP_CO25d_AIR1 $ROOT/HTAP/v2015-03/CO/EDGAR_HTAP_CO_AIR_LTO.generic.01x01.nc emi_co 2008-2010/1/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 6/28/26 1/2 4 +#0 HTAP_CO50d_AIR1 - - - - - - COAnthroEmis50dayTracer 6/28/26 1/2 4 +#0 HTAP_CO25d_AIR2 $ROOT/HTAP/v2015-03/CO/EDGAR_HTAP_CO_AIR_CDS.generic.01x01.nc emi_co 2008-2010/1/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 6/28/26 1/2 4 +#0 HTAP_CO50d_AIR2 - - - - - - COAnthroEmis50dayTracer 6/28/26 1/2 4 +#0 HTAP_CO25d_AIR3 $ROOT/HTAP/v2015-03/CO/EDGAR_HTAP_CO_AIR_CRS.generic.01x01.nc emi_co 2008-2010/1/1/0 C xy kg/m2/s COAnthroEmis25dayTracer 6/28/26 1/2 4 +#0 HTAP_CO50d_AIR3 - - - - - - COAnthroEmis50dayTracer 6/28/26 1/2 4 +)))HTAP + +#============================================================================== +# CO tracer with uniform surface emission of 2400 Tg/yr +#============================================================================== +(((UNIFORM_CO +0 SRC_2D_COUniform25d 1.5e-7 - - - xy kg/m2/s COUniformEmis25dayTracer - 1 1 +)))UNIFORM_CO + +)))EMISSIONS + +############################################################################### +### EXTENSION DATA (subsection of BASE EMISSIONS SECTION) +### +### These fields are needed by the extensions listed above. The assigned ExtNr +### must match the ExtNr entry in section 'Extension switches'. These fields +### are only read if the extension is enabled. The fields are imported by the +### extensions by field name. The name given here must match the name used +### in the extension's source code. +############################################################################### + +############################################################################### +### NON-EMISSIONS DATA (subsection of BASE EMISSIONS SECTION) +### +### Non-emissions data. The following fields are read through HEMCO but do +### not contain emissions data. The extension number is set to wildcard +### character denoting that these fields will not be considered for emission +### calculation. A given entry is only read if the assigned species name is +### an HEMCO species. +############################################################################### + +#============================================================================== +# --- Time zones (offset to UTC) --- +#============================================================================== +* TIMEZONES $ROOT/TIMEZONES/v2015-02/timezones_voronoi_1x1.nc UTC_OFFSET 2000/1/1/0 C xy count * - 1 1 + +(((METEOROLOGY + +#============================================================================== +# --- Meteorology fields --- +#============================================================================== +# --- CN fields --- +* FRLAKE $METDIR/$CNYR/01/$MET.$CNYR0101.CN.$RES.$NC FRLAKE */1/1/0 C xy 1 * - 1 1 +* FRLAND $METDIR/$CNYR/01/$MET.$CNYR0101.CN.$RES.$NC FRLAND */1/1/0 C xy 1 * - 1 1 +* FRLANDIC $METDIR/$CNYR/01/$MET.$CNYR0101.CN.$RES.$NC FRLANDIC */1/1/0 C xy 1 * - 1 1 +* FROCEAN $METDIR/$CNYR/01/$MET.$CNYR0101.CN.$RES.$NC FROCEAN */1/1/0 C xy 1 * - 1 1 +* PHIS $METDIR/$CNYR/01/$MET.$CNYR0101.CN.$RES.$NC PHIS */1/1/0 C xy 1 * - 1 1 + +# --- A1 fields --- +* ALBEDO $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC ALBEDO 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* CLDTOT $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC CLDTOT 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* EFLUX $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC EFLUX 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* EVAP $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC EVAP 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* FRSEAICE $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC FRSEAICE 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* FRSNO $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC FRSNO 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* GRN $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC GRN 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* GWETROOT $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC GWETROOT 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* GWETTOP $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC GWETTOP 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* HFLUX $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC HFLUX 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* LAI $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC LAI 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* LWI $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC LWI 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* LWGNT $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC LWGNT 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* PARDF $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC PARDF 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* PARDR $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC PARDR 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* PBLH $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC PBLH 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* PRECANV $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC PRECANV 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* PRECCON $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC PRECCON 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* PRECLSC $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC PRECLSC 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* PRECSNO $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC PRECSNO 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* PRECTOT $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC PRECTOT 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SEAICE00 $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SEAICE00 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SEAICE10 $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SEAICE10 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SEAICE20 $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SEAICE20 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SEAICE30 $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SEAICE30 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SEAICE40 $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SEAICE40 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SEAICE50 $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SEAICE50 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SEAICE60 $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SEAICE60 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SEAICE70 $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SEAICE70 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SEAICE80 $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SEAICE80 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SEAICE90 $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SEAICE90 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SLP $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SLP 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SNODP $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SNODP 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SNOMAS $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SNOMAS 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* SWGDN $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC SWGDN 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* TO3 $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC TO3 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* TROPPT $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC TROPPT 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* TS $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC TS 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* T2M $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC T2M 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* U10M $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC U10M 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* USTAR $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC USTAR 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* V10M $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC V10M 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 +* Z0M $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A1.$RES.$NC Z0M 1980-2020/1-12/1-31/*/+30minute RFY xy 1 * - 1 1 + +# --- A3cld fields --- +* CLOUD $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3cld.$RES.$NC CLOUD 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* OPTDEPTH $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3cld.$RES.$NC OPTDEPTH 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* QI $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3cld.$RES.$NC QI 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* QL $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3cld.$RES.$NC QL 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* TAUCLI $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3cld.$RES.$NC TAUCLI 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* TAUCLW $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3cld.$RES.$NC TAUCLW 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 + +# --- A3dyn fields --- +* DTRAIN $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3dyn.$RES.$NC DTRAIN 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* OMEGA $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3dyn.$RES.$NC OMEGA 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* RH $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3dyn.$RES.$NC RH 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* U $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3dyn.$RES.$NC U 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* V $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3dyn.$RES.$NC V 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 + +# --- A3mstC fields --- +* DQRCU $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3mstC.$RES.$NC DQRCU 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* DQRLSAN $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3mstC.$RES.$NC DQRLSAN 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* REEVAPCN $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3mstC.$RES.$NC REEVAPCN 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* REEVAPLS $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3mstC.$RES.$NC REEVAPLS 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 + +# --- A3mstE fields --- +* CMFMC $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3mstE.$RES.$NC CMFMC 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* PFICU $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3mstE.$RES.$NC PFICU 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* PFILSAN $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3mstE.$RES.$NC PFILSAN 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* PFLCU $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3mstE.$RES.$NC PFLCU 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 +* PFLLSAN $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.A3mstE.$RES.$NC PFLLSAN 1980-2020/1-12/1-31/*/+90minute RFY xyz 1 * - 1 1 + +# --- I3 fields --- +* PS $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.I3.$RES.$NC PS 1980-2020/1-12/1-31/* RFY xy 1 * - 1 1 +* SPHU $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.I3.$RES.$NC QV 1980-2020/1-12/1-31/* RFY xyz 1 * - 1 1 +* TMPU $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.I3.$RES.$NC T 1980-2020/1-12/1-31/* RFY xyz 1 * - 1 1 + +* PS_NEXTDAY $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.I3.$RES.$NC PS 1980-2020/1-12/1-31/1/+1day RFY xy 1 * - 1 1 +* SPHU_NEXTDAY $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.I3.$RES.$NC QV 1980-2020/1-12/1-31/1/+1day RFY xyz 1 * - 1 1 +* TMPU_NEXTDAY $METDIR/$YYYY/$MM/$MET.$YYYY$MM$DD.I3.$RES.$NC T 1980-2020/1-12/1-31/1/+1day RFY xyz 1 * - 1 1 + +)))METEOROLOGY + +#============================================================================== +# --- GEOS-Chem restart file --- +#============================================================================== +(((GC_RESTART +* SPC_ ./GEOSChem.Restart.$YYYY$MM$DD_$HH$MNz.nc4 SpeciesRst_?ALL? $YYYY/$MM/$DD/$HH CYS xyz 1 * - 1 1 +* TMPU1 ./GEOSChem.Restart.$YYYY$MM$DD_$HH$MNz.nc4 Met_TMPU1 $YYYY/$MM/$DD/$HH EY xyz 1 * - 1 1 +* SPHU1 ./GEOSChem.Restart.$YYYY$MM$DD_$HH$MNz.nc4 Met_SPHU1 $YYYY/$MM/$DD/$HH EY xyz 1 * - 1 1 +* PS1DRY ./GEOSChem.Restart.$YYYY$MM$DD_$HH$MNz.nc4 Met_PS1DRY $YYYY/$MM/$DD/$HH EY xy 1 * - 1 1 +* PS1WET ./GEOSChem.Restart.$YYYY$MM$DD_$HH$MNz.nc4 Met_PS1WET $YYYY/$MM/$DD/$HH EY xy 1 * - 1 1 +* DELPDRY ./GEOSChem.Restart.$YYYY$MM$DD_$HH$MNz.nc4 Met_DELPDRY $YYYY/$MM/$DD/$HH EY xyz 1 * - 1 1 +)))GC_RESTART + +#============================================================================== +# --- Olson land map masks --- +#============================================================================== +(((OLSON_LANDMAP +* LANDTYPE00 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE00 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE01 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE01 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE02 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE02 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE03 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE03 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE04 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE04 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE05 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE05 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE06 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE06 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE07 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE07 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE08 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE08 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE09 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE09 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE10 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE10 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE11 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE11 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE12 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE12 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE13 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE13 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE14 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE14 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE15 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE15 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE16 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE16 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE17 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE17 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE18 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE18 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE19 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE19 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE20 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE20 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE21 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE21 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE22 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE22 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE23 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE23 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE24 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE24 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE25 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE25 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE26 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE26 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE27 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE27 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE28 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE28 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE29 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE29 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE30 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE30 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE31 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE31 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE32 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE32 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE33 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE33 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE34 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE34 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE35 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE35 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE36 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE36 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE37 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE37 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE38 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE38 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE39 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE39 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE40 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE40 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE41 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE41 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE42 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE42 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE43 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE43 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE44 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE44 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE45 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE45 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE46 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE46 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE47 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE47 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE48 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE48 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE49 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE49 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE50 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE50 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE51 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE51 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE52 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE52 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE53 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE53 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE54 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE54 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE55 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE55 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE56 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE56 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE57 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE57 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE58 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE58 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE59 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE59 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE60 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE60 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE61 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE61 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE62 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE62 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE63 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE63 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE64 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE64 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE65 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE65 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE66 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE66 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE67 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE67 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE68 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE68 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE69 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE69 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE70 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE70 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE71 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE71 1985/1/1/0 C xy 1 * - 1 1 +* LANDTYPE72 $ROOT/OLSON_MAP/v2019-02/Olson_2001_Land_Type_Masks.025x025.generic.nc LANDTYPE72 1985/1/1/0 C xy 1 * - 1 1 +)))OLSON_LANDMAP + +#============================================================================== +# --- Yuan processed MODIS leaf area index data --- +# +# Source: Yuan et al 2011, doi:10.1016/j.rse.2011.01.001 +# http://globalchange.bnu.edu.cn/research/lai +# +# NOTES: +# (1) LAI data corresponding to each Olson land type is stored in +# separate netCDF variables (XLAI00, XLAI01, ... XLAI72). +# The "XLAI" denotes that the files are prepared in this way. +# (2) Units are "cm2 leaf/cm2 grid box". +# (3) Data is timestamped every 8 days, starting from the 2nd of the month. +#============================================================================== +(((YUAN_MODIS_LAI +* XLAI00 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI00 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI01 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI01 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI02 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI02 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI03 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI03 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI04 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI04 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI05 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI05 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI06 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI06 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI07 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI07 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI08 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI08 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI09 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI09 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI10 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI10 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI11 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI11 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI12 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI12 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI13 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI13 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI14 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI14 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI15 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI15 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI16 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI16 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI17 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI17 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI18 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI18 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI19 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI19 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI20 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI20 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI21 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI21 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI22 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI22 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI23 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI23 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI24 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI24 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI25 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI25 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI26 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI26 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI27 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI27 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI28 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI28 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI29 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI29 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI30 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI30 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI31 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI31 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI32 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI32 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI33 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI33 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI34 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI34 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI35 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI35 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI36 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI36 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI37 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI37 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI38 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI38 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI39 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI39 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI40 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI40 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI41 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI41 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI42 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI42 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI43 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI43 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI44 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI44 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI45 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI45 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI46 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI46 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI47 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI47 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI48 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI48 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI49 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI49 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI50 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI50 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI51 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI51 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI52 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI52 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI53 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI53 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI54 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI54 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI55 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI55 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI56 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI56 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI57 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI57 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI58 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI58 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI59 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI59 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI60 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI60 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI61 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI61 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI62 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI62 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI63 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI63 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI64 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI64 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI65 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI65 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI66 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI66 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI67 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI67 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI68 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI68 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI69 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI69 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI70 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI70 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI71 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI71 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +* XLAI72 $ROOT/Yuan_XLAI/v2019-03/Yuan_proc_MODIS_XLAI.025x025.$YYYY.nc XLAI72 2005-2016/1-12/1-31/0 I xy cm2/cm2 * - 1 1 +)))YUAN_MODIS_LAI + +### END SECTION BASE EMISSIONS ### + +############################################################################### +### BEGIN SECTION SCALE FACTORS +############################################################################### + +# ScalID Name sourceFile sourceVar sourceTime C/R/E SrcDim SrcUnit Oper + +(((EMISSIONS + +#============================================================================== +# --- Annual scale factors --- +#============================================================================== +(((HTAP +6 LIQFUEL_THISYR $ROOT/AnnualScalar/v2014-07/AnnualScalar.geos.1x1.nc COscalar 1985-2010/1/1/0 C xy 1 1 +28 LIQFUEL_2008_2010 $ROOT/AnnualScalar/v2014-07/AnnualScalar.geos.1x1.nc COscalar 2008-2010/1/1/0 C xy 1 -1 +)))HTAP + +#============================================================================== +# --- Diurnal scale factors --- +#============================================================================== +(((CEDS.or.EDGARv43.or.HTAP +26 GEIA_TOD_FOSSIL 0.45/0.45/0.6/0.6/0.6/0.6/1.45/1.45/1.45/1.45/1.4/1.4/1.4/1.4/1.45/1.45/1.45/1.45/0.65/0.65/0.65/0.65/0.45/0.45 - - - xy unitless 1 +)))CEDS.or.EDGARv43.or.HTAP + +#============================================================================== +# --- VOC speciations --- +#============================================================================== +(((EDGARv43 +52 COPROD_FOSSIL 1.02 - - - xy unitless 1 +)))EDGARv43 + +#============================================================================== +# --- EDGAR 4.3.1 --- +# Using data of 2010, the calculated seasonal ratio for different species in the +# same sector are nearly identical, possibly due to consistent activity data used. +# Therefore we use the seasonal scale factors of CO in 2010 for most sectors, +# except for AGR, AWB and SOL. +# For AGR, the NH3 AGR seasonal scale factors are used. +# For AWB, the CO AGR seasonal scale factors are used. +# For SOL, the NOx AGR seasonal scale factors are used. +#============================================================================== +(((EDGARv43 +1201 POW $ROOT/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc POW 2010/1-12/1/0 C xy unitless 1 +1202 ENG $ROOT/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc ENG 2010/1-12/1/0 C xy unitless 1 +1203 IND $ROOT/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc IND 2010/1-12/1/0 C xy unitless 1 +1204 TRO $ROOT/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc TRO 2010/1-12/1/0 C xy unitless 1 +1205 TNG $ROOT/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc TNG 2010/1-12/1/0 C xy unitless 1 +1206 RCO $ROOT/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc RCO 2010/1-12/1/0 C xy unitless 1 +1207 PPA $ROOT/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc PPA 2010/1-12/1/0 C xy unitless 1 +1208 AGR $ROOT/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc AGR 2010/1-12/1/0 C xy unitless 1 +1209 AWB $ROOT/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc AWB 2010/1-12/1/0 C xy unitless 1 +1210 SOL $ROOT/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc SOL 2010/1-12/1/0 C xy unitless 1 +1211 SWD $ROOT/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc SWD 2010/1-12/1/0 C xy unitless 1 +1212 FFF $ROOT/EDGARv43/v2016-11/EDGAR_v43.Seasonal.1x1.nc FFF 2010/1-12/1/0 C xy unitless 1 +)))EDGARv43 + +)))EMISSIONS + +### END SECTION SCALE FACTORS ### + +############################################################################### +### BEGIN SECTION MASKS +############################################################################### + +# ScalID Name sourceFile sourceVar sourceTime C/R/E SrcDim SrcUnit Oper Lon1/Lat1/Lon2/Lat2 + +(((EMISSIONS + +(((OCEAN_CH3I +1000 OCEAN_MASK $METDIR/$CNYR/01/$MET.$CNYR0101.CN.$RES.$NC FROCEAN 2000/1/1/0 C xy 1 1 -180/-90/180/90 +)))OCEAN_CH3I + +)))EMISSIONS + +### END SECTION MASKS ### + +### END OF HEMCO INPUT FILE ### +#EOC diff --git a/run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.CO2 b/run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.CO2 new file mode 100644 index 000000000..12a987c31 --- /dev/null +++ b/run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.CO2 @@ -0,0 +1,37 @@ +#------------------------------------------------------------------------------ +# GEOS-Chem Global Chemical Transport Model ! +#------------------------------------------------------------------------------ +#BOP +# +# !MODULE: HEMCO_Diagn.rc +# +# !DESCRIPTION: Configuration file for netCDF diagnostic output from HEMCO. +#\\ +#\\ +# !REMARKS: +# Customized for the Transport Tracers simulation. +# +# !REVISION HISTORY: +# 13 Feb 2018 - E. Lundgren - Initial version +#EOP +#------------------------------------------------------------------------------ +#BOC +# Name Spec ExtNr Cat Hier Dim OutUnit LongName + +############################################################################### +###### CMS-Flux emissions ##### +############################################################################### +EmisCO2_Total CO2 0 -1 -1 2 kg/m2/s CO2_emission_flux_from_all_sectors +EmisCO2_Fossil CO2 0 101 -1 2 kg/m2/s CO2_emission_flux_from_fossil_fuels +EmisCO2_Ocean CO2 0 102 -1 2 kg/m2/s CO2_emission_flux_from_oceans +EmisCO2_Biological CO2 0 103 -1 2 kg/m2/s CO2_emission_flux_from_biological_activity +EmisCO2_Biofuel CO2 0 104 -1 2 kg/m2/s CO2_emission_flux_from_biofuels +EmisCO2_Bionet CO2 0 105 -1 2 kg/m2/s CO2_emission_flux_from_bionet +SFEmisCO2_Total CO2 -1 -1 -1 2 kg/m2/s CO2_emission_flux_from_all_sectors +SFEmisCO2_Fossil CO2 0 101 -1 2 kg/m2/s CO2_emission_flux_from_fossil_fuels +SFEmisCO2_Ocean CO2 0 102 -1 2 kg/m2/s CO2_emission_flux_from_oceans +SFEmisCO2_Biological CO2 0 103 -1 2 kg/m2/s CO2_emission_flux_from_biological_activity +SFEmisCO2_Biofuel CO2 0 104 -1 2 kg/m2/s CO2_emission_flux_from_biofuels +SFEmisCO2_Bionet CO2 0 105 -1 2 kg/m2/s CO2_emission_flux_from_bionet + +#EOC \ No newline at end of file diff --git a/run/GCHP/HISTORY.rc.templates/HISTORY.rc.CO2 b/run/GCHP/HISTORY.rc.templates/HISTORY.rc.CO2 new file mode 100644 index 000000000..5e7bf60f1 --- /dev/null +++ b/run/GCHP/HISTORY.rc.templates/HISTORY.rc.CO2 @@ -0,0 +1,336 @@ +EXPID: OutputDir/GCHP +EXPDSC: GEOS-Chem_devel +CoresPerNode: 6 +VERSION: 1 + +#============================================================================== +# Define output grids different from the native cubed sphere in this section. +# Each diagnostics collection will be output on the native resolution cubed +# sphere grid unless a different grid is configured. A few examples are +# provided below. +# +# To use a grid for a specific collection, include the 'grid_label' field +# in the collection definition. For example, +# +# SpeciesConc.grid_label: REGIONAL1x1 +# +# If you are outputting on a lat/lon grid, be sure to specify conservative +# regridding. Otherwise regridding will be bi-linear. +# +# SpeciesConc.conservative: 1 +# +#============================================================================== +GRID_LABELS: PE24x144-CF + PC360x181-DC + REGIONAL1x1 + :: + + # Example of cubed-sphere grid at c24 resolution + PE24x144-CF.GRID_TYPE: Cubed-Sphere + PE24x144-CF.IM_WORLD: 24 + PE24x144-CF.JM_WORLD: 144 + PE24x144-CF.LM: 72 + + # Example of lat-lon global grid at 1x1 resolution + PC360x181-DC.GRID_TYPE: LatLon + PC360x181-DC.IM_WORLD: 360 + PC360x181-DC.JM_WORLD: 181 + PC360x181-DC.POLE: PC + PC360x181-DC.DATELINE: DC + PC360x181-DC.LM: 72 + + # Example of lat-lon regional grid at 1x1 resolution + REGIONAL1x1.GRID_TYPE: LatLon + REGIONAL1x1.IM_WORLD: 80 + REGIONAL1x1.JM_WORLD: 40 + REGIONAL1x1.POLE: XY + REGIONAL1x1.DATELINE: XY + REGIONAL1x1.LON_RANGE: 0 80 + REGIONAL1x1.LAT_RANGE: -30 10 + REGIONAL1x1.LM: 72 + +#============================================================================== +# Declare collection names and toggle on/off with # +#============================================================================== +COLLECTIONS: 'Emissions', + 'Budget', + 'CloudConvFlux', + 'LevelEdgeDiags', + 'SpeciesConc', + #'Adjoint', + 'StateMet_avg', + 'StateMet_inst', +:: +#============================================================================== +# Define collections +# The rest of this file consists of collection definitions. +# Above collections whose declarations are commented out will be ignored. +# You can skip individual diagnostics by commenting them out. +# +# WARNING: Frequency, duration, and mode will be over-written with +# settings in runConfig.sh. Edit those settings there. Add collections +# as needed to that file as needed or edit in place new collections here. +# +# NOTES: +# (1) See the GRID_LABELS sections above for details about output grids +# (2) To output a reduced set of levels, use the levels keyword, e.g.: +# SpeciesConc.levels: 1 2 3 +# +#============================================================================== +# Emissions (see HEMCO_Diagn.rc for additional config settings) + Emissions.template: '%y4%m2%d2_%h2%n2z.nc4', + Emissions.format: 'CFIO', + Emissions.frequency: 010000 + Emissions.duration: 010000 + Emissions.mode: 'time-averaged' + Emissions.fields: 'EmisCO2_Total ', 'GCHPchem', + 'EmisCO2_Fossil ', 'GCHPchem', + 'EmisCO2_Ocean ', 'GCHPchem', + 'EmisCO2_Biological ', 'GCHPchem', + 'EmisCO2_Biofuel ', 'GCHPchem', + 'EmisCO2_Bionet ', 'GCHPchem', +:: +#============================================================================== +# Budget defined as species kg/s in the column (full, troposphere, or PBL) +# due to a single component (e.g. chemistry); default = ozone only; add more +# species as needed to the example below (advected only) + Budget.template: '%y4%m2%d2_%h2%n2z.nc4', + Budget.format: 'CFIO', + Budget.frequency: 010000 + Budget.duration: 010000 + Budget.mode: 'time-averaged' + Budget.fields: 'BudgetEmisDryDepFull_CO2 ', 'GCHPchem', + 'BudgetEmisDryDepFull_PassiveTracer ', 'GCHPchem', + 'BudgetEmisDryDepTrop_CO2 ', 'GCHPchem', + 'BudgetEmisDryDepTrop_PassiveTracer ', 'GCHPchem', + 'BudgetEmisDryDepPBL_CO2 ', 'GCHPchem', + 'BudgetEmisDryDepPBL_PassiveTracer ', 'GCHPchem', + 'BudgetMixingFull_CO2 ', 'GCHPchem', + 'BudgetMixingFull_PassiveTracer ', 'GCHPchem', + 'BudgetMixingTrop_CO2 ', 'GCHPchem', + 'BudgetMixingTrop_PassiveTracer ', 'GCHPchem', + 'BudgetMixingPBL_CO2 ', 'GCHPchem', + 'BudgetMixingPBL_PassiveTracer ', 'GCHPchem', + 'BudgetConvectionFull_CO2 ', 'GCHPchem', + 'BudgetConvectionFull_PassiveTracer ', 'GCHPchem', + 'BudgetConvectionTrop_CO2 ', 'GCHPchem', + 'BudgetConvectionTrop_PassiveTracer ', 'GCHPchem', + 'BudgetConvectionPBL_CO2 ', 'GCHPchem', + 'BudgetConvectionPBL_PassiveTracer ', 'GCHPchem', +:: +#=============================================================================== + CloudConvFlux.template: '%y4%m2%d2_%h2%n2z.nc4', + CloudConvFlux.format: 'CFIO', + CloudConvFlux.frequency: 010000 + CloudConvFlux.duration: 010000 + CloudConvFlux.mode: 'time-averaged' + CloudConvFlux.fields: 'CloudConvFlux_CO2 ', 'GCHPchem', + 'CloudConvFlux_PassiveTracer ', 'GCHPchem', +:: +#============================================================================== + LevelEdgeDiags.template: '%y4%m2%d2_%h2%n2z.nc4', + LevelEdgeDiags.format: 'CFIO', + LevelEdgeDiags.frequency: 010000 + LevelEdgeDiags.duration: 010000 + LevelEdgeDiags.mode: 'time-averaged' + LevelEdgeDiags.fields: 'Met_CMFMC ', 'GCHPchem', + 'Met_PEDGE ', 'GCHPchem', + 'Met_PEDGEDRY ', 'GCHPchem', + 'Met_PFICU ', 'GCHPchem', + 'Met_PFILSAN ', 'GCHPchem', + 'Met_PFLCU ', 'GCHPchem', + 'Met_PFLLSAN ', 'GCHPchem', +:: +#============================================================================== + SpeciesConc.template: '%y4%m2%d2_%h2%n2z.nc4', + SpeciesConc.format: 'CFIO', + SpeciesConc.frequency: 010000 + SpeciesConc.duration: 010000 + SpeciesConc.mode: 'time-averaged' + SpeciesConc.fields: 'SpeciesConc_CO2 ', 'GCHPchem', + 'SpeciesConc_PassiveTracer ', 'GCHPchem', +:: +#=================================================================== +# Species concentrations (per advected species) - time-averaged values + Adjoint.template: '%y4%m2%d2.nc4', + Adjoint.format: 'CFIO', + Adjoint.frequency: 240000 + Adjoint.duration: 240000 + Adjoint.mode: 'instantaneous' + Adjoint.backwards: 1 + Adjoint.fields: 'SpeciesAdj_CO2 ', 'GCHPchem', +:: +#============================================================================== + StateMet_avg.template: '%y4%m2%d2_%h2%n2z.nc4', + StateMet_avg.format: 'CFIO', + StateMet_avg.frequency: 010000 + StateMet_avg.duration: 010000 + StateMet_avg.mode: 'time-averaged' + StateMet_avg.fields: 'Met_AD ', 'GCHPchem', + 'Met_AIRDEN ', 'GCHPchem', + 'Met_AIRVOL ', 'GCHPchem', + 'Met_ALBD ', 'GCHPchem', + 'Met_AREAM2 ', 'GCHPchem', + 'Met_AVGW ', 'GCHPchem', + 'Met_BXHEIGHT ', 'GCHPchem', + 'Met_ChemGridLev ', 'GCHPchem', + 'Met_CLDF ', 'GCHPchem', + 'Met_CLDFRC ', 'GCHPchem', + 'Met_CLDTOPS ', 'GCHPchem', + 'Met_DELP ', 'GCHPchem', + 'Met_DQRCU ', 'GCHPchem', + 'Met_DQRLSAN ', 'GCHPchem', + 'Met_DTRAIN ', 'GCHPchem', + 'Met_EFLUX ', 'GCHPchem', + 'Met_FRCLND ', 'GCHPchem', + 'Met_FRLAKE ', 'GCHPchem', + 'Met_FRLAND ', 'GCHPchem', + 'Met_FRLANDIC ', 'GCHPchem', + 'Met_FROCEAN ', 'GCHPchem', + 'Met_FRSEAICE ', 'GCHPchem', + 'Met_FRSNO ', 'GCHPchem', + 'Met_GWETROOT ', 'GCHPchem', + 'Met_GWETTOP ', 'GCHPchem', + 'Met_HFLUX ', 'GCHPchem', + 'Met_LAI ', 'GCHPchem', + 'Met_LWI ', 'GCHPchem', + 'Met_PARDR ', 'GCHPchem', + 'Met_PARDF ', 'GCHPchem', + 'Met_PBLTOPL ', 'GCHPchem', + 'Met_PBLH ', 'GCHPchem', + 'Met_PHIS ', 'GCHPchem', + 'Met_PMID ', 'GCHPchem', + 'Met_PMIDDRY ', 'GCHPchem', + 'Met_PRECANV ', 'GCHPchem', + 'Met_PRECCON ', 'GCHPchem', + 'Met_PRECLSC ', 'GCHPchem', + 'Met_PRECTOT ', 'GCHPchem', + 'Met_PS1DRY ', 'GCHPchem', + 'Met_PS1WET ', 'GCHPchem', + 'Met_PS2DRY ', 'GCHPchem', + 'Met_PS2WET ', 'GCHPchem', + 'Met_PSC2WET ', 'GCHPchem', + 'Met_PSC2DRY ', 'GCHPchem', + 'Met_QI ', 'GCHPchem', + 'Met_QL ', 'GCHPchem', + 'Met_OMEGA ', 'GCHPchem', + 'Met_OPTD ', 'GCHPchem', + 'Met_REEVAPCN ', 'GCHPchem', + 'Met_REEVAPLS ', 'GCHPchem', + 'Met_SLP ', 'GCHPchem', + 'Met_SNODP ', 'GCHPchem', + 'Met_SNOMAS ', 'GCHPchem', + 'Met_SPHU ', 'GCHPchem', + 'Met_SPHU1 ', 'GCHPchem', + 'Met_SPHU2 ', 'GCHPchem', + 'Met_SUNCOS ', 'GCHPchem', + 'Met_SUNCOSmid ', 'GCHPchem', + 'Met_SWGDN ', 'GCHPchem', + 'Met_T ', 'GCHPchem', + 'Met_TAUCLI ', 'GCHPchem', + 'Met_TAUCLW ', 'GCHPchem', + 'Met_THETA ', 'GCHPchem', + 'Met_TMPU1 ', 'GCHPchem', + 'Met_TMPU2 ', 'GCHPchem', + 'Met_TO3 ', 'GCHPchem', + 'Met_TropHt ', 'GCHPchem', + 'Met_TropLev ', 'GCHPchem', + 'Met_TropP ', 'GCHPchem', + 'Met_TS ', 'GCHPchem', + 'Met_TSKIN ', 'GCHPchem', + 'Met_TV ', 'GCHPchem', + 'Met_U ', 'GCHPchem', + 'Met_U10M ', 'GCHPchem', + 'Met_USTAR ', 'GCHPchem', + 'Met_UVALBEDO ', 'GCHPchem', + 'Met_V ', 'GCHPchem', + 'Met_V10M ', 'GCHPchem', + 'Met_Z0 ', 'GCHPchem', +:: +#============================================================================== + StateMet_inst.template: '%y4%m2%d2_%h2%n2z.nc4', + StateMet_inst.format: 'CFIO', + StateMet_inst.frequency: 010000 + StateMet_inst.duration: 010000 + StateMet_inst.mode: 'instantaneous' + StateMet_inst.fields: 'Met_AD ', 'GCHPchem', + 'Met_AIRDEN ', 'GCHPchem', + 'Met_AIRVOL ', 'GCHPchem', + 'Met_ALBD ', 'GCHPchem', + 'Met_AREAM2 ', 'GCHPchem', + 'Met_AVGW ', 'GCHPchem', + 'Met_BXHEIGHT ', 'GCHPchem', + 'Met_ChemGridLev ', 'GCHPchem', + 'Met_CLDF ', 'GCHPchem', + 'Met_CLDFRC ', 'GCHPchem', + 'Met_CLDTOPS ', 'GCHPchem', + 'Met_DELP ', 'GCHPchem', + 'Met_DQRCU ', 'GCHPchem', + 'Met_DQRLSAN ', 'GCHPchem', + 'Met_DTRAIN ', 'GCHPchem', + 'Met_EFLUX ', 'GCHPchem', + 'Met_FRCLND ', 'GCHPchem', + 'Met_FRLAKE ', 'GCHPchem', + 'Met_FRLAND ', 'GCHPchem', + 'Met_FRLANDIC ', 'GCHPchem', + 'Met_FROCEAN ', 'GCHPchem', + 'Met_FRSEAICE ', 'GCHPchem', + 'Met_FRSNO ', 'GCHPchem', + 'Met_GWETROOT ', 'GCHPchem', + 'Met_GWETTOP ', 'GCHPchem', + 'Met_HFLUX ', 'GCHPchem', + 'Met_LAI ', 'GCHPchem', + 'Met_LWI ', 'GCHPchem', + 'Met_PARDR ', 'GCHPchem', + 'Met_PARDF ', 'GCHPchem', + 'Met_PBLTOPL ', 'GCHPchem', + 'Met_PBLH ', 'GCHPchem', + 'Met_PHIS ', 'GCHPchem', + 'Met_PMID ', 'GCHPchem', + 'Met_PMIDDRY ', 'GCHPchem', + 'Met_PRECANV ', 'GCHPchem', + 'Met_PRECCON ', 'GCHPchem', + 'Met_PRECLSC ', 'GCHPchem', + 'Met_PRECTOT ', 'GCHPchem', + 'Met_PS1DRY ', 'GCHPchem', + 'Met_PS1WET ', 'GCHPchem', + 'Met_PS2DRY ', 'GCHPchem', + 'Met_PS2WET ', 'GCHPchem', + 'Met_PSC2WET ', 'GCHPchem', + 'Met_PSC2DRY ', 'GCHPchem', + 'Met_QI ', 'GCHPchem', + 'Met_QL ', 'GCHPchem', + 'Met_OMEGA ', 'GCHPchem', + 'Met_OPTD ', 'GCHPchem', + 'Met_REEVAPCN ', 'GCHPchem', + 'Met_REEVAPLS ', 'GCHPchem', + 'Met_SLP ', 'GCHPchem', + 'Met_SNODP ', 'GCHPchem', + 'Met_SNOMAS ', 'GCHPchem', + 'Met_SPHU ', 'GCHPchem', + 'Met_SPHU1 ', 'GCHPchem', + 'Met_SPHU2 ', 'GCHPchem', + 'Met_SUNCOS ', 'GCHPchem', + 'Met_SUNCOSmid ', 'GCHPchem', + 'Met_SWGDN ', 'GCHPchem', + 'Met_T ', 'GCHPchem', + 'Met_TAUCLI ', 'GCHPchem', + 'Met_TAUCLW ', 'GCHPchem', + 'Met_THETA ', 'GCHPchem', + 'Met_TMPU1 ', 'GCHPchem', + 'Met_TMPU2 ', 'GCHPchem', + 'Met_TO3 ', 'GCHPchem', + 'Met_TropHt ', 'GCHPchem', + 'Met_TropLev ', 'GCHPchem', + 'Met_TropP ', 'GCHPchem', + 'Met_TS ', 'GCHPchem', + 'Met_TSKIN ', 'GCHPchem', + 'Met_TV ', 'GCHPchem', + 'Met_U ', 'GCHPchem', + 'Met_U10M ', 'GCHPchem', + 'Met_USTAR ', 'GCHPchem', + 'Met_UVALBEDO ', 'GCHPchem', + 'Met_V ', 'GCHPchem', + 'Met_V10M ', 'GCHPchem', + 'Met_Z0 ', 'GCHPchem', +:: diff --git a/run/GCHP/createRunDir.sh b/run/GCHP/createRunDir.sh index 03af81e53..ccb4799a9 100755 --- a/run/GCHP/createRunDir.sh +++ b/run/GCHP/createRunDir.sh @@ -72,7 +72,7 @@ fi printf "${thinline}Choose simulation type:${thinline}" printf " 1. Full chemistry\n" printf " 2. TransportTracers\n" - +printf " 3. CO2 w/ CMS-Flux emissions\n" valid_sim=0 while [ "${valid_sim}" -eq 0 ]; do read sim_num @@ -81,6 +81,10 @@ while [ "${valid_sim}" -eq 0 ]; do sim_name=fullchem elif [[ ${sim_num} = "2" ]]; then sim_name=TransportTracers + elif [[ ${sim_num} = "3" ]]; then + sim_name=CO2 + sim_name_long=${sim_name} + sim_type=${sim_name} else valid_sim=0 printf "Invalid simulation option. Try again.\n" @@ -308,6 +312,10 @@ cp ./gitignore ${rundir}/.gitignore cp ./GCHP.rc.template ${rundir}/GCHP.rc cp ./CAP.rc.template ${rundir}/CAP.rc cp ./runConfig.sh.template ${rundir}/runConfig.sh +# Only copy adjoint for CO2 simulation (for now) +if [ "${sim_name}" == "CO2" ]; then + cp ./runConfig_adj.sh.template ${rundir}/runConfig_adj.sh +fi cp ./input.geos.templates/input.geos.${sim_name} ${rundir}/input.geos cp ./HISTORY.rc.templates/HISTORY.rc.${sim_name} ${rundir}/HISTORY.rc cp ./ExtData.rc.templates/ExtData.rc.${sim_name} ${rundir}/ExtData.rc @@ -324,6 +332,9 @@ mkdir ${rundir}/OutputDir chmod 744 ${rundir}/setEnvironment.sh chmod 744 ${rundir}/cleanRunDir.sh chmod 744 ${rundir}/runConfig.sh +if [ "${sim_name}" == "CO2" ]; then + chmod 744 ${rundir}/runConfig_adj.sh +fi chmod 744 ${rundir}/archiveRun.sh # Copy species database; append APM or TOMAS species if needed @@ -375,6 +386,9 @@ cd ${rundir} # Replace token strings in certain files sed -i -e "s|{SIMULATION}|${sim_name}|" GCHP.rc sed -i -e "s|{SIMULATION}|${sim_name}|" runConfig.sh +if [ "${sim_name}" == "CO2" ]; then + sed -i -e "s|{SIMULATION}|${sim_name}|" runConfig_adj.sh +fi sed -i -e "s|{DATA_ROOT}|${GC_DATA_ROOT}|" input.geos sed -i -e "s|{MET}|${met_name}|" input.geos sed -i -e "s|{SIM}|${sim_name}|" input.geos @@ -403,12 +417,19 @@ if [[ ${sim_extra_option} = "benchmark" ]]; then elif [[ ${sim_name} = "fullchem" ]]; then startdate="20190701" enddate="20190701" +elif [ "${sim_type}" == "CO2" ]; then + startdate="20140901" + enddate="20140901" else startdate="20190101" enddate="20190201" fi sed -i -e "s|{DATE1}|${startdate}|" ${rundir}/runConfig.sh sed -i -e "s|{DATE2}|${enddate}|" ${rundir}/runConfig.sh +if [ "${sim_name}" == "CO2" ]; then + sed -i -e "s|{DATE1}|${startdate}|" ${rundir}/runConfig_adj.sh + sed -i -e "s|{DATE2}|${enddate}|" ${rundir}/runConfig_adj.sh +fi sed -i -e "s|{DATE1}|${startdate}|" ${rundir}/CAP.rc sed -i -e "s|{DATE2}|${enddate}|" ${rundir}/CAP.rc @@ -426,6 +447,16 @@ if [[ ${sim_extra_option} = "benchmark" || ${sim_name} == "TransportTracers" ]]; dHHmmSS="000000" printf "\n -- This run directory has been set up for $startdate $start_time - $enddate $end_time." printf "\n -- The default diagnostic frequency and duration is 31 days." +elif [ "${sim_type}" == "CO2" ]; then + total_cores=48 + num_nodes=2 + num_cores_per_node=24 + grid_res=24 + diag_freq="010000" + start_time="000000" + end_time="060000" + dYYYYMMDD="00000000" + dHHmmSS="060000" else total_cores=24 num_nodes=1 @@ -455,6 +486,20 @@ sed -i -e "s|{TIME1}|${start_time}|" ${rundir}/runConfig.sh sed -i -e "s|{TIME2}|${end_time}|" ${rundir}/runConfig.sh sed -i -e "s|{dYYYYMMDD}|${dYYYYMMDD}|" ${rundir}/runConfig.sh sed -i -e "s|{dHHmmss}|${dHHmmSS}|" ${rundir}/runConfig.sh +if [ "${sim_name}" == "CO2" ]; then + sed -i -e "s|{TotalCores}|${total_cores}|" ${rundir}/runConfig_adj.sh + sed -i -e "s|{NumNodes}|${num_nodes}|" ${rundir}/runConfig_adj.sh + sed -i -e "s|{NumCoresPerNode}|${num_cores_per_node}|" ${rundir}/runConfig_adj.sh + sed -i -e "s|{GridRes}|${grid_res}|" ${rundir}/runConfig_adj.sh + sed -i -e "s|{InstFreq}|${inst_freq}|" ${rundir}/runConfig_adj.sh + sed -i -e "s|{InstDur}|${inst_dur}|" ${rundir}/runConfig_adj.sh + sed -i -e "s|{AvgFreq}|${timeAvg_freq}|" ${rundir}/runConfig_adj.sh + sed -i -e "s|{AvgDur}|${timeAvg_dur}|" ${rundir}/runConfig_adj.sh + sed -i -e "s|{TIME1}|${start_time}|" ${rundir}/runConfig_adj.sh + sed -i -e "s|{TIME2}|${end_time}|" ${rundir}/runConfig_adj.sh + sed -i -e "s|{dYYYYMMDD}|${dYYYYMMDD}|" ${rundir}/runConfig_adj.sh + sed -i -e "s|{dHHmmss}|${dHHmmSS}|" ${rundir}/runConfig_adj.sh +fi sed -i -e "s|{TIME1}|${start_time}|" ${rundir}/CAP.rc sed -i -e "s|{TIME2}|${end_time}|" ${rundir}/CAP.rc sed -i -e "s|{dYYYYMMDD}|${dYYYYMMDD}|" ${rundir}/CAP.rc diff --git a/run/GCHP/input.geos.templates/input.geos.CO2 b/run/GCHP/input.geos.templates/input.geos.CO2 new file mode 100644 index 000000000..972f9c8fe --- /dev/null +++ b/run/GCHP/input.geos.templates/input.geos.CO2 @@ -0,0 +1,97 @@ +------------------------+------------------------------------------------------ +%%% SIMULATION MENU %%% : +Start YYYYMMDD, hhmmss : 20160101 000000 +End YYYYMMDD, hhmmss : 20160101 010000 +Run directory : ./ +Root data directory : {DATA_ROOT} +Met field : {MET} +Simulation name : {SIM} +Species database file : ./species_database.yml +Turn on debug printout? : F +Use GC classic timers? : F +------------------------+------------------------------------------------------ +%%% TIMESTEP MENU %%% : +Tran/conv timestep [sec]: 600 +Chem/emis timestep [sec]: 1200 +------------------------+------------------------------------------------------ +%%% ADVECTED SPECIES MENU %%%: +Species name : CO2 +Species name : PassiveTracer +------------------------+------------------------------------------------------ +%%% PASSIVE SPECIES MENU %%%: +Passive species name : PassiveTracer 1.0 -1 1.0e-7 Passive_tracer_for_mass_conservation_evaluation +Passive species name : CO2 44.0 -1 1.0e-20 Carbon_dioxide +------------------------+------------------------------------------------------ +%%% TRANSPORT MENU %%% : +Turn on Transport : T + => Fill Negative Values: T + => IORD, JORD, KORD : 3 3 7 +------------------------+------------------------------------------------------ +%%% CONVECTION MENU %%% : +Turn on Cloud Conv? : T +Turn on PBL Mixing? : T + => Use non-local PBL? : T +------------------------+------------------------------------------------------ +%%% AEROSOL MENU %%% : +Online SULFATE AEROSOLS : F + => Metal cat. SO2 ox.? : F +Online CARBON AEROSOLS : F + => Use Brown Carbon? : F +Online COMPLEX SOA : F + => Semivolatile POA? : F +Online DUST AEROSOLS : F + => Acidic uptake ? : F +Online SEASALT AEROSOLS : F + => SALA radius bin [um]: 0.01 0.5 + => SALC radius bin [um]: 0.5 8.0 + => MARINE ORG AEROSOLS : F +Settle strat. aerosols : F +Online PSC AEROSOLS : F +Allow homogeneous NAT? : F +NAT supercooling req.(K): 3.0 +Ice supersaturation req.: 1.2 +Perform PSC het. chem.? : F +Calc. strat. aero. OD? : F +Enhance BC Absorption? : F + => hydrophilic BC : 1.5 + => hydrophobic BC : 1.0 +Photolyse nitrate aer.? : F + => NITs Jscale (JHNO3) : 0.0 + => NIT Jscale (JHNO3) : 0.0 + => % channel A (HONO) : 66.667 + => % channel B (NO2) : 33.333 +------------------------+------------------------------------------------------ +%%% DEPOSITION MENU %%% : +Turn on Dry Deposition? : F +Turn on Wet Deposition? : F +Turn on CO2 Effect? : F +CO2 level : 600.0 +Reference CO2 level : 380.0 +Diag alt above sfc [m] : 10 +------------------------+------------------------------------------------------ +%%% CHEMISTRY MENU %%% : +Turn on Chemistry? : F +Use linear. strat. chem?: F + => Use Linoz for O3? : F +Use UCX strat. chem? : F +Active strat. H2O? : F +Overhead O3 for FAST-JX :--- + => Online O3 from model: F + => O3 from met fields : F + => TOMS/SBUV O3 : F +Gamma HO2 : 0.2 +------------------------+------------------------------------------------------ +%%% PHOTOLYSIS MENU %%% : +FAST-JX directory : {DATA_ROOT}/CHEM_INPUTS/FAST_JX/v2020-02/ +------------------------+------------------------------------------------------ +%%% RADIATION MENU %%% : +AOD Wavelength (nm) : 550 +Turn on RRTMG? : F +Calculate LW fluxes? : F +Calculate SW fluxes? : F +Clear-sky flux? : F +All-sky flux? : F +Radiation Timestep [sec]: 10800 +------------------------+------------------------------------------------------ +END OF FILE : +------------------------+------------------------------------------------------ diff --git a/run/GCHP/runConfig.sh.template b/run/GCHP/runConfig.sh.template index 7a2a83d6e..adda7dc2d 100644 --- a/run/GCHP/runConfig.sh.template +++ b/run/GCHP/runConfig.sh.template @@ -340,6 +340,10 @@ if [[ $(( ${NX}*6/${NY}*2 )) -ge 5 || $(( ${NY}/${NX}/6*2 )) -ge 5 ]] ; then echo "WARNING: NX and NY are set such that NX x NY/6 has side ratio >= 2.5. Consider adjusting resources in runConfig.sh to be more square. This will avoid negative effects due to excessive communication between cores." fi +abs() { + [[ $[ $@ ] -lt 0 ]] && echo "$[ ($@) * - 1]" || echo "$[ $@ ]" +} + #### Give error if chem timestep is < dynamic timestep if [[ ${ChemEmiss_Timestep_sec} -lt ${TransConv_Timestep_sec} ]]; then echo "ERROR: chemistry timestep must be >= dynamic timestep. Update values in runConfig.sh." @@ -503,6 +507,14 @@ if [ ${TOTAL_CORES} -gt 1000 ]; then replace_val WRITE_RESTART_BY_OSERVER YES GCHP.rc fi +### Uncomment out Adjoint collection in HISTORY.rc. It's not +### needed for forward run, but we need it now +echo "Removing adjoint history collections" +sed -i "s/^\([\t ]*\)#[\t #]*'Adjoint',/\1'#Adjoint',/" HISTORY.rc +sed -i "s/^\([\t ]*\)#[\t #]*'SFEmissions',/\1'#SFEmissions',/" HISTORY.rc +replace_val SFEmissions.backwards 0 HISTORY.rc +sed -i -e "s/^[ \t]*\(SFEmis.*\)$/#\1/" HEMCO_Diagn.rc + #### set cubed-sphere resolution and related grid variables print_msg " " print_msg "Cubed-sphere resolution:" @@ -551,6 +563,9 @@ print_msg "Initial restart file:" print_msg "---------------------" replace_val GCHPchem_INTERNAL_RESTART_FILE "+${INITIAL_RESTART}" GCHP.rc +### adjoint model phase +replace_val MODEL_PHASE "FORWARD" GCHP.rc + #### Set simulation start and end datetimes based on input.geos print_msg " " print_msg "Simulation start, end, duration:" @@ -558,6 +573,7 @@ print_msg "--------------------------------" replace_val BEG_DATE "${Start_Time}" CAP.rc replace_val END_DATE "${End_Time}" CAP.rc replace_val JOB_SGMT "${Duration}" CAP.rc +replace_val REVERSE_TIME "0" CAP.rc #### Set debug level print_msg " " diff --git a/run/GCHP/runConfig_adj.sh.template b/run/GCHP/runConfig_adj.sh.template new file mode 100755 index 000000000..dadda4829 --- /dev/null +++ b/run/GCHP/runConfig_adj.sh.template @@ -0,0 +1,691 @@ +#!/bin/bash + +# runSettings.sh: Set run-time settings for GCHP and update all config +# files to use these settings. Pass optional argument --silent to suppress +# information of settings updated per file. Errors/warnings will still be printed. + +# Usage: ./runConfig.sh [--silent] +# +# Initial version: E. Lundgren, 8/17/2017 + +#------------------------------------------------ +# Compute Resources +#------------------------------------------------ +TOTAL_CORES={TotalCores} +NUM_NODES={NumNodes} +NUM_CORES_PER_NODE={NumCoresPerNode} +# Set number of cores, number of nodes, and number of cores per node. +# Total cores must be divisible by 6. Cores per node must equal number +# of cores divided by number of nodes. Make sure you have these +# resources available. + +#------------------------------------------------ +# Domain decomposition +#------------------------------------------------ +NXNY_AUTO=ON +NX=1 # Ignore if NXNY_AUTO=ON +NY=6 # Ignore if NXNY_AUTO=ON +# Cores are distributed across each of the six cubed sphere faces using +# configurable parameters NX and NY. Each face is divided into NX by NY/6 +# regions and each of those regions is processed by a single core +# independent of which node it belongs to. Making NX by NY/6 as square +# as possible reduces communication overhead in GCHP. +# +# Set NXNY_AUTO to either auto-calculate NX and NY (ON) (recommended) +# or set them manually (OFF). + +# Rules and tips for setting NX and NY manually (NXNY_AUTO=OFF): +# 1. NY must be an integer and a multiple of 6 +# 2. NX*NY must equal total number of cores (NUM_NODES*NUM_CORES_PER_NODE) +# 3. Choose NX and NY to optimize NX x NY/6 squareness +# Good examples: (NX=4,NY=24) -> 96 cores at 4x4 +# (NX=6,NY=24) -> 144 cores at 6x4 +# Bad examples: (NX=8,NY=12) -> 96 cores at 8x2 +# (NX=12,NY=12) -> 144 cores at 12x2 +# 4. Domain decomposition requires that CS_RES/NX >= 4 and CS_RES*6/NY >= 4, +# which puts an upper limit on total cores per grid resolution. +# c24: 216 cores (NX=6, NY=36 ) +# c48: 864 cores (NX=12, NY=72 ) +# c90: 3174 cores (NX=22, NY=132) +# c180: 12150 cores (NX=45, NY=270) +# c360: 48600 cores (NX=90, NY=540) +# Using fewer cores may still trigger a domain decomposition error, e.g.: +# c48: 768 cores (NX=16, NY=48) --> 48/16=3 will trigger FV3 error + +#------------------------------------------------ +# Internal Cubed Sphere Resolution +#------------------------------------------------ +CS_RES={GridRes} +STRETCH_GRID=OFF +STRETCH_FACTOR=2.0 +TARGET_LAT=-45.0 +TARGET_LON=170.0 +# Primary resolution is an integer value +# 24 ~ 4x5, 48 ~ 2x2.25, 90 ~ 1x1.25, 180 ~ 1/2 deg, 360 ~ 1/4 deg +# Set stretched grid to ON or OFF. If ON, follow these rules for parameters: +# (1) Minimum STRETCH_FACTOR is 1.0001 +# (2) Target lat and lon must be floats (contain decimal) +# (3) Target lon must be in range [0,360) + +#------------------------------------------------ +# Simulation Start, End, Duration, # runs +#------------------------------------------------ +Start_Time="{DATE1} {TIME1}" +End_Time="{DATE2} {TIME2}" +Duration="{dYYYYMMDD} {dHHmmss}" +Num_Runs=1 +Monthly_Diag=0 # Only for use with multi-run script gchp.multirun.sh. Set to 1 to enable. +# +# The simplest run is a single segment run (Num_Runs=1). For this case +# duration should be less than or equal to the difference between start +# and end time. If end time is past start time plus duration, the simulation +# will end at start time plus duration rather than end time. +# +# Setting duration such that two or more durations can occur between start +# and end will enable multi-segmented runs. At the end of each run the +# end time is stored as the new start time in output file cap_restart. +# Rerunning without removing or editing cap_restart will start at the +# start time in cap_restart rather than the start time set here. +# Use this feature with the multi-segmented runs, what we call the +# multi-run option. Use this option as follows: +# +# 1. Set Num_Runs to total # of consecutive runs +# 2. Set durationto the duration of each INDIVIDUAL run +# 3. Set end date after start date to span ALL runs +# 4. Copy gchp.multirun.sh and gchp.multirun.run from runScriptSamples/ +# to run directory +# 5. Configure resources at the top of gchp.multirun.run (assumes SLURM). +# This is the run script used for each individual run in the sequence. +# It is important to use this since it contains necessary automatic +# updates such as using the output restart file from one run as the +# input restart file in the next. +# 6. Execute shell script gchp.multirun.sh at the command line +# $ ./gchp.multirun.sh +# +#------------------------------------------------ +# Initial Restart File +#------------------------------------------------ +INITIAL_RESTART=gcchem_internal_restart.{DATE2}_{TIME2}z.nc4 + +# By default the linked restart files in the run directories will be +# used. Please note that HEMCO restart variables are stored in the same +# restart file as species concentrations. Initial restart files available +# on gcgrid do not contain HEMCO variables which will have the same effect +# as turning the HEMCO restart file option off in GC classic. However, all +# output restart files will contain HEMCO restart variables for your next run. +# You can specify a custom initial restart file by overwriting the default. + +#------------------------------------------------------------ +# Turn Components On/Off, and other settings in input.geos +#------------------------------------------------------------ +Turn_on_Chemistry=T +Turn_on_emissions=T +Turn_on_Dry_Deposition=F +Turn_on_Wet_Deposition=F +Turn_on_Transport=T +Turn_on_Cloud_Conv=T +Turn_on_PBL_Mixing=T +Turn_on_Non_Local_Mixing=T +# Settings for UCX +Use_CH4_emis=F +Init_strat_H2O=T +# WARNING: these settings will override manual updates you make to input.geos! + +#------------------------------------------------ +# Timesteps +#------------------------------------------------ +if [[ $CS_RES -lt 180 ]]; then + ChemEmiss_Timestep_sec=1200 + TransConv_Timestep_sec=600 + TransConv_Timestep_HHMMSS=001000 +else + ChemEmiss_Timestep_sec=600 + TransConv_Timestep_sec=300 + TransConv_Timestep_HHMMSS=000500 +fi +RRTMG_Timestep_sec=10800 +# Optimal timesteps are dependent on grid resolution and are automatically +# set based on the GCHP Working Group's recommendation below. To override +# these settings, comment out the code and manually define the following +# variables: +# ChemEmiss_Timestep_sec : chemistry timestep interval [s] +# TransConv_Timestep_sec : dynamic timestep interval [s] +# TransConv_Timestep_HHMMSS : dynamic timestep interval as HHMMSS string +# +# WARNING: Settings in this file will override settings in input.geos! +# +# NOTE: Default timesteps for c24 and c48, the cubed-sphere rough equivalents +# of 4x5 and 2x2.5, are the same as defaults timesteps in GEOS-Chem Classic + +#------------------------------------------------ +# Output Restarts +#------------------------------------------------ +Periodic_Checkpoint=OFF +Checkpoint_Freq="1680000" +Checkpoint_Ref_Date=START +Checkpoint_Ref_Time=START +# You can output restart files at regular or irregular intervals throughout +# your simulation. These restarts are in addition to the end-of-run restart +# which is always produced. To turn on periodic checkpoints, set +# Period_Checkpoint to ON; set to OFF to disable. +# +# To configure regular checkpoint files: +# - Set Checkpoint_Freq to a string of format HHmmss. More than 2 digits for +# hours string is permitted, e.g. 168000 for 7 days. +# - Set Checkpoint_Ref_Date and Checkpoint_Ref_Date to START to use the run +# start datetime as reference time; else set them to YYYYMMDD and HHmmss. +# - WARNING: if using the run start datetime as reference time then a checkpoint +# file will be output the first timestep. That happens before setting the +# values from the restart files so it will contain all zeros. +# +# To configure irregular checkpoint files: +# - Set Checkpoint_Freq to string of space-separated zeros with each zero +# corresponding to a single checkpoint file (e.g. 0 0 0 for 3 checkpoints total) +# - Set Checkpoint_Ref_Date to a string of space-separated YYYYMMDD values. +# - Set Checkpoint_Ref_Time to a string of space-separated HHmmss values. +# - WARNING: There is currently a limit of 9 irregular checkpoint values. + +#------------------------------------------------ +# Output Diagnostics +#------------------------------------------------ +timeAvg_freq="{AvgFreq}" +timeAvg_dur="{AvgDur}" +timeAvg_collections=(SpeciesConc \ + AerosolMass \ + Aerosols \ + Budget \ + CloudConvFlux \ + ConcAfterChem \ + DryDep \ + Emissions \ + JValues \ + KppDiags \ + LevelEdgeDiags \ + Metrics \ + ProdLoss \ + RadioNuclide \ + RRTMG \ + StateChm \ + StateMet \ + Transport \ + WetLossConv \ + WetLossLS \ +) + +# Instantaneous diagnostics +inst_freq="{InstFreq}" +inst_dur="{InstDur}" +inst_collections=(ConcAboveSfc \ +) +# Set frequency and duration for time-averaged and instantaneous collections. +# +# Frequency = frequency of diagnostic calculation (HHmmSS) +# Duration = frequency of diagnostic file write (HHmmSS) +# +# NOTES: +# 1. Freq and duration hours may exceed 2 digits, e.g. 7440000 for 31 days +# 2. Collections excluded from the lists must be manually set in HISTORY.rc +# 3. To turn off collections comment them out in HISTORY.rc, not here. + +#------------------------------------------------ +# Debug Options +#------------------------------------------------ +MAPL_EXTDATA_DEBUG_LEVEL=0 +MEMORY_DEBUG_LEVEL=0 +# Set MAPL ExtData debug flag to 0 for no extra MAPL debug log output, or 1 to +# print information to log. Using this flag is most helpful for debugging +# issues with file read (MAPL ExtData). +# +# Set memory debug flag to 0 to print memory only once per timestep. Set to +# 1 to enable memory prints at additional locations throughout the run. +# +# For GEOS-Chem debug prints, turn on ND70 in input.geos manually. +# +# WARNING: Turning on debug prints significantly slows down the model! + +#------------------------------------------------------------------ +# Dust mass tuning factor (only if using HEMCO dust extension) +#------------------------------------------------------------------ +dustEntry=$(grep "105.*DustDead" HEMCO_Config.rc) +dustSetting=(${dustEntry// / }) +if [[ ${dustSetting[3]} = "on" ]]; then + if [[ $CS_RES -eq 24 ]]; then + Dust_SF=6.0e-4 + elif [[ $CS_RES -eq 48 ]]; then + Dust_SF=5.0416e-4 + elif [[ $CS_RES -eq 90 ]]; then + Dust_SF=4.0e-4 + elif [[ $CS_RES -eq 180 ]]; then + Dust_SF=3.23e-4 + elif [[ $CS_RES -eq 360 ]]; then + Dust_SF=2.35e-4 + elif [[ $CS_RES -eq 720 ]]; then + Dust_SF=2.3e-4 + else + echo "Dust scale factor not defined for this resolution. Please add the tuning factor you wish to use for the target resolution above." + exit 1 + fi +fi +# Dust_SF sets mass tuning factor in HEMCO_Config.rc used in the +# DustDead extension. The mass tuning factor is resolution-dependent and must +# be defined here for the target resolution if using online dust. +# NOTE: the online dust extension is NOT recommended for use in GCHP + +########################################################## +########################################################## +#### END OF CONFIGURABLES SECTION +########################################################## +########################################################## + +############################### +#### ERROR CHECKS +############################### + +#### Check that resource allocation makes sense +if (( ${TOTAL_CORES}%6 != 0 )); then + echo "ERROR: TOTAL_CORES must be divisible by 6. Update value in runConfig.sh." + exit 1 +fi +if (( ${TOTAL_CORES} != ${NUM_NODES}*${NUM_CORES_PER_NODE} )); then + echo "ERROR: TOTAL_CORES must equal to NUM_NODES times NUM_CORES_PER_NODE. Update values in runConfig.sh." + exit 1 +fi + +#### If on, auto-calculate NX and NY to maximize squareness of core regions +if [[ ${NXNY_AUTO} == 'ON' ]]; then + Z=$(( ${NUM_NODES}*${NUM_CORES_PER_NODE}/6 )) + # Use "bash calculator" if available; Python if not; fail otherwise + which bc &> /dev/null; bc_ok=$? + which python &> /dev/null; py_ok=$? + if [[ $bc_ok -eq 0 ]]; then + # Use bash calculator + SQRT=$(echo "sqrt (${Z})" | bc -l) + N=$(echo $SQRT | awk '{print int($1+0.999)}') + elif [[ $py_ok -eq 0 ]]; then + # Use system Python + SQRT=$( python -c "import math; print(int(math.sqrt(${Z})))" ) + N=$SQRT + else + echo "Cannot auto-determine NX and NY (need either bc or python available)" + exit 70 + fi + while [[ "${N}" > 0 ]]; do + if (( ${Z} % ${N} == 0 )); then + NX=${N} + NY=$((${Z}/${N}*6)) + break + else + N=$((${N}-1)) + fi + done +fi + +#### Check that NX and NY make sense +if (( ${NX}*${NY} != ${TOTAL_CORES} )); then + echo "ERROR: NX*NY must equal TOTAL_CORES. Check values in runConfig.sh." + exit 1 +fi +if (( ${NY}%6 != 0 )); then + echo "ERROR: NY must be an integer divisible by 6. Check values in runConfig.sh." + exit 1 +fi + +#### Check that domain decomposition will not trigger a FV3 domain error +if [[ $(( ${CS_RES}/${NX} )) -lt 4 || $(( ${CS_RES}*6/${NY} )) -lt 4 ]]; then + echo "ERROR: NX and NY are set such that face side length divided by NX or NY/6 is less than 4. The cubed sphere compute domain has a minimum requirement of 4 points in NX and NY/6. This problem occurs when grid resolution is too low for core count requested. Edit runConfig.sh to loower total number of cores or increase your grid resolution." + exit 1 +fi + +#### Check if domains are square enough (NOTE: approx using integer division) +if [[ $(( ${NX}*6/${NY}*2 )) -ge 5 || $(( ${NY}/${NX}/6*2 )) -ge 5 ]] ; then + echo "WARNING: NX and NY are set such that NX x NY/6 has side ratio >= 2.5. Consider adjusting resources in runConfig.sh to be more square. This will avoid negative effects due to excessive communication between cores." +fi + +abs() { + [[ $[ $@ ] -lt 0 ]] && echo "$[ ($@) * - 1]" || echo "$[ $@ ]" +} + +#### Give error if chem timestep is < dynamic timestep +if [[ ${ChemEmiss_Timestep_sec} -lt ${TransConv_Timestep_sec} ]]; then + echo "ERROR: chemistry timestep must be >= dynamic timestep. Update values in runConfig.sh." + exit 1 +fi + +## Check if restart file exists +if [[ ! -e ${INITIAL_RESTART} ]]; then + printf 'ERROR: Restart file specified in runConfig.sh not found: %s\n' ${INITIAL_RESTART} + exit 1 +fi + +#### Check transport setting. If okay, set binary indicator +if [[ ${Turn_on_Transport} == 'T' ]]; then + ADVCORE_ADVECTION=1 +elif [[ ${Turn_on_Transport} == 'F' ]]; then + ADVCORE_ADVECTION=0 +else + echo "ERROR: Incorrect transport setting" + exit 1 +fi + +#### If using stretched grid, check that target lat and lon have decimal +if [[ ${STRETCH_GRID} == 'ON' ]]; then + if [[ ${TARGET_LAT} != *"."* ]]; then + echo "ERROR: Stretched grid target latitude must be float. Edit entry in runConfig.sh." + exit 1 + elif [[ ${TARGET_LON} != *"."* ]]; then + echo "ERROR: Stretched grid target longitude must be float. Edit entry in runConfig.sh." + exit 1 + fi +fi + +########################################## +#### DEFINE FUNCTIONS TO UPDATE FILES +########################################## + +#### Determine whether to print info about updates. Prints enabled by default. +verbose=1 +if [ $# -ne 0 ]; then + if [[ $1 = "--silent" ]]; then + verbose=0 + fi +fi + +#### Function to print message +print_msg() { + if [[ ${verbose} = "1" ]]; then + echo $1 + fi +} + +#### Define function to replace values in .rc files +replace_val() { + KEY=$1 + VAL=$2 + FILE=$3 + if [[ ${verbose} = "1" ]]; then + printf '%-30s : %-20s %-20s\n' "${KEY//\\}" "${VAL}" "${FILE}" + fi + + # Use : for delimiter by default, unless argument passed + if [[ -z $4 ]]; then + DELIMITER=: + else + DELIMITER=$4 + fi + + # replace value in line starting with 'whitespace + key + whitespace + : + + # whitespace + value' where whitespace is variable length including none + sed "s|^\([\t ]*${KEY}[\t ]*${DELIMITER}[\t ]*\).*|\1${VAL}|" ${FILE} > tmp + mv tmp ${FILE} +} + +#### Define function to uncomment line in config file +uncomment_line() { + if [[ $(grep -c "^[\t ]*$1" $2) == "1" ]]; then + return + fi + num_lines=$(grep -c "^[\t ]*#*[\t ]*$1" $2) + if [[ $num_lines == "1" ]]; then + sed -i -e "s|[\t ]*#*[\t ]*$1|$1|" $2 + elif [[ $num_lines == "0" ]]; then + echo "ERROR: Entry for $1 missing in $2!" + exit 1 + else + echo "ERROR: Multiple entries for $1 found in $2!" + exit 1 + fi +} + +#### Define function to comment line in config file +comment_line() { + if [[ $(grep -c "#.*$1" $2) == "1" ]]; then + return + fi + num_lines=$(grep -c "^[\t ]*$1" $2) + if [[ $num_lines == "1" ]]; then + sed -i -e "s|[\t ]*$1|#$1|" $2 + elif [[ $num_lines > "1" ]]; then + echo "ERROR: Multiple entries for $1 found in $2!" + exit 1 + fi +} + +#### Define function to replace met-field read frequency in ExtData.rc given var name +update_dyn_freq() { + + # String to search for + str="^[\t ]*$1.*MetDir" + + # Check number of matches where first string is start of line, allowing for + # whitespace. # matches should be one; otherwise exit with an error. + numlines=$(grep -c "$str" $2) + if [[ ${numlines} == "0" ]]; then + echo "ERROR: met-field $1 missing in $2" + #exit 1 + elif [[ ${numlines} > 1 ]]; then + echo "ERROR: more than one entry in $1 in $2. Reduce to one so that read frequency can be auto-synced with dynamic timestep from runConfig.sh." + exit 1 + fi + + # Get line number + x=$(grep -n "$str" $2) + linenum=${x%%:*} + + # Get current ExtData.rc frequency read string + x=$(grep "$str" $2) + z=${x%%;*} + charnum=${#z} + currentstr=${x[0]:${charnum}+1:6} + + # Replace string with configured dynamic timestep + sed -i "${linenum}s/${currentstr}/${TransConv_Timestep_HHMMSS}/" $2 + + # Print what just happened + if [[ ${verbose} = "1" ]]; then + printf '%-30s : %-20s %-20s\n' "$1 read frequency" "0;${TransConv_Timestep_HHMMSS}" "$2" + fi +} + +############################### +#### UPDATE FILES +############################### +print_msg " " +print_msg "============================================================" +print_msg "Auto-updating config files based on settings in runConfig.sh" +print_msg "============================================================" + +#### Set # nodes, # cores, and shared memory option +print_msg " " +print_msg "Compute resources:" +print_msg "------------------" +replace_val NX ${NX} GCHP.rc +replace_val NY ${NY} GCHP.rc +replace_val CoresPerNode ${NUM_CORES_PER_NODE} HISTORY.rc + +#### If # cores exceeds 1000 then write restart via o-server +if [ ${TOTAL_CORES} -gt 1000 ]; then + print_msg "WARNING: write restarts by o-server is enabled since >1000 cores" + replace_val WRITE_RESTART_BY_OSERVER YES GCHP.rc +fi + +### Uncomment out Adjoint collection in HISTORY.rc. It's not +### needed for forward run, but we need it now +echo "Removing adjoint history collections" +sed -i "s/^\([\t ]*\)#[\t #]*'Adjoint',/\1'Adjoint',/" HISTORY.rc +sed -i "s/^\([\t ]*\)#[\t #]*'SFEmissions',/\1'SFEmissions',/" HISTORY.rc +replace_val SFEmissions.backwards 1 HISTORY.rc +sed -i -e "s/^[ \t]*#\([ \t]*SFEmis.*\)$/\1/" HEMCO_Diagn.rc + +#### set cubed-sphere resolution and related grid variables +print_msg " " +print_msg "Cubed-sphere resolution:" +print_msg "------------------------" +CS_RES_x_6=$((CS_RES*6)) +replace_val GCHP.IM_WORLD ${CS_RES} GCHP.rc +replace_val GCHP.IM ${CS_RES} GCHP.rc +replace_val GCHP.JM ${CS_RES_x_6} GCHP.rc +replace_val IM ${CS_RES} GCHP.rc +replace_val JM ${CS_RES_x_6} GCHP.rc +replace_val GCHP.GRIDNAME PE${CS_RES}x${CS_RES_x_6}-CF GCHP.rc +if [[ ${STRETCH_GRID} == "ON" ]]; then + print_msg " " + print_msg "WARNING: stretched grid is enabled" + uncomment_line GCHP.STRETCH_FACTOR GCHP.rc + uncomment_line GCHP.TARGET_LAT GCHP.rc + uncomment_line GCHP.TARGET_LON GCHP.rc + sed -i -e "s|#\&fv#_core_nml|\&fv_core_nml|" input.nml + uncomment_line do_schmidt input.nml + uncomment_line stretch_fac input.nml + uncomment_line target_lat input.nml + uncomment_line target_lon input.nml + replace_val GCHP.STRETCH_FACTOR ${STRETCH_FACTOR} GCHP.rc + replace_val stretch_fac ${STRETCH_FACTOR}, input.nml = + replace_val GCHP.TARGET_LAT ${TARGET_LAT} GCHP.rc + replace_val target_lat ${TARGET_LAT}, input.nml = + replace_val GCHP.TARGET_LON ${TARGET_LON} GCHP.rc + replace_val target_lon ${TARGET_LON}/ input.nml = +elif [[ ${STRETCH_GRID} == "OFF" ]]; then + comment_line GCHP.STRETCH_FACTOR GCHP.rc + comment_line GCHP.TARGET_LAT GCHP.rc + comment_line GCHP.TARGET_LON GCHP.rc + sed -i -e "s|\&fv_core_nml|#\&fv#_core_nml|" input.nml + comment_line do_schmidt input.nml + comment_line stretch_fac input.nml + comment_line target_lat input.nml + comment_line target_lon input.nml +else + print_msg "WARNING: unknown setting for GCHP.STRETCH_GRID." + exit 1 +fi + +#### set input restart filename +print_msg " " +print_msg "Initial restart file:" +print_msg "---------------------" +replace_val GCHPchem_INTERNAL_RESTART_FILE "+${INITIAL_RESTART}" GCHP.rc + +### adjoint model phase +replace_val MODEL_PHASE "ADJOINT" GCHP.rc + +#### Set simulation start and end datetimes based on input.geos +print_msg " " +print_msg "Simulation start, end, duration:" +print_msg "--------------------------------" +replace_val BEG_DATE "${Start_Time}" CAP.rc +replace_val END_DATE "${End_Time}" CAP.rc +replace_val JOB_SGMT "${Duration}" CAP.rc +replace_val REVERSE_TIME "1" CAP.rc + +#### Set debug level +print_msg " " +print_msg "Debug levels:" +print_msg "-------------" +replace_val DEBUG_LEVEL ${MAPL_EXTDATA_DEBUG_LEVEL} ExtData.rc +replace_val MEMORY_DEBUG_LEVEL ${MEMORY_DEBUG_LEVEL} GCHP.rc + +##### Set commonly changed settings in input.geos +print_msg " " +print_msg "Components on/off:" +print_msg "------------------" +replace_val "Turn on Chemistry?" ${Turn_on_Chemistry} input.geos +replace_val "Turn on emissions?" ${Turn_on_emissions} input.geos +replace_val "Turn on Transport" ${Turn_on_Transport} input.geos +replace_val "Turn on Cloud Conv?" ${Turn_on_Cloud_Conv} input.geos +replace_val "Turn on PBL Mixing?" ${Turn_on_PBL_Mixing} input.geos +replace_val " => Use non-local PBL?" ${Turn_on_Non_Local_Mixing} input.geos +replace_val "Turn on Dry Deposition?" ${Turn_on_Dry_Deposition} input.geos +replace_val "Turn on Wet Deposition?" ${Turn_on_Wet_Deposition} input.geos +replace_val AdvCore_Advection ${ADVCORE_ADVECTION} GCHP.rc + +print_msg " " +print_msg "Switches for UCX:" +print_msg "------------------" +replace_val " => Use CH4 emissions?" ${Use_CH4_emis} input.geos +replace_val " => Set init. strat. H2O" ${Init_strat_H2O} input.geos + +#### Set timesteps. This includes updating ExtData.rc entries for PS2, +#### SPHU2, and TMPU2 such that read frequency matches dynamic frequency +print_msg " " +print_msg "Timesteps:" +print_msg "----------" +replace_val "Tran\/conv timestep \[sec\]" ${TransConv_Timestep_sec} input.geos +replace_val "Chem\/emis timestep \[sec\]" ${ChemEmiss_Timestep_sec} input.geos +replace_val "Radiation Timestep \[sec\]" ${RRTMG_Timestep_sec} input.geos +replace_val HEARTBEAT_DT ${TransConv_Timestep_sec} GCHP.rc +replace_val SOLAR_DT ${TransConv_Timestep_sec} GCHP.rc +replace_val IRRAD_DT ${TransConv_Timestep_sec} GCHP.rc +replace_val RUN_DT ${TransConv_Timestep_sec} GCHP.rc +replace_val GCHPchem_DT ${ChemEmiss_Timestep_sec} GCHP.rc +replace_val RRTMG_DT ${RRTMG_Timestep_sec} GCHP.rc +replace_val DYNAMICS_DT ${TransConv_Timestep_sec} GCHP.rc +replace_val HEARTBEAT_DT ${TransConv_Timestep_sec} CAP.rc +replace_val GCHPchem_REFERENCE_TIME ${TransConv_Timestep_HHMMSS} GCHP.rc +update_dyn_freq PS2 ExtData.rc +update_dyn_freq SPHU2 ExtData.rc +update_dyn_freq TMPU2 ExtData.rc + +#### Set frequency of writing restart files +# Set to a very large number if turned off +print_msg " " +print_msg "Periodic checkpoints:" +print_msg "---------------------" +if [[ ${Periodic_Checkpoint} == "ON" ]]; then + uncomment_line RECORD_FREQUENCY GCHP.rc + uncomment_line RECORD_REF_DATE GCHP.rc + uncomment_line RECORD_REF_TIME GCHP.rc + use_start=1 + replace_val RECORD_FREQUENCY "${Checkpoint_Freq}" GCHP.rc + if [[ ${Checkpoint_Ref_Date} == "START" ]]; then + Checkpoint_Ref_Date="${Start_Time:0:8}" + else + use_start=0 + fi + if [[ ${Checkpoint_Ref_Time} == "START" ]]; then + Checkpoint_Ref_Time="${Start_Time:9:6}" + else + use_start=0 + fi + replace_val RECORD_REF_DATE "${Checkpoint_Ref_Date}" GCHP.rc + replace_val RECORD_REF_TIME "${Checkpoint_Ref_Time}" GCHP.rc + if [[ ${use_start} == "1" ]]; then + print_msg "WARNING: Checkpoint file written at simulation start will contain all zeros" + fi +elif [[ ${Periodic_Checkpoint} == "OFF" ]]; then + print_msg "WARNING: Periodic checkpoints are turned off" + comment_line RECORD_FREQUENCY GCHP.rc + comment_line RECORD_REF_DATE GCHP.rc + comment_line RECORD_REF_TIME GCHP.rc +else + print_msg "ERROR: unknown setting for Periodic_Checkpoint. Must be ON or OFF." + exit 1 +fi + +#### Set output frequency, duration, and mode +print_msg " " +print_msg "Diagnostics:" +print_msg "------------" + +if [[ ${#timeAvg_collections[@]} > 0 ]]; then + for c in ${timeAvg_collections[@]}; do + replace_val $c.mode "'time-averaged'" HISTORY.rc + replace_val $c.frequency ${timeAvg_freq} HISTORY.rc + replace_val $c.duration ${timeAvg_dur} HISTORY.rc + done +fi +if [[ ${#inst_collections[@]} > 0 ]]; then + for c in ${inst_collections[@]}; do + replace_val $c.mode "'instantaneous'" HISTORY.rc + replace_val $c.frequency ${inst_freq} HISTORY.rc + replace_val $c.duration ${inst_dur} HISTORY.rc + done +fi + +#### Set options in HEMCO_Config.rc +print_msg "" +if [[ ${dustSetting[3]} = "on" ]]; then + print_msg "HEMCO settings:" + print_msg "---------------" + replace_val "--> Mass tuning factor" ${Dust_SF} HEMCO_Config.rc +fi + + diff --git a/run/GCHP/runScriptSamples/gchp.adjoint.run b/run/GCHP/runScriptSamples/gchp.adjoint.run new file mode 100755 index 000000000..23616a505 --- /dev/null +++ b/run/GCHP/runScriptSamples/gchp.adjoint.run @@ -0,0 +1,95 @@ +#!/bin/bash +#PBS -S /bin/bash +#PBS -N SGIdebugGCHP +#PBS -l select=2:ncpus=24:mpiprocs=48:model=bro +#PBS -l walltime=00:30:00 +#PBS -j oe +#PBS -W group_list=[YOUR_ACCOUNT] +#PBS -m e +#PBS -M your.name@email.com + +# to run on more nodes / processes, use +# #PBS -l select=NNODEES:ncpus=NCPUS_PER_NODE:mpirocs=(NNODES * NCPUS_PER_NODE):model=bro +# for example, to run on 48 cores total over 2 nodes +# #PBS -l select=2:ncpus=24:mpiprocs=48:model=bro + +# By default, PBS executes your job from your home directory. +# However, you can use the environment variable +# PBS_O_WORKDIR to change to the directory where +# you submitted your job. + +cd $PBS_O_WORKDIR + +# Define GEOS-Chem log file +log="gchp.log" + +# Always remove cap_restart if not doing a multi-segmented run +if [[ -e cap_restart ]]; then + rm cap_restart +fi + +# Assume success until overwritten +rc=0 + +# Sync all config files with settings in runConfig.sh +./runConfig_adj.sh > ${log} +rc=$? +if [[ $rc == 0 ]]; then + + # Source your environment file. This requires first setting the gchp.env + # symbolic link using script setEnvironment in the run directory. + # Be sure gchp.env points to the same file for both compilation and + # running. You can copy or adapt sample environment files located in + # ./envSamples subdirectory. + gchp_env=$(readlink -f gchp.env) + if [ ! -f ${gchp_env} ] + then + echo "ERROR: gchp.rc symbolic link is not set!" + echo "Copy or adapt an environment file from the ./envSamples " + echo "subdirectory prior to running. Then set the gchp.env " + echo "symbolic link to point to it using ./setEnvironment." + echo "Exiting." + exit 1 + fi + echo " " >> ${log} + echo "WARNING: You are using environment settings in ${gchp_env}" >> ${log} + source ${gchp_env} >> ${log} + + # Use SLURM to distribute tasks across nodes + NX=$( grep NX GCHP.rc | awk '{print $2}' ) + NY=$( grep NY GCHP.rc | awk '{print $2}' ) + coreCount=$(( ${NX} * ${NY} )) + + #planeCount=$(( ${coreCount} / ${SLURM_NNODES} )) + #if [[ $(( ${coreCount} % ${SLURM_NNODES} )) > 0 ]]; then + #${planeCount}=$(( ${planeCount} + 1 )) + #fi + + # Echo info from computational cores to log file for displaying results + echo "# of CPUs : ${coreCount}" >> ${log} + #echo "# of nodes: ${SLURM_NNODES}" >> ${log} + echo "-m plane : ${planeCount}" >> ${log} + + # Optionally compile + # Uncomment the line below to compile from scratch + # See other compile options with 'make help' + # make build_all + + # Echo start date + echo ' ' >> ${log} + echo '===> Run started at' `date` >> ${log} + + mpiexec -n $coreCount ./gchp >> $log 2>&1 & + tail --pid=$! -f $log + #mpiexec dplace -s1 -c 4-11 ./grinder < run_input > output + rc=$? +# Echo end date + echo '===> Run ended at' `date` >> ${log} + echo "Exit code: $rc" + +else + cat ${log} +fi + +# -end of script- +exit $rc diff --git a/run/GCHP/runScriptSamples/gchp.pleiades.run b/run/GCHP/runScriptSamples/gchp.pleiades.run new file mode 100755 index 000000000..99cf62618 --- /dev/null +++ b/run/GCHP/runScriptSamples/gchp.pleiades.run @@ -0,0 +1,95 @@ +#!/bin/bash +#PBS -S /bin/bash +#PBS -N SGIdebugGCHP +#PBS -l select=2:ncpus=24:mpiprocs=48:model=bro +#PBS -l walltime=00:30:00 +#PBS -j oe +#PBS -W group_list=[YOUR_ACCOUNT] +#PBS -m e +#PBS -M your.name@email.com + +# to run on more nodes / processes, use +# #PBS -l select=NNODEES:ncpus=NCPUS_PER_NODE:mpirocs=(NNODES * NCPUS_PER_NODE):model=bro +# for example, to run on 48 cores total over 2 nodes +# #PBS -l select=2:ncpus=24:mpiprocs=48:model=bro + +# By default, PBS executes your job from your home directory. +# However, you can use the environment variable +# PBS_O_WORKDIR to change to the directory where +# you submitted your job. + +cd $PBS_O_WORKDIR + +# Define GEOS-Chem log file +log="gchp.log" + +# Always remove cap_restart if not doing a multi-segmented run +if [[ -e cap_restart ]]; then + rm cap_restart +fi + +# Assume success until overwritten +rc=0 + +# Sync all config files with settings in runConfig.sh +./runConfig.sh > ${log} +rc=$? +if [[ $rc == 0 ]]; then + + # Source your environment file. This requires first setting the gchp.env + # symbolic link using script setEnvironment in the run directory. + # Be sure gchp.env points to the same file for both compilation and + # running. You can copy or adapt sample environment files located in + # ./envSamples subdirectory. + gchp_env=$(readlink -f gchp.env) + if [ ! -f ${gchp_env} ] + then + echo "ERROR: gchp.rc symbolic link is not set!" + echo "Copy or adapt an environment file from the ./envSamples " + echo "subdirectory prior to running. Then set the gchp.env " + echo "symbolic link to point to it using ./setEnvironment." + echo "Exiting." + exit 1 + fi + echo " " >> ${log} + echo "WARNING: You are using environment settings in ${gchp_env}" >> ${log} + source ${gchp_env} >> ${log} + + # Use SLURM to distribute tasks across nodes + NX=$( grep NX GCHP.rc | awk '{print $2}' ) + NY=$( grep NY GCHP.rc | awk '{print $2}' ) + coreCount=$(( ${NX} * ${NY} )) + + #planeCount=$(( ${coreCount} / ${SLURM_NNODES} )) + #if [[ $(( ${coreCount} % ${SLURM_NNODES} )) > 0 ]]; then + #${planeCount}=$(( ${planeCount} + 1 )) + #fi + + # Echo info from computational cores to log file for displaying results + echo "# of CPUs : ${coreCount}" >> ${log} + #echo "# of nodes: ${SLURM_NNODES}" >> ${log} + echo "-m plane : ${planeCount}" >> ${log} + + # Optionally compile + # Uncomment the line below to compile from scratch + # See other compile options with 'make help' + # make build_all + + # Echo start date + echo ' ' >> ${log} + echo '===> Run started at' `date` >> ${log} + + mpiexec -n $coreCount ./gchp >> $log 2>&1 & + tail --pid=$! -f $log + #mpiexec dplace -s1 -c 4-11 ./grinder < run_input > output + rc=$? +# Echo end date + echo '===> Run ended at' `date` >> ${log} + echo "Exit code: $rc" + +else + cat ${log} +fi + +# -end of script- +exit $rc