-
Notifications
You must be signed in to change notification settings - Fork 139
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
User/f1p/merge gex ddep #1637
base: main
Are you sure you want to change the base?
User/f1p/merge gex ddep #1637
Conversation
Examples: "atm_to_lnd_ex","coupler_mod","wetbc" units = kg/(m2 s) / "lnd_to_atm_ex","coupler_mod","test1" units = kg/m2/year /
@fabienpaulot Thanks for submitting these changes. I think we might need to change the module name to After that this will need some more changes to get the build systems working properly since a new module is being added. For cmake, it would just need the new Lines 114 to 116 in 15ec0c7
For autotools, you'll need to edit
Once you made the module name change. Let me know if need help/have any questions, hope this wasn't too confusing. |
Can I change generic_exchange.F90 to gex.F90 instead? This would make my
life much easier. Fabien
…On Mon, Jan 27, 2025 at 4:27 PM Ryan Mulhall ***@***.***> wrote:
@fabienpaulot <https://github.com/fabienpaulot> Thanks for submitting
these changes. I think we might need to change the module name to
generic_exchange_mod. For FMS we typically follow the <filename>_mod
naming scheme for any modules.
After that this will need some more changes to get the build systems
working properly since a new module is being added.
For cmake, it would just need the new coupler/generic_exchange.F90 file
path added to CMakeLists.txt, along with the other files from that
directory:
https://github.com/NOAA-GFDL/FMS/blob/15ec0c735cba2780d3da37f4e1e3b5d4a969b4ff/CMakeLists.txt#L114-L116
For autotools, you'll need to edit coupler/Makefile.am. The
libcoupler_la_SOURCES will need the new file name added as well, and then
MODFILES will need the compiled module output (ie. module <name> in the
file), which would be:
generic_exchange_mod.$(FC_MODEXT) \
Once you made the module name change.
Let me know if need help/have any questions, hope this wasn't too
confusing.
—
Reply to this email directly, view it on GitHub
<#1637 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKAQA45VKGSIVHLY6V3OHTT2M2QCDAVCNFSM6AAAAABV6IKIECVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJWHEZDSOJVGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yeah that works too! As long as it follows the convention it should be fine. |
@rem1776 I think I fixed the space/line length/CMake but it's still failing one check |
Looks like its just failing the autotools build from a file dependency. I think to fix it, you would have to make this change in the top level Needs to have |
…so the module dependency is satisfied per Ryan's recommendation
Ok I tried to make the changes that you requested (I am not sure I
completely understand....). Let me know if this works. Fabien
…On Mon, Feb 3, 2025 at 10:08 AM Ryan Mulhall ***@***.***> wrote:
@rem1776 <https://github.com/rem1776> I think I fixed the space/line
length/CMake but it's still failing one check
Looks like its just failing the autotools build from a file dependency. I
think to fix it, you would have to make this change in the top level
Makefile.am:
main...rem1776:FMS:pr1637
#diff-0462e381b2fb3286568215681c8983490a37ac9ae0f0c5ee304df7fa6426d4af
<main...rem1776:FMS:pr1637#diff-0462e381b2fb3286568215681c8983490a37ac9ae0f0c5ee304df7fa6426d4af>
Needs to have tracer_manager before coupler in the SUBDIRS list so the
module dependency is satisfied.
—
Reply to this email directly, view it on GitHub
<#1637 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKAQA43WS6DCPCFMW7W3C532N6A5BAVCNFSM6AAAAABV6IKIECVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZRGI3DSMBUGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
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.
- Please make sure that the doxygen style is followed for the module, module variables, subroutines, and subroutine variables. Please make sure documentation style is consistent with other modules in this repository (ie. remove the
!######
s that are around routine documentation.) An example can be found here https://github.com/NOAA-GFDL/FMS/blob/main/field_manager/fm_yaml.F90 - New modules and routines should be prefixed with
fms_coupler_gex_
. This is consistent with the modernized approach in FMS. The filename should be fms_coupler_gex.F90. - The public routines need to be added to libFMS.F90 and made public through that interface. That's how they should be accessed in the FMScoupler also (through
use FMS
) - The new file needs the LGPL licence header.
@@ -0,0 +1,220 @@ | |||
!>simple routine to pass non-tracer fields across components (regrid) | |||
|
|||
module gex_mod |
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.
The module should be named fms_coupler_gex_mod because it is a new module in FMS in the coupler subdirectory.
|
||
implicit none ; private | ||
|
||
public :: gex_init, gex_get_index,gex_get_n_ex, gex_get_property, gex_name, gex_units |
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.
All of these public routines should be prefixed with fms_coupler_
public :: fms_coupler_gex_init, fms_coupler_gex_get_index, fms_coupler_gex_get_n_ex, fms_coupler_gex_get_property, fms_coupler_gex_name, fms_coupler_gex_units
coupler/gex.F90
Outdated
@@ -0,0 +1,220 @@ | |||
!>simple routine to pass non-tracer fields across components (regrid) |
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.
The doxygen formatting should be updated to reflect that this is a module. Please refer to other modules in FMS to see a proper example.
Also, please add more detail to the documentation. What is gex an abbreviation for?
coupler/gex.F90
Outdated
character(3) :: module_name = 'gex' | ||
logical :: initialized = .FALSE. | ||
|
||
integer, parameter :: gex_name = 1 | ||
integer, parameter :: gex_units = 2 | ||
|
||
type gex_type | ||
character(fm_field_name_len):: name = '' | ||
character(fm_string_len) :: units = '' | ||
logical :: set = .FALSE. | ||
end type gex_type | ||
type gex_type_r | ||
type(gex_type), allocatable:: field(:) | ||
end type gex_type_r | ||
|
||
integer, allocatable :: n_gex(:,:) | ||
type(gex_type_r), allocatable :: gex_fields(:,:) |
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.
Every variable needs to be documented with the correct doxygen format.
if (mpp_pe()==mpp_root_pe()) then | ||
write(*,*) '' | ||
write(*,*) '####################################' | ||
write(*,*) '' | ||
end if |
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.
Why does this happen?
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.
my attempt to do pretty formatting. Feel free to edit/remove @thomas-robinson
character(len=*), intent(in) :: listroot ! name of the field manager list | ||
integer, intent(in) :: MODEL_SRC ! index of the model where the tracer comes FROM | ||
integer, intent(in) :: MODEL_REC ! index of the model where the tracer goes TO | ||
|
||
type(fm_list_iter_type) :: iter ! iterator over the list of tracers | ||
character(fm_field_name_len) :: name = '' ! name of the tracer | ||
character(fm_type_name_len) :: ftype ! type of the field table entry (not used) | ||
! character(fm_path_name_len) :: current_list ! storage for current location in the fiels manager tree | ||
character(fm_path_name_len) :: listname ! name of the field manager list for each tracer | ||
|
||
integer :: n |
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.
These variables all need doxygen style comments
integer, intent(in) :: MODEL_SRC, MODEL_REC | ||
integer gex_get_n_ex |
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.
document each variable with doxygen
integer, intent(in) :: MODEL_SRC, MODEL_REC,index | ||
integer :: property | ||
character(len=64) :: gex_get_property |
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.
please document each variable with doxygen style comments
integer, intent(in) :: MODEL_SRC, MODEL_REC | ||
logical, intent(in), optional :: record !record that this exchanged has been found and will be set | ||
|
||
integer :: i | ||
integer :: gex_get_index |
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.
please document each variable with doxygen style comments
coupler/gex.F90
Outdated
@@ -0,0 +1,220 @@ | |||
!>simple routine to pass non-tracer fields across components (regrid) |
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.
The license header is missing.
Description
Update to add
a) ability to pass deposition fluxes from the atmosphere to the land (gex)
b) sink of gas/aerosol on land handled by LM4 [increase number of exchanged tracer]
Fixes # (issue)
n/a
How Has This Been Tested?
Tested on gaea (ESM4p5)
Checklist:
make distcheck
passes