Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/SatDiagnUpdates (netCDF Satellite Diagnostics) #1134

Closed
Prev Previous commit
Next Next commit
Cleaning up code changes in diagnostics_mod.F90
  • Loading branch information
jdshutter committed Feb 18, 2022
commit a96330187f459159992528b184ac7f8ee95c8f85
53 changes: 2 additions & 51 deletions GeosCore/diagnostics_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -299,159 +299,125 @@ SUBROUTINE Set_Diagnostics_EndofTimestep( Input_Opt, State_Chm, State_Diag, &
! Relative humidity [%]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnRH ) THEN

State_Diag%SatDiagnRH(I,:,:) = State_Met%RH(I,:,:) * GOOD

ENDIF

! --------------------------------------------
! Air density [molec/m3]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnAirDen ) THEN

State_Diag%SatDiagnAirDen(I,:,:) = State_Met%AirNumDen(I,:,:) * GOOD

ENDIF

! --------------------------------------------
! Grid box height [m]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnBoxHeight ) THEN

State_Diag%SatDiagnBoxHeight(I,:,:) = State_Met%BXHEIGHT(I,:,:) * GOOD

ENDIF

! --------------------------------------------
! Pressure edges [hPa]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnPEdge ) THEN

State_Diag%SatDiagnPEdge(I,:,:) = &
State_Met%PEDGE(I,:,1:State_Grid%NZ) * GOOD

ENDIF

! --------------------------------------------
! Tropopause pressure [hPa]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnTROPP ) THEN

State_Diag%SatDiagnTROPP(I,:) = State_Met%TROPP(I,:) * GOOD

ENDIF

! --------------------------------------------
! PBL Height [m]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnPBLHeight ) THEN

State_Diag%SatDiagnPBLHeight(I,:) = State_Met%PBLH(I,:) * GOOD

ENDIF

! --------------------------------------------
! PBL Top [m]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnPBLTop ) THEN

State_Diag%SatDiagnPBLTop(I,:) = State_Met%PBL_TOP_m(I,:) * GOOD

ENDIF

! --------------------------------------------
! Air temperature [K]: Temperature Interpolated to Current Time
! This temperture is interpolated from 3 h Met Field (TMPU1 and TMPU2)
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnTAir ) THEN

State_Diag%SatDiagnTAir(I,:,:) = State_Met%T(I,:,:) * GOOD

ENDIF

! --------------------------------------------
! Root Zone Soil Moisture (or Wetness) [fraction]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnGWETROOT ) THEN

State_Diag%SatDiagnGWETROOT(I,:) = State_Met%GWETROOT(I,:) * GOOD

ENDIF

! --------------------------------------------
! Topsoil Moisture (or Wetness) [fraction]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnGWETTOP ) THEN

State_Diag%SatDiagnGWETTOP(I,:) = State_Met%GWETTOP(I,:) * GOOD

ENDIF

! --------------------------------------------
! Direct Photosynthetically Active Radiation [W/m2]:
! Aka Surface downward PAR beam flux
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnPARDR ) THEN

State_Diag%SatDiagnPARDR(I,:) = State_Met%PARDR(I,:) * GOOD

ENDIF

! --------------------------------------------
! Diffuse Photosynthetically Active Radiation [W/m2]:
! Aka Surface downward PAR diffuse flux
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnPARDF ) THEN

State_Diag%SatDiagnPARDF(I,:) = State_Met%PARDF(I,:) * GOOD

ENDIF

! --------------------------------------------
! Total Precipitation (at surface) [mm/day]:
! Documentation says this variable is converted from original units of kg/m2/s
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnPRECTOT ) THEN

State_Diag%SatDiagnPRECTOT(I,:) = State_Met%PRECTOT(I,:) * GOOD

ENDIF

! --------------------------------------------
! Sea Level Pressure [hPa]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnSLP ) THEN

State_Diag%SatDiagnSLP(I,:) = State_Met%SLP(I,:) * GOOD

ENDIF

! --------------------------------------------
! Specific Humidity Interpolated to Current Time [g H2O/kg air]:
! Linearly interpolated from 3 h met field (SPHU1 and SPHU2)
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnSPHU ) THEN

State_Diag%SatDiagnSPHU(I,:,:) = State_Met%SPHU(I,:,:) * GOOD

ENDIF

! --------------------------------------------
! Surface Temperature at 2m [K]
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnTS ) THEN

State_Diag%SatDiagnTS(I,:) = State_Met%TS(I,:) * GOOD

ENDIF

! --------------------------------------------
! PBL Top Height [Levels]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnPBLTOPL ) THEN

State_Diag%SatDiagnPBLTOPL(I,:) = State_Met%PBL_TOP_L(I,:) * GOOD

ENDIF

! --------------------------------------------
Expand All @@ -460,9 +426,7 @@ SUBROUTINE Set_Diagnostics_EndofTimestep( Input_Opt, State_Chm, State_Diag, &
! MODIS LAI used by MEGAN and Soil NOx extension
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnMODISLAI ) THEN

State_Diag%SatDiagnMODISLAI(I,:) = State_Met%MODISLAI(I,:) * GOOD

ENDIF

!=======================================================================
Expand Down Expand Up @@ -532,18 +496,14 @@ SUBROUTINE Set_Diagnostics_EndofTimestep( Input_Opt, State_Chm, State_Diag, &
! SatDiagn Diagnostic for JvalO3O1D [units of s-1 as per JvalO3O1D]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnJvalO3O1D ) THEN

State_Diag%SatDiagnJvalO3O1D(I,:,:) = State_Diag%JvalO3O1D(I,:,:) * GOOD

ENDIF

! --------------------------------------------
! SatDiagn Diagnostic for JvalO3O3P [units of s-1 as per JvalO3O3P]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnJvalO3O3P ) THEN

State_Diag%SatDiagnJvalO3O3P(I,:,:) = State_Diag%JvalO3O3P(I,:,:) * GOOD

ENDIF

!=======================================================================
Expand Down Expand Up @@ -592,44 +552,36 @@ SUBROUTINE Set_Diagnostics_EndofTimestep( Input_Opt, State_Chm, State_Diag, &
! SatDiagn Diagnostic for OH Reactivity [units of s-1 as per OHreactivity]:
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnOHreactivity ) THEN

State_Diag%SatDiagnOHreactivity(I,:,:) = State_Diag%OHreactivity(I,:,:) * GOOD

ENDIF

! --------------------------------------------
! SatDiagn Diagnostic for Surface Emissions (eflx) [units of kg/m2/s]:
! From surface to top of the PBL for Advected Species
! SatDiagn Diagnostic for Column Emissions (ColEmis) [units of kg/m2/s]:
! From surface to maximum vertical level for advected species
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnColEmis ) THEN

State_Diag%SatDiagnColEmis(I,:,:) = State_Diag%SatDiagnColEmis(I,:,:) * GOOD

ENDIF

! --------------------------------------------
! SatDiagn Diagnostic for Total Surface Fluxes [units of kg/m2/s]:
! From surface to top of the PBL for Advected Species (eflx (emis) - dflx(drydep)))
! --------------------------------------------
IF ( State_Diag%Archive_SatDiagnSurfFlux ) THEN

State_Diag%SatDiagnSurfFlux(I,:,:) = State_Diag%SatDiagnSurfFlux(I,:,:) * GOOD

ENDIF

!=======================================================================
! SatDiagn Diagnostic for Chemical Loss
!=======================================================================
IF ( State_Diag%Archive_SatDiagnLoss ) THEN

State_Diag%SatDiagnLoss(I,:,:,:) = State_Diag%Loss(I,:,:,:) * GOOD
ENDIF

!=======================================================================
! SatDiagn Diagnostic for Chemical Production
!=======================================================================
IF ( State_Diag%Archive_SatDiagnProd ) THEN

State_Diag%SatDiagnProd(I,:,:,:) = State_Diag%Prod(I,:,:,:) * GOOD
ENDIF

Expand All @@ -638,7 +590,6 @@ SUBROUTINE Set_Diagnostics_EndofTimestep( Input_Opt, State_Chm, State_Diag, &
! SatDiagnRxnRate was previously defined in fullchem_mod.F90
!=======================================================================
IF ( State_Diag%Archive_SatDiagnRxnRate ) THEN

State_Diag%SatDiagnRxnRate(I,:,:,:) = State_Diag%SatDiagnRxnRate(I,:,:,:) * GOOD
ENDIF

Expand Down