From 41750bfa15aaf6117bce28f3559852c8ada503a1 Mon Sep 17 00:00:00 2001 From: Janak Joshi Date: Wed, 9 Oct 2024 20:57:28 -0400 Subject: [PATCH 1/2] SU_Volcanic: added protection for missing files and corrected file path for AMIP --- .../SU2G_GridComp/AMIP/SU2G_instance_SU.rc | 2 +- .../SU2G_GridComp/SU2G_GridCompMod.F90 | 22 ++++++++++++++----- .../SU2G_GridComp/SU2G_instance_SU.rc | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ESMF/GOCART2G_GridComp/SU2G_GridComp/AMIP/SU2G_instance_SU.rc b/ESMF/GOCART2G_GridComp/SU2G_GridComp/AMIP/SU2G_instance_SU.rc index 39a28308..a2a1fd9c 100644 --- a/ESMF/GOCART2G_GridComp/SU2G_GridComp/AMIP/SU2G_instance_SU.rc +++ b/ESMF/GOCART2G_GridComp/SU2G_GridComp/AMIP/SU2G_instance_SU.rc @@ -9,7 +9,7 @@ nbins: 4 # Volcanic pointwise sources volcano_srcfilen_explosive: ExtData/chemistry/CARN/v202401/explosive/so2_explosive_volcanic_emissions_CARN_v202401.%y4%m2%d2.rc -volcano_srcfilen_degassing: ExtData/chemistry/CARN/v202401/so2_volcanic_emissions_CARN_v202401.degassing_only.rc +volcano_srcfilen_degassing: ExtData/chemistry/CARN/v202401/sfc/so2_volcanic_emissions_CARN_v202401.degassing_only.rc # Heights [m] of LTO, CDS and CRS aviation emissions layers aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 diff --git a/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 index b5739d5a..4a3d221e 100644 --- a/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 +++ b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 @@ -840,7 +840,6 @@ subroutine Run1 (GC, import, export, clock, RC) ! ----------------------------------------------- thread = MAPL_get_current_thread() workspace => self%workspaces(thread) - ! Update Volcanic SO2 Emissions Daily if(workspace%nymd_last /= nymd) then workspace%nymd_last = nymd @@ -850,10 +849,16 @@ subroutine Run1 (GC, import, export, clock, RC) if(index(self%volcano_srcfilen_degassing,'volcanic_') /= 0) then call StrTemplate(fname, self%volcano_srcfilen_degassing, xid='unknown', & nymd=nymd, nhms=120000 ) - call ReadPointEmissions (nymd, fname, workspace%nVolc, workspace%vLat, workspace%vLon, & + inquire(file=fname, exist=fileExists) + if (fileExists) then + call ReadPointEmissions (nymd, fname, workspace%nVolc, workspace%vLat, workspace%vLon, & workspace%vElev, workspace%vCloud, workspace%vSO2, workspace%vStart, & workspace%vEnd, label='volcano', __RC__) - workspace%vSO2 = workspace%vSO2 * fMassSO2 / fMassSulfur + workspace%vSO2 = workspace%vSO2 * fMassSO2 / fMassSulfur + else + print *, 'Error: file not found ',fname + stop + end if end if ! EXPLOSIVE: Get pointwise SO2 and altitude of volcanoes from a daily file data base @@ -861,11 +866,18 @@ subroutine Run1 (GC, import, export, clock, RC) if(index(self%volcano_srcfilen_explosive,'volcanic_') /= 0) then call StrTemplate(fname, self%volcano_srcfilen_explosive, xid='unknown', & nymd=nymd, nhms=120000 ) - call ReadPointEmissions (nymd, fname, workspace%nVolcE, workspace%vLatE, workspace%vLonE, & + inquire(file=fname, exist=fileExists) + if (fileExists) then + call ReadPointEmissions (nymd, fname, workspace%nVolcE, workspace%vLatE, workspace%vLonE, & workspace%vElevE, workspace%vCloudE, workspace%vSO2E, workspace%vStartE, & workspace%vEndE, label='volcano', __RC__) - workspace%vSO2 = workspace%vSO2 * fMassSO2 / fMassSulfur + workspace%vSO2 = workspace%vSO2 * fMassSO2 / fMassSulfur + else + print *, 'Error: file not found ', fname + stop + end if end if + end if ! DEGASSING: Apply volcanic emissions diff --git a/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_instance_SU.rc b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_instance_SU.rc index 4509e3f4..f46a747e 100644 --- a/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_instance_SU.rc +++ b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_instance_SU.rc @@ -9,7 +9,7 @@ nbins: 4 # Volcanic pointwise sources volcano_srcfilen_explosive: /dev/null -volcano_srcfilen_degassing: ExtData/chemistry/CARN/v202401/so2_volcanic_emissions_CARN_v202401.degassing_only.rc +volcano_srcfilen_degassing: ExtData/chemistry/CARN/v202401/sfc/so2_volcanic_emissions_CARN_v202401.degassing_only.rc # Heights [m] of LTO, CDS and CRS aviation emissions layers aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3 From 81d144163e8810d8e289b0d3230695c39db3a7fa Mon Sep 17 00:00:00 2001 From: Janak Joshi Date: Fri, 11 Oct 2024 12:28:31 -0400 Subject: [PATCH 2/2] SU_Volcanic: let model continue if missing files --- ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 index 4a3d221e..6c84a01a 100644 --- a/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 +++ b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 @@ -855,9 +855,6 @@ subroutine Run1 (GC, import, export, clock, RC) workspace%vElev, workspace%vCloud, workspace%vSO2, workspace%vStart, & workspace%vEnd, label='volcano', __RC__) workspace%vSO2 = workspace%vSO2 * fMassSO2 / fMassSulfur - else - print *, 'Error: file not found ',fname - stop end if end if @@ -872,9 +869,6 @@ subroutine Run1 (GC, import, export, clock, RC) workspace%vElevE, workspace%vCloudE, workspace%vSO2E, workspace%vStartE, & workspace%vEndE, label='volcano', __RC__) workspace%vSO2 = workspace%vSO2 * fMassSO2 / fMassSulfur - else - print *, 'Error: file not found ', fname - stop end if end if