-
Notifications
You must be signed in to change notification settings - Fork 24
refactor co2 fossil fue and aircraft emissions to leverage CDEPS online functionality #244
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
base: noresm_develop
Are you sure you want to change the base?
refactor co2 fossil fue and aircraft emissions to leverage CDEPS online functionality #244
Conversation
|
@mvertens, this command doesn't work |
|
@mvertens Thank you Mariana! I will run a N1850 compset with 2xSSP534 CO2 flux data to see if we can track down the (potential) CO2 conservation issue in CAM |
gold2718
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have most of co2_cycle.F90 and nudging.F90 to review but here are some items I think should be changed.
src/cpl/nuopc/atm_shr.F90
Outdated
| public | ||
|
|
||
| type(ESMF_Mesh) :: model_mesh ! model mesh | ||
| type(ESMF_Clock) :: model_clock ! model clock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be private with protected variables initialized by a subroutine:
| public | |
| type(ESMF_Mesh) :: model_mesh ! model mesh | |
| type(ESMF_Clock) :: model_clock ! model clock | |
| private | |
| type(ESMF_Mesh), public, protected :: model_mesh ! model mesh | |
| type(ESMF_Clock), public, protected :: model_clock ! model clock | |
| public :: initialize_model_clock | |
| public :: initialize_model_mesh | |
| logical :: model_clock_initialized = .false. | |
| logical :: model_mesh_initialized = .false. | |
| contains | |
| subroutine initialize_model_clock(mclock) | |
| use shr_sys_mod, only: shr_sys_abort | |
| type(ESMF_Clock), intent(in) :: mclock | |
| if (model_clock_initialized) then | |
| call shr_sys_abort('initialize_model_clock: model clock already initialized') | |
| else | |
| model_clock = mclock | |
| model_clock_initialized = .true. | |
| end if | |
| end subroutine initialize_model_clock | |
| subroutine initialize_model_mesh(mmesh) | |
| use shr_sys_mod, only: shr_sys_abort | |
| type(ESMF_Mesh), intent(in) :: mmesh | |
| if (model_mesh_initialized) then | |
| call shr_sys_abort('initialize_model_mesh: model mesh already initialized') | |
| else | |
| model_mesh = mmesh | |
| model_mesh_initialized = .true. | |
| end if | |
| end subroutine initialize_model_mesh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/cpl/nuopc/atm_comp_nuopc.F90
Outdated
| ! Create model_clock as a variable in atm_shr.F90 - needed for generating streams | ||
| model_clock = ESMF_ClockCreate(clock, rc=rc) | ||
| if (ChkErr(rc,__LINE__,u_FILE_u)) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some or all of this should move into atm_shr.F90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/physics/cam/co2_cycle.F90
Outdated
| character(len=cs) :: co2flux_ocn_tintalgo = 'linear' ! time interpolation [lower, upper, nearest, linear or coszen] | ||
| character(len=cs) :: co2flux_ocn_taxmode = 'extend' ! time extraploation [cycle, extend or limit] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that these should also be initialized to invalid values. This would have caught the missing namelist variables.
| character(len=cs) :: co2flux_ocn_tintalgo = 'linear' ! time interpolation [lower, upper, nearest, linear or coszen] | |
| character(len=cs) :: co2flux_ocn_taxmode = 'extend' ! time extraploation [cycle, extend or limit] | |
| character(len=cs) :: co2flux_ocn_tintalgo = 'NOTSET' ! time interpolation [lower, upper, nearest, linear or coszen] | |
| character(len=cs) :: co2flux_ocn_taxmode = 'NOTSET' ! time extraploation [cycle, extend or limit] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/physics/cam/co2_cycle.F90
Outdated
| character(len=cs) :: co2flux_fuel_tintalgo = 'linear' ! time interpolation [lower, upper, nearest, linear or coszen] | ||
| character(len=cs) :: co2flux_fuel_taxmode = 'extend' ! time extraploation [cycle, extend or limit] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that these should also be initialized to invalid values. This would have caught the missing namelist variables.
| character(len=cs) :: co2flux_fuel_tintalgo = 'linear' ! time interpolation [lower, upper, nearest, linear or coszen] | |
| character(len=cs) :: co2flux_fuel_taxmode = 'extend' ! time extraploation [cycle, extend or limit] | |
| character(len=cs) :: co2flux_fuel_tintalgo = 'NOTSET' ! time interpolation [lower, upper, nearest, linear or coszen] | |
| character(len=cs) :: co2flux_fuel_taxmode = 'NOTSET' ! time extraploation [cycle, extend or limit] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
…r.F90 for model_mesh and model_clock
…ised in the PR review
5d1d8c5 to
089444c
Compare
|
@gold2718 - I have removed nudging capability as part of this PR. I have also removed co2_readFlux_ocn from CAM as part of this PR. I think all of the comments above that refer to either of these changes are addressed as part of this removal. |
|
@gold2718 - what tests do you want me to run? |
|
@gold2718 - I think this is now ready for another review. |
Summary: Enable fossil fuel and aircraft co2 forcing that are currently on a 2 degree FV grid to be remapped online to the model grid and time interpolated to the model time using CDEPS in-line functionality. The grid mapping is currently hard-wired to be bilinear, but I am incorporating a new namelist to also easily enable first-order conservative.
Still to do:
@adagj @DirkOlivie @tjiputra - the following lists how you can get and use the new code (still in testing)
to get the current branch:
compset and resolution
user_nl_cam
co2flux_fuel_mesh, co2_flux_fuel_year_first, co2_flux_fuel_year_last, co2_flux_fuel_year_alignhttps://escomp.github.io/CDEPS/versions/master/html/index.html
https://escomp.github.io/CDEPS/versions/master/html/streams.html#data-model-stream-inline-api (this is the functionality used in co2_cycle.F90 and co2_data_flux.F90)
Reviewers: @gold2718
Changes made to build system: None
Changes made to the namelist: [ describe or write 'None' ]
Changes to the defaults for the boundary datasets: [ describe or write 'None' ]
Substantial timing or memory changes: [ describe or write 'None' ]
Validation: