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

Set levels with cloud from parent model #17

Merged
merged 5 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ This file documents all notable changes to the Cloud-J repository since the init

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [7.7.2] - TBD
### Changed
- Changed hard-coding LWEPAR in cldj_cmn_mod to be passed from parent model unless using standalone

### Added
- Added CLOUDJ_STANDALONE c-proprocessor switch to generalize code to use instead within a parent model

## [7.7.1] - 2024-04-02
### Changed
- Changed arguments of Init_Cldj to include root thread logical and LUT data directory
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ if(NOT CLOUDJ_EXTERNAL_CONFIG)

# Set Cloud-J compile flag to standalone
target_compile_definitions(CloudJBuildProperties
INTERFACE "CloudJ_Standalone"
INTERFACE CLOUDJ_STANDALONE
)

# Set CMAKE_BUILD_TYPE to Release by default
Expand Down
27 changes: 13 additions & 14 deletions src/Core/cldj_cmn_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@ MODULE CLDJ_CMN_MOD

! Can be changed as needed. Must be exact atmospheric dimensions.

#ifdef MODEL_GEOSCHEM
integer :: L_ ! # of CTM layers, set at run-time
integer :: L1_ ! L_+1 = # of CTM layer edges (radii)
integer :: L2_ ! L_+2 = total # of layer edges counting top (TAU=0)
#ifdef CLOUDJ_STANDALONE
integer, parameter :: L_ = 57 ! # of CTM layers, set at build-time
integer, parameter :: L1_ = L_+1 ! L_+1 = # of CTM layer edges (radii)
integer, parameter :: L2_ = L_+2 ! L_+2 = total # of layer edges counting top (TAU=0)#
integer, parameter :: LWEPAR = 34 ! # layers that have clouds (LWEPAR < L_)
#else
integer, parameter :: L_ = 57 ! # of CTM layers, set at build-time
integer, parameter :: L1_ = L_+1 ! L_+1 = # of CTM layer edges (radii)
integer, parameter :: L2_ = L_+2 ! L_+2 = total # of layer edges counting top (TAU=0)
integer :: L_ ! # of CTM layers, set at run-time
integer :: L1_ ! L_+1 = # of CTM layer edges (radii)
integer :: L2_ ! L_+2 = total # of layer edges counting top (TAU=0)
integer :: LWEPAR ! # layers that have clouds (LWEPAR < L_)
#endif

! # layers that have clouds (LWEPAR < L_)
integer, parameter :: LWEPAR = 34

!------------------------------------------------------------------------------
! Additional parameters
!------------------------------------------------------------------------------
Expand All @@ -46,14 +45,14 @@ MODULE CLDJ_CMN_MOD
! JVN_ : max # of J-values
#ifdef MODEL_GEOSCHEM
integer, parameter :: JVN_ = 166
#else
#elif CLOUDJ_STANDALONE
integer, parameter :: JVN_ = 101
#endif

! mAN_ : max # FJX aerosols in layer (needs NDX for each)
#ifdef MODEL_GEOSCHEM
integer, parameter :: AN_=37
#else
#elif CLOUDJ_STANDALONE
lizziel marked this conversation as resolved.
Show resolved Hide resolved
integer, parameter :: AN_=25
#endif

Expand Down Expand Up @@ -94,15 +93,15 @@ MODULE CLDJ_CMN_MOD
! X_ = dim = max no. of X-section data sets (input data)
#ifdef MODEL_GEOSCHEM
integer, parameter :: X_=123
#else
#elif CLOUDJ_STANDALONE
integer, parameter :: X_=72
#endif

! A_ = dim = max no. of Aerosol Mie sets (input data) not including
! clouds and SSA
#ifdef MODEL_GEOSCHEM
integer, parameter :: A_=56
#else
#elif CLOUDJ_STANDALONE
integer, parameter :: A_=40
#endif

Expand Down
7 changes: 5 additions & 2 deletions src/Core/cldj_init_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ MODULE CLDJ_INIT_MOD
CONTAINS

!-----------------------------------------------------------------------
subroutine INIT_CLDJ (AMIROOT,DATADIR,NLEVELS,TITLEJXX,NJXU,NJXX)
subroutine INIT_CLDJ (AMIROOT,DATADIR,NLEVELS,NLEVELS_WITH_CLOUD, &
TITLEJXX,NJXU,NJXX)
!-----------------------------------------------------------------------
implicit none

logical, intent(in) :: AMIROOT
character(LEN=*), intent(in) :: DATADIR
integer, intent(in) :: NLEVELS
integer, intent(in) :: NLEVELS_WITH_CLOUD
integer, intent(in) :: NJXU
integer, intent(out) :: NJXX
character*6, intent(out), dimension(NJXU) :: TITLEJXX
Expand All @@ -44,11 +46,12 @@ subroutine INIT_CLDJ (AMIROOT,DATADIR,NLEVELS,TITLEJXX,NJXU,NJXX)

if (AMIROOT) write(6,*) ' Solar/Cloud-J ver-7.7 initialization'

#if defined ( MODEL_GEOSCHEM )
#ifndef CLOUDJ_STANDALONE )
lizziel marked this conversation as resolved.
Show resolved Hide resolved
! Set cldj_cmn_mod variables based on input numbers of levels
L_ = NLEVELS
L1_ = L_ + 1
L2_ = L_ + 2
LWEPAR= NLEVELS_WITH_CLOUD
#endif

JVL_ = L_
Expand Down
2 changes: 1 addition & 1 deletion src/Interfaces/Standalone/CJ77.F90
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ program standalone
amIRoot = .true.
!---read in & store all fast-JX data: single call at set up
!-----------------------------------------------------------------------
call INIT_CLDJ (amIRoot,'./tables/',NLEVELS,TITLJXX,JVNU,NJXX)
call INIT_CLDJ (amIRoot,'./tables/',NLEVELS,LWEPAR,TITLJXX,JVNU,NJXX)
!-----------------------------------------------------------------------

!--P, T, Cld & Aersl profiles, simple test input case
Expand Down