-
Notifications
You must be signed in to change notification settings - Fork 25
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
Feature iHAMOCC nml #261
Feature iHAMOCC nml #261
Conversation
…ine for parameters that depend on tuning parameters
hamocc/mo_parambgc_ini.F90
Outdated
#endif | ||
|
||
implicit none | ||
|
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.
A thought from my side: Having the variables that qualify as "parameters" defined in the module header of this module would simplify things a lot. Those variables that are truly "parameters" could be defined as such and assigned a value (that isn't changed), e.g.
integer, parameter :: rcar =122
Parameters that can be modified via namelist could be assigned a default value, e.g.
real, save :: atm_co2 = 284.32
Then the problem of having to recalculate things after reading of the namelist would be obsolete, and the module would be much simpler (plus it would be much more transparent to the user - the fact that all parameter definition are scattered between different modules now isn't very nice in my opinion.
Of course this is more invasive and much more work (a lot of use statements would need to be changed).
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.
Hi @JorgSchwinger , seeing the upcoming pull request in #264 (and potentially my nitrogen cycle), I currently would opt for a step-wise approach, so first introducing this less invasive step, and after pulling in Marianas changes doing a second step and following your suggestion, potentially even go the step with the protect
statement, what @TomasTorsvik suggested. Let's discuss this in person.
hamocc/mo_parambgc_ini.F90
Outdated
ENDDO | ||
ENDDO | ||
end subroutine | ||
|
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 3 subroutines above could be simplified and combined into one routine if we would follow the idea of defining all parameters inside this module (as opposed to importing them)
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.
Hi @JorgSchwinger , I -partially- agree - the calculation and field initialization need to be carried out after reading the namelist, while the initial default initialization could be done before.
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 would leave it for now and re-think about it, once introducing the protect
statements after #264 was coming in.
hamocc/mo_parambgc_ini.F90
Outdated
integer :: iounit | ||
|
||
namelist /bgcparams/ bkphy,dyphy,bluefix,bkzoo,grazra,spemor,gammap,gammaz,ecan,zinges,epsher,bkopal,rcalc,ropal, & | ||
& remido,drempoc,dremopal,dremn2o,dremsul,fetune,relaxfe,wpoc,wcal,wopal |
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.
wpoc
would only be used directly if the old HAMOCC sinking (constant wpoc) is used. Shouldn't we rather include wmin/wmax/wlin of the WLIN scheme as tuning parameters? (I would even be tempted to remove the constant sinking completely from HAMOCC, since this produces crap results)
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 am totally happy to extend the parameter list of the namelist. So far, I saw the new namelist as extendable and only for relevant parameters.
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. I left the constant sinking, though - can be discussed afterward in an extra PR.
hamocc/mo_parambgc_ini.F90
Outdated
! | ||
perc_diron = fetune * 0.035 * 0.01 / 55.85 | ||
|
||
end subroutine |
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.
If this remains the only parameter to adjust, I think it is better to just have this line in the main routine instead of making a separate subroutine.
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 am not sure, if I understand, what you consider the main routine here. I guess, my intention was to provide a structure , which one can follow.
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.
Looks fine for me
To briefly summarize the conversation on this PR: To avoid too many merging conflicts, the potential restructuring wrt |
Hi @TomasTorsvik and @JorgSchwinger , I tested the branch against the current How to use the new feature (thus far, tested): I will perform the pull once the |
! NAMELIST BGCPARAMS FOR iHAMOCC-BGC PARAMETERS (DEVELOPERS ONLY) | ||
! | ||
! CONTENTS: EMPTY BY DEFAULT | ||
! FOR ADJUSTABLE PARAMETERS, SEE CODE |
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.
Once we have settled on a set of parameters, it would be good to list those here
hamocc/hamocc_init.F90
Outdated
@@ -48,6 +48,7 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc) | |||
& dtb,dtbgc,io_stdo_bgc,ldtbgc, & | |||
& ldtrunbgc,ndtdaybgc,with_dmsph,l_3Dvarsedpor | |||
use mo_param1_bgc, only: ks,init_por2octra_mapping | |||
use mo_parambgc_ini,only: ini_parambgc |
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.
Since we plan to have all parameters defined within the module (in the longer run), the name mo_parambgc_ini
is not really the best, in my opinion. mo_param_bgc
would be better (but that is too close to mo_param1_bgc
?). Not sure what to do about it.
hamocc/mo_parambgc_ini.F90
Outdated
! factor for normalizing 14C tracers (~1e-12) | ||
c14fac = atm_c14/atm_co2 | ||
#endif | ||
end subroutine |
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.
A matter of personal taste, but I would prefer to have not too many small subroutines. I would place the calculations done here in other routines: The 3 first lines could go into ini_param_atm
and the rest into ini_fields_atm
(d13C_atm
is only used to print out the value, so it could go into write_parambgc
)
hamocc/mo_parambgc_ini.F90
Outdated
call readjust_param() ! potentially readjust namlist parameter-dependent parameters | ||
call rates_2_timestep() ! Converting rates from /d... to /dtb | ||
|
||
call write_parambgc() ! write out used parameters and calculate back rates from /dtb to /d.. |
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.
Wouldn't it make more sense to write out the parameter BEFORE multiplying by dtb
? If I want to check the settings of parameters in the log file, I relate much more to the value that I have set via namelist than the value multiplied by dtb
.
To briefly summarize (incl. the short-conversation today), before merging:
|
Hi @TomasTorsvik and @JorgSchwinger , I create this draft pull request to follow up on and move the discussion #195 based on the current changes I did for the BGC parameter nml. I restructured the parameter initialization a bit related to the different topics of the parameters.
I currently see a few related questions:
atm_co2
is still located? - this would enable to recombine the further calculation of dependent concentrations (isotopes) and initializing the atmosphere fields.Thus far, I didn't move any of the parameter declarations to get the parameter values under the
protect
statement. I can do this, if you want me to do it. Just let me know.