Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
27c3632
Initial repository + Fortran interface NDSL blocks
FlorianDeconinck Feb 12, 2026
2a8784c
CI
FlorianDeconinck Feb 12, 2026
65f9768
Saturation tables [UNTESTED]
FlorianDeconinck Feb 12, 2026
4b0cd1d
Shared code [UNTESTED]
FlorianDeconinck Feb 12, 2026
888d07e
Add constants tests, remove deprecated `pyMoist_constants`
FlorianDeconinck Feb 12, 2026
1e4435a
Add data for constants tests
FlorianDeconinck Feb 12, 2026
3c6e080
Tests scripts
FlorianDeconinck Feb 12, 2026
4afaced
Run pytests checks
FlorianDeconinck Feb 12, 2026
1ae9163
Documentation
FlorianDeconinck Feb 12, 2026
e58c415
Update sat table README
FlorianDeconinck Feb 12, 2026
6e703cd
Renamed `shared.generic_math` -> `shared.atmos_receipe`
FlorianDeconinck Feb 12, 2026
10e0cb9
Missing `translate_tests` hook
FlorianDeconinck Feb 12, 2026
9f66eba
Propagate (and spellcheck) `atmos_recipes`
FlorianDeconinck Feb 12, 2026
2ef5951
Fix docs
FlorianDeconinck Feb 12, 2026
2a4b3d5
Initial UW integration - hooks to Fortran, hooks in python, docs
FlorianDeconinck Feb 12, 2026
65671be
Modify `get_data` to new datashare tar.gz
FlorianDeconinck Feb 12, 2026
18b2d0a
Merge branch 'fdeconinck/feat/pyMoist_infra' into feature/dsl/UW
FlorianDeconinck Feb 12, 2026
8da9043
Merge branch 'fdeconinck/feat/pyMoist_infra' into feature/dsl/GFDL1M
FlorianDeconinck Feb 12, 2026
8347ef4
Origin code copy + adding radiation coupling and redistribute clouds …
FlorianDeconinck Feb 12, 2026
0ff91cd
Docs
FlorianDeconinck Feb 12, 2026
aa04bde
Fix GFDL_1M imports
FlorianDeconinck Feb 12, 2026
4cfcf10
Shif tests into their own directories to allow for mixed conftest
FlorianDeconinck Feb 12, 2026
c5588ac
Update CI for numerical unit tests
FlorianDeconinck Feb 12, 2026
0488d7d
Merge branch 'fdeconinck/feat/pyMoist_infra' into feature/dsl/GFDL1M
FlorianDeconinck Feb 12, 2026
697b9ac
Merge branch 'fdeconinck/feat/pyMoist_infra' into feature/dsl/UW
FlorianDeconinck Feb 12, 2026
658cea1
Update to latest GFDL_1M
FlorianDeconinck Feb 12, 2026
c3ad36e
Fix bad import
FlorianDeconinck Feb 12, 2026
0c85885
Translate tests suite
FlorianDeconinck Feb 12, 2026
c1042f6
README for GFDL1M
FlorianDeconinck Feb 12, 2026
579e3df
Update README with validation results
FlorianDeconinck Feb 12, 2026
7e3c0f9
Bring "Managed" tooling to make MAPL -> NDSL memory transfer easier
FlorianDeconinck Feb 13, 2026
6f1c547
Merge branch 'fdeconinck/feat/pyMoist_infra' into feature/dsl/UW
FlorianDeconinck Feb 13, 2026
e960263
Merge branch 'fdeconinck/feat/pyMoist_infra' into feature/dsl/GFDL1M
FlorianDeconinck Feb 13, 2026
c6353f6
Bring in CUDA-ready `profiler + lint
FlorianDeconinck Feb 13, 2026
36a45be
Merge branch 'fdeconinck/feat/pyMoist_infra' into feature/dsl/GFDL1M
FlorianDeconinck Feb 13, 2026
b0f6a08
Merge branch 'fdeconinck/feat/pyMoist_infra' into feature/dsl/UW
FlorianDeconinck Feb 13, 2026
21e02b1
Lint
FlorianDeconinck Feb 13, 2026
4a67b2d
Moved all UW code and translate tests
Feb 13, 2026
cbf215c
Merge branch 'fdeconinck/feat/pyMoist_infra' of github.com:FlorianDec…
Feb 13, 2026
738f4d1
Changes to UW thresholds
Feb 13, 2026
051e111
Update Moist GFDL1M init hooks
FlorianDeconinck Feb 13, 2026
4036ce6
Merge branch 'feature/dsl/UW' into fdeconinck/feat/pyMoist_infra
FlorianDeconinck Feb 13, 2026
c0944f7
Default backend to `dace:cpu_KJI`
FlorianDeconinck Feb 13, 2026
778b3df
Added State to UW interface. And some fixes to UW subtests.
Feb 13, 2026
c570c51
First working integration
FlorianDeconinck Feb 14, 2026
bcd8134
Merge branch 'fdeconinck/feat/pyMoist_infra' into feature/dsl/GFDL1M
FlorianDeconinck Feb 14, 2026
7b1fc8d
Debugging BuoyancySorting stencil
Feb 17, 2026
ca8458c
Merge branch 'feature/dsl/GFDL1M' into fdeconinck/feat/pyMoist_infra
FlorianDeconinck Feb 17, 2026
921d33a
Move UW interface to Managed State
FlorianDeconinck Feb 17, 2026
eee7cd9
UW interface fix
FlorianDeconinck Feb 17, 2026
9aa2059
Use the `backend` in the Flags
FlorianDeconinck Feb 18, 2026
13bb42f
Set proper precision for GFDL1M driver constant
FlorianDeconinck Feb 26, 2026
6c5cbe2
Update to latest `MAPL_Python` brdige
FlorianDeconinck Feb 26, 2026
b23df47
Introduce `moist_workaround` a non-standard bridge to fetch `CNVTracers`
FlorianDeconinck Mar 5, 2026
b3efc47
CNV_Traceres in UW + NCNST hardcode swap based on EXP_NAME
FlorianDeconinck Mar 5, 2026
04c6d96
Update to NDSL.2026.02.00
FlorianDeconinck Mar 5, 2026
10954d1
Link in `fms_r4` because MacOS wasn't finding the symbols
FlorianDeconinck Mar 5, 2026
37a2d99
Introduce a `recorder` on managed state
FlorianDeconinck Mar 5, 2026
db940d7
Lots of UW updates and fixes
Mar 6, 2026
3a74516
New UW_interface with state recorder
Mar 6, 2026
7a08073
State recorder updates to UW_interface_mod and MoistGridComp
Mar 6, 2026
413ff14
Set CNPCRATE to alloc=True in UW_interface.py
Mar 6, 2026
c9ad27e
Add two fields to UW state (QITOT and QLTOT)
Mar 6, 2026
d25d6b8
Reset cush to -1.0 is condensation mask is triggered.
Mar 6, 2026
c8ee600
Update 4 moisture-related state variables (QLCN, QICN, QLLS, QILS)
Mar 7, 2026
4cf0eba
Minor formatting changes to UW_interface.py
Mar 7, 2026
17bf702
Add `armtwp_ice` tracer count
FlorianDeconinck Mar 7, 2026
14e63fd
Fix GPU interfacing
FlorianDeconinck Mar 7, 2026
867e073
minor fixes for GFDL1M HydrostaticPDF
CharlesKrop Mar 9, 2026
01a6dc4
Reset UW output variables to zero at start of UW and when condensatio…
Mar 10, 2026
be13336
Fixed WarmRain - implicit_fall was not running because of a poor cond…
CharlesKrop Mar 12, 2026
4eb5abf
Merge branch 'fdeconinck/feat/pyMoist_infra' of https://github.com/Fl…
CharlesKrop Mar 12, 2026
695c8ab
Modified translate tests to test a single iteration at a time
CharlesKrop Mar 12, 2026
c6f83e8
renamed GFDL_1M_driver_tables test to GFDL_1M_DriverTables
CharlesKrop Mar 12, 2026
d49cc01
Revised the setting of UW outputs. Aligns more closely with Fortran now.
Mar 12, 2026
259e262
local changes in case the nasa id gets deleted
CharlesKrop Mar 13, 2026
0790143
more debug stuff
CharlesKrop Mar 13, 2026
d21dd71
GFDL_1M_Driver translate test is now perfect
CharlesKrop Mar 16, 2026
312e5bc
removing an extra debug line
CharlesKrop Mar 16, 2026
4c0ef79
removing an extra debug line
CharlesKrop Mar 16, 2026
269bc0d
Merge branch 'incasemyidgetsdeleted' of github.com:CharlesKrop/GEOSgc…
CharlesKrop Mar 16, 2026
ef8e963
GFDL_1M test is now *very* close to passing, only a few points on few…
CharlesKrop Mar 16, 2026
f829646
Merge branch 'incasemyidgetsdeleted' into fdeconinck/feat/pyMoist_infra
CharlesKrop Mar 16, 2026
a771605
Update to new Backend API
FlorianDeconinck Mar 16, 2026
5f2aa5a
Update to new I/J/K dimension naming scheme
FlorianDeconinck Mar 16, 2026
5c6ac13
Forgotten `is_gpu_backend` API switches
FlorianDeconinck Mar 16, 2026
6300f2c
Fix another Backend API change
FlorianDeconinck Mar 16, 2026
cf1df0f
CPU backend by default
FlorianDeconinck Mar 16, 2026
6f14a42
Some linting
FlorianDeconinck Mar 16, 2026
ab11206
Revised the setting of UW outputs. Updated translate tests.
Mar 17, 2026
00b6dce
Fixed merge conflicts
Mar 17, 2026
a93a159
Merge branch 'fdeconinck/feat/pyMoist_infra' of github.com:FlorianDec…
Mar 17, 2026
bc2b0c6
Remove ice_fraction from uw_functions.py and use ice_fraction from in…
Mar 17, 2026
e0ea9d8
Some translate test fixes and buoyancy sorting loop reset.
Mar 17, 2026
333fb68
Updated saturation specific humidity functions API and documentation
CharlesKrop Mar 17, 2026
f8b09d6
Merge branch 'fdeconinck/feat/pyMoist_infra' of https://github.com/Fl…
CharlesKrop Mar 17, 2026
5f4aac6
deleted the stencil version of saturation_specific_humidity and assoc…
CharlesKrop Mar 17, 2026
85a2a3e
renamed "qsat_functions.py" to a more appropriate - albeit longer "sa…
CharlesKrop Mar 17, 2026
cbd4e30
ensured default value is float, not int
CharlesKrop Mar 17, 2026
a0333c6
revived the saturation_specific_humidity translate test, still need t…
CharlesKrop Mar 17, 2026
c85f311
import to init for new translate test
CharlesKrop Mar 17, 2026
debc892
Multiply p by 100 before passing into QSAT function. This matches the…
Mar 18, 2026
5e65583
WarmRain translate test fix, was testing the wrong subset for interfa…
CharlesKrop Mar 18, 2026
8972ad2
Merge branch 'fdeconinck/feat/pyMoist_infra' of https://github.com/Fl…
CharlesKrop Mar 18, 2026
74d52cc
Reset all UW locals at runtime instead of init
Mar 18, 2026
be102cb
Merge branch 'fdeconinck/feat/pyMoist_infra' of github.com:FlorianDec…
Mar 18, 2026
baa8274
Update UW_interface.py so that if LM=181 windsrcavg is 1. And disable…
Mar 18, 2026
39043bc
Introduce env var to drive the backend from GEOS run scripts
FlorianDeconinck Mar 18, 2026
857c719
another tiny WarmRain translate test fix
CharlesKrop Mar 18, 2026
81f8399
Merge branch 'fdeconinck/feat/pyMoist_infra' of https://github.com/Fl…
CharlesKrop Mar 18, 2026
f4093fa
improved comments
CharlesKrop Mar 18, 2026
2c2e56a
ice_cloud: couple of big fixes and proper documentation
CharlesKrop Mar 18, 2026
39fe0c1
removed nhalo=0 restriction in __call__, GFDL_1M runs fine with non-z…
CharlesKrop Mar 18, 2026
934bb60
added new fields to push back to the model, bringing this in line wit…
CharlesKrop Mar 19, 2026
5102c92
more outdated comments
CharlesKrop Mar 19, 2026
5f247d5
moved GFDL1M into a microphysics folder.
CharlesKrop Mar 19, 2026
1b5e2fa
reorganized UW into convection/UW
CharlesKrop Mar 20, 2026
ae846a6
moved interfaces into respective folders (microphysics, convection) a…
CharlesKrop Mar 20, 2026
5f1698b
removing debug saves in UW
CharlesKrop Mar 20, 2026
4c4a8ab
manual merge of GF_2020 into feat/pyMoist_infra
CharlesKrop Mar 20, 2026
bd5336a
manual merge of GF_2020 into feat/pyMoist_infra
CharlesKrop Mar 20, 2026
28b0f94
Revert "manual merge of GF_2020 into feat/pyMoist_infra"
CharlesKrop Mar 20, 2026
7c046ee
upddating constants.py with new tracer constant
CharlesKrop Mar 20, 2026
ad59b53
type I_XIM --> I_DIM
CharlesKrop Mar 20, 2026
d8099ef
updating field_types.py with new stuff from GF_2020
CharlesKrop Mar 20, 2026
1f851a2
bunch of misc things coming from GF_2020 branch
CharlesKrop Mar 20, 2026
1365b62
Revert "bunch of misc things coming from GF_2020 branch"
CharlesKrop Mar 20, 2026
0626c45
bunch of misc things coming from GF_2020
CharlesKrop Mar 20, 2026
ccde002
added a few GF2020 ssavepoints in the init
CharlesKrop Mar 20, 2026
a1aafdb
Merge branch 'fdeconinck/feat/pyMoist_infra' of https://github.com/Fl…
CharlesKrop Mar 20, 2026
413fa14
changing import to new saturation paths
CharlesKrop Mar 20, 2026
02f2647
starting to bring GF2020 in line with the current state of NDSL and p…
CharlesKrop Mar 20, 2026
f1bbd23
updated markdown files
CharlesKrop Mar 23, 2026
4ac1557
check_flags update
CharlesKrop Mar 23, 2026
639da3f
Revert default backend to old DaCe
FlorianDeconinck Mar 23, 2026
ca74da4
Clean up
FlorianDeconinck Mar 23, 2026
971a40d
documentation updates for GFDL1M and GFDL1MDriver
CharlesKrop Mar 23, 2026
143d6d1
Merge branch 'fdeconinck/feat/pyMoist_infra' of https://github.com/Fl…
CharlesKrop Mar 23, 2026
da1446e
bugfix - this should have been pushed as part of hte check_flags changes
CharlesKrop Mar 23, 2026
367386b
More documentation updates for GFDL1M
CharlesKrop Mar 23, 2026
e57babe
GF2020: removed unnecessary entries from configuration dataclasses, c…
CharlesKrop Mar 24, 2026
6c05050
GF2020: first step towards a fortran interface, still a few questions…
CharlesKrop Mar 24, 2026
d7f817b
GF2020: fixed a typo
CharlesKrop Mar 24, 2026
e4afffa
GF2020: removing DTIME from GF2020CumulusParameterizationConfig, now …
CharlesKrop Mar 24, 2026
31391bb
Strip GF2020. o7
FlorianDeconinck Mar 24, 2026
93e0c68
Remove badly pushed vscode config
FlorianDeconinck Mar 24, 2026
84eadac
Merge remote-tracking branch 'GEOS-ESM/develop' into dsl/feature/mois…
FlorianDeconinck Mar 24, 2026
7f8ac6b
Fix technical documentation
FlorianDeconinck Mar 24, 2026
6cf7954
Install `pyMoist` to the `Python` directory of GEOS
FlorianDeconinck Mar 25, 2026
c15808b
Trigger `ndsl-checks` on `pyMoist` only
FlorianDeconinck Mar 25, 2026
fa6b4bc
Update README
FlorianDeconinck Mar 25, 2026
1976903
UW: docstrings + lint + proper gtscript imports
FlorianDeconinck Mar 25, 2026
5922216
Move zero'd out locals to proper function and use direct memset
FlorianDeconinck Mar 25, 2026
4dc6e67
Remove debug code
FlorianDeconinck Mar 25, 2026
5f64038
Upgrade backend names, fix .gitignore, remove bad cache commit
FlorianDeconinck Mar 26, 2026
82bbf85
Restore named based tracers
FlorianDeconinck Mar 26, 2026
9df43c3
Do not reset global tables
FlorianDeconinck Mar 27, 2026
454569d
Protect GetPointer call when association has been read to be False - …
FlorianDeconinck Mar 27, 2026
6c012dd
Move `CNV_* ` resource read that sets default (sic) outside of the in…
FlorianDeconinck Mar 27, 2026
c07ca5e
Remove recorder for debug
FlorianDeconinck Mar 27, 2026
9aa46ec
Fix backend compiler override for new NDSL
FlorianDeconinck Apr 8, 2026
ad453c9
Merge branch 'develop' into dsl/feature/moist/UW_and_GFDL1M
sdrabenh Apr 16, 2026
e5e3160
Remove FMS dependence in Moist (#13)
mathomp4 Apr 22, 2026
4e79795
Merge dsl/feature/uw all levels into dsl/feature/moist/UW_and_GFDL1M …
katrinafandrich Apr 24, 2026
e6bda09
GF-2020 Convection Parameterization (#15)
CharlesKrop Apr 27, 2026
47206b0
removing debug statements from interfaces
CharlesKrop Apr 28, 2026
11bf85d
fixing GF2020 interface, minor change to moist_workaround required
CharlesKrop Apr 28, 2026
c00678e
Performance portable f the max reduce (TMP
FlorianDeconinck Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
62 changes: 62 additions & 0 deletions .github/workflows/ndsl-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: NDSL Lint & Translate Tests

on:
push:
paths: "./GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/pyMoist/**"
workflow_dispatch:

# cancel running jobs if theres a newer push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
main:
env:
DATA_PATH: ./test_data/11.5.2/TBC_C24_L72/moist
DATA_URL: "https://portal.nccs.nasa.gov/datashare/astg/smt/geos-fp/translate/11.5.2/x86_GNU/Moist/TBC_C24L72.tar.gz"
runs-on: ubuntu-latest
steps:
- name: Step Python 3.11
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Install MPI
run: pip install mpich

- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: 'recursive'

- name: Install Python packages
run: |
pip install ./GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/pyMoist[develop]

- name: Run lint via pre-commit
run: |
cd GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/pyMoist
pre-commit run --all-files

- name: Build Documentation
run: |
cd GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/pyMoist
mkdocs build

- name: Download test_data
run: |
cd GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/pyMoist
mkdir -p ${{ env.DATA_PATH }} && cd ${{ env.DATA_PATH }}
wget ${{ env.DATA_URL }}
tar -xzvf TBC_C24L72.tar.gz

- name: Run regular unit tests
run : |
cd GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/pyMoist
pytests ./tests/numerical

- name: Run translate tests
run: |
cd GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/pyMoist/tests/scripts/
./run_all.sh ../../${{ env.DATA_PATH }} st:dace:cpu:KIJ
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/@GEOSchem_GridComp
/GEOSchem_GridComp
/GEOSchem_GridComp@
.vscode/
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ set (srcs
GEOS_MoistGridComp.F90
# files that are sometimes present?
# ras00.F90 cloud.F90
# Python interface files that doesn't fit the MAPL_PythonBridge pattern
./pyMoist/pyMoist/fortran/moist_workarounds.F90
)

if (CMAKE_Fortran_COMPILER_ID MATCHES Intel AND CMAKE_BUILD_TYPE MATCHES Aggressive)
Expand Down Expand Up @@ -50,21 +52,18 @@ endif ()

esma_add_library (${this}
SRCS ${srcs}
DEPENDENCIES GEOS_Shared GMAO_mpeu MAPL Chem_Shared Chem_Base ESMF::ESMF)

# We need to add_dependencies for fms_r4 because CMake doesn't know we
# need it for include purposes. In R4R8, we only ever link against
# fms_r8, so it doesn't know to build the target fms_r4
# NOTE NOTE NOTE: This should *not* be included in GEOSgcm v12
# because FMS is pre-built library in that case.
add_dependencies (${this} fms_r4)
get_target_property (extra_incs fms_r4 INCLUDE_DIRECTORIES)
target_include_directories(${this} PRIVATE
$<BUILD_INTERFACE:${extra_incs}>
)
DEPENDENCIES GEOS_Shared GMAO_mpeu MAPL Chem_Shared Chem_Base ESMF::ESMF TYPE SHARED)

file (GLOB_RECURSE rc_files CONFIGURE_DEPENDS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc *.yaml)
foreach ( file ${rc_files} )
get_filename_component( dir ${file} DIRECTORY )
install( FILES ${file} DESTINATION etc/${dir} )
endforeach()

# Install the `pyMoist` python source files
# Install the Python/MAPL directory
install (
DIRECTORY pyMoist/pyMoist
DESTINATION lib/Python
USE_SOURCE_PERMISSIONS
)
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ module GEOS_GFDL_1M_InterfaceMod
logical :: LHYDROSTATIC
logical :: LPHYS_HYDROSTATIC
logical :: LMELTFRZ
logical :: USE_PYMOIST_GFDL1M

public :: GFDL_1M_Setup, GFDL_1M_Initialize, GFDL_1M_Run
public :: GFDL_1M_Setup, GFDL_1M_Initialize, GFDL_1M_Run, GFDL_1M_Finalize

contains

Expand Down Expand Up @@ -207,12 +208,15 @@ subroutine GFDL_1M_Setup (GC, CF, RC)

end subroutine GFDL_1M_Setup

subroutine GFDL_1M_Initialize (MAPL, RC)
subroutine GFDL_1M_Initialize (MAPL, CF, IMPORT, EXPORT, RC)
type (MAPL_MetaComp), intent(inout) :: MAPL
integer, optional :: RC ! return code

type (ESMF_Grid ) :: GRID
type (ESMF_State) :: INTERNAL
type (ESMF_State), intent(inout) :: IMPORT
type (ESMF_State), intent(inout) :: EXPORT
type (ESMF_Config), intent(inout) :: CF

type (ESMF_Alarm ) :: ALARM
type (ESMF_TimeInterval) :: TINT
Expand All @@ -221,14 +225,11 @@ subroutine GFDL_1M_Initialize (MAPL, RC)

real, pointer, dimension(:,:,:) :: Q, QLLS, QLCN, QILS, QICN, QRAIN, QSNOW, QGRAUPEL

type(ESMF_VM) :: VM
integer :: comm

call MAPL_GetResource( MAPL, LHYDROSTATIC, Label="HYDROSTATIC:", default=.TRUE., RC=STATUS)
VERIFY_(STATUS)
call MAPL_GetResource( MAPL, LPHYS_HYDROSTATIC, Label="PHYS_HYDROSTATIC:", default=.TRUE., RC=STATUS)
call MAPL_GetResource( MAPL, LPHYS_HYDROSTATIC, Label='PHYS_HYDROSTATIC:', default=.TRUE., RC=STATUS)
VERIFY_(STATUS)
call MAPL_GetResource( MAPL, LMELTFRZ, Label="MELTFRZ:", default=.TRUE., RC=STATUS)
call MAPL_GetResource( MAPL, LMELTFRZ, Label='MELTFRZ:', default=.TRUE., RC=STATUS)
VERIFY_(STATUS)

call MAPL_Get ( MAPL, INTERNAL_ESMF_STATE=INTERNAL, RC=STATUS )
Expand All @@ -252,34 +253,38 @@ subroutine GFDL_1M_Initialize (MAPL, RC)
call MAPL_GetPointer(INTERNAL, QILS, 'QILS' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(INTERNAL, QICN, 'QICN' , RC=STATUS); VERIFY_(STATUS)

call ESMF_VMGetCurrent(VM, _RC)
call ESMF_VMGet(VM, mpiCommunicator=comm, _RC)

call gfdl_cloud_microphys_init(comm)
call gfdl_cloud_microphys_init()
call WRITE_PARALLEL ("INITIALIZED GFDL_1M microphysics in non-generic GC INIT")

call MAPL_GetResource( MAPL, SH_MD_DP , 'SH_MD_DP:' , DEFAULT= .TRUE., RC=STATUS); VERIFY_(STATUS)

call MAPL_GetResource( MAPL, TURNRHCRIT_PARAM, 'TURNRHCRIT:' , DEFAULT= -9999., RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, PDFSHAPE , 'PDFSHAPE:' , DEFAULT= 1 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, ANV_ICEFALL , 'ANV_ICEFALL:' , DEFAULT= 1.0 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, LS_ICEFALL , 'LS_ICEFALL:' , DEFAULT= 1.0 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, LIQ_RADII_PARAM , 'LIQ_RADII_PARAM:' , DEFAULT= 2 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, ICE_RADII_PARAM , 'ICE_RADII_PARAM:' , DEFAULT= 1 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, FAC_RI , 'FAC_RI:' , DEFAULT= 1.0 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, MIN_RI , 'MIN_RI:' , DEFAULT= 5.e-6, RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, MAX_RI , 'MAX_RI:' , DEFAULT=100.e-6, RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, FAC_RL , 'FAC_RL:' , DEFAULT= 1.0 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, MIN_RL , 'MIN_RL:' , DEFAULT= 2.5e-6, RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, MAX_RL , 'MAX_RL:' , DEFAULT=60.0e-6, RC=STATUS); VERIFY_(STATUS)

CCW_EVAP_EFF = 1.e-2
if (do_evap) CCW_EVAP_EFF = 0.0 ! Evap done inside GFDL-MP
call MAPL_GetResource( MAPL, CCW_EVAP_EFF, 'CCW_EVAP_EFF:', DEFAULT= CCW_EVAP_EFF, RC=STATUS); VERIFY_(STATUS)

CCI_EVAP_EFF = 1.e-2
if (do_subl) CCI_EVAP_EFF = 0.0 ! Subl done inside GFDL-MP
call MAPL_GetResource( MAPL, CCI_EVAP_EFF, 'CCI_EVAP_EFF:', DEFAULT= CCI_EVAP_EFF, RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource(MAPL, USE_PYMOIST_GFDL1M, 'USE_PYMOIST_GFDL1M:', default=.FALSE., RC=STATUS); VERIFY_(STATUS)

if (USE_PYMOIST_GFDL1M) then
call MAPL_ConfigSetAttribute(CF, DT_MOIST, 'DSL__GFLD1M_DT:', RC=STATUS); VERIFY_(STATUS)
call MAPL_pybridge_gcinit( "pyMoist.fortran.param_interfaces.microphysics.GFDL1M_interface", MAPL, IMPORT, EXPORT )
else
call MAPL_GetResource( MAPL, SH_MD_DP , 'SH_MD_DP:' , DEFAULT= .TRUE., RC=STATUS); VERIFY_(STATUS)

call MAPL_GetResource( MAPL, TURNRHCRIT_PARAM, 'TURNRHCRIT:' , DEFAULT= -9999., RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, PDFSHAPE , 'PDFSHAPE:' , DEFAULT= 1 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, ANV_ICEFALL , 'ANV_ICEFALL:' , DEFAULT= 1.0 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, LS_ICEFALL , 'LS_ICEFALL:' , DEFAULT= 1.0 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, LIQ_RADII_PARAM , 'LIQ_RADII_PARAM:' , DEFAULT= 2 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, ICE_RADII_PARAM , 'ICE_RADII_PARAM:' , DEFAULT= 1 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, FAC_RI , 'FAC_RI:' , DEFAULT= 1.0 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, MIN_RI , 'MIN_RI:' , DEFAULT= 5.e-6, RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, MAX_RI , 'MAX_RI:' , DEFAULT=100.e-6, RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, FAC_RL , 'FAC_RL:' , DEFAULT= 1.0 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, MIN_RL , 'MIN_RL:' , DEFAULT= 2.5e-6, RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, MAX_RL , 'MAX_RL:' , DEFAULT=60.0e-6, RC=STATUS); VERIFY_(STATUS)

CCW_EVAP_EFF = 1.e-2
if (do_evap) CCW_EVAP_EFF = 0.0 ! Evap done inside GFDL-MP
call MAPL_GetResource( MAPL, CCW_EVAP_EFF, 'CCW_EVAP_EFF:', DEFAULT= CCW_EVAP_EFF, RC=STATUS); VERIFY_(STATUS)

CCI_EVAP_EFF = 1.e-2
if (do_subl) CCI_EVAP_EFF = 0.0 ! Subl done inside GFDL-MP
call MAPL_GetResource( MAPL, CCI_EVAP_EFF, 'CCI_EVAP_EFF:', DEFAULT= CCI_EVAP_EFF, RC=STATUS); VERIFY_(STATUS)
endif ! USE_PYMOIST_GFDL1M

call MAPL_GetResource( MAPL, CNV_FRACTION_MIN, 'CNV_FRACTION_MIN:', DEFAULT= 500.0, RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, CNV_FRACTION_MAX, 'CNV_FRACTION_MAX:', DEFAULT= 1500.0, RC=STATUS); VERIFY_(STATUS)
Expand Down Expand Up @@ -382,6 +387,10 @@ subroutine GFDL_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)
call ESMF_TimeIntervalGet(TINT, S_R8=DT_R8,RC=STATUS); VERIFY_(STATUS)
DT_MOIST = DT_R8

if (USE_PYMOIST_GFDL1M) then
call MAPL_pybridge_gcrun_with_internal( "pyMoist.fortran.param_interfaces.microphysics.GFDL1M_interface", MAPL, IMPORT, EXPORT, INTERNAL )
else

call MAPL_GetPointer(INTERNAL, Q, 'Q' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(INTERNAL, QRAIN, 'QRAIN' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(INTERNAL, QSNOW, 'QSNOW' , RC=STATUS); VERIFY_(STATUS)
Expand Down Expand Up @@ -572,7 +581,7 @@ subroutine GFDL_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)
QRAIN = QRAIN + PTR3D*DT_MOIST
endif
call MAPL_GetPointer(EXPORT, PTR3D, 'SHLW_SNO3', ALLOC=.TRUE., RC=STATUS); VERIFY_(STATUS)
if (associated(PTR3D)) then
if (associated(PTR3D)) then
QSNOW = QSNOW + PTR3D*DT_MOIST
endif
! evap/subl/pdf
Expand Down Expand Up @@ -971,8 +980,31 @@ subroutine GFDL_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)
call MAPL_GetPointer(EXPORT, PTR3D, 'QGTOT', RC=STATUS); VERIFY_(STATUS)
if (associated(PTR3D)) PTR3D = QGRAUPEL

endif ! USE_PYMOIST_GFDL1M

call MAPL_TimerOff(MAPL,"--GFDL_1M",RC=STATUS)

end subroutine GFDL_1M_Run

subroutine GFDL_1M_Finalize(gc, import, export, rc)

type(ESMF_GridComp), intent(inout) :: GC ! Gridded component
type(ESMF_State), intent(inout) :: IMPORT ! Import state
type(ESMF_State), intent(inout) :: EXPORT ! Export state
integer, optional, intent( out) :: RC ! Error code

type (MAPL_MetaComp), pointer :: MAPL

! Get my internal MAPL_Generic state
!-----------------------------------
call MAPL_GetObjectFromGC ( GC, MAPL, RC=STATUS)
VERIFY_(STATUS)


if (USE_PYMOIST_GFDL1M) then
call MAPL_pybridge_gcfinalize( "pyMoist.fortran.param_interfaces.microphysics.GFDL1M_interface", MAPL, IMPORT, EXPORT )
endif

end subroutine GFDL_1M_Finalize

end module GEOS_GFDL_1M_InterfaceMod
Loading
Loading