Skip to content

Conversation

@fvitt
Copy link
Collaborator

@fvitt fvitt commented May 26, 2021

Misc bug fixes for WACCMX:

fixes #363
fixes #376
fixes #377
fixes #379

fvitt added 5 commits May 25, 2021 14:20
        modified:   Externals.cfg
        modified:   cime_config/testdefs/testlist_cam.xml
        new file:   cime_config/testdefs/testmods_dirs/cam/outfrq3s_edyngrid_160x193/shell_commands
        new file:   cime_config/testdefs/testmods_dirs/cam/outfrq3s_edyngrid_160x193/user_nl_cam
        new file:   cime_config/testdefs/testmods_dirs/cam/outfrq3s_edyngrid_160x193/user_nl_clm
        new file:   cime_config/testdefs/testmods_dirs/cam/outfrq3s_edyngrid_320x385/shell_commands
        new file:   cime_config/testdefs/testmods_dirs/cam/outfrq3s_edyngrid_320x385/user_nl_cam
        new file:   cime_config/testdefs/testmods_dirs/cam/outfrq3s_edyngrid_320x385/user_nl_clm
        modified:   src/ionosphere/waccmx/edyn_mudcom.F90
        modified:   src/ionosphere/waccmx/edyn_solve.F90
        modified:   bld/namelist_files/namelist_defaults_cam.xml
        modified:   src/dynamics/se/dyn_comp.F90
        modified:   src/utils/physconst.F90
…g xlrg restart files

        modified:   src/physics/cam/physpkg.F90
        modified:   src/physics/cam/waccmx_phys_intr.F90
        modified:   src/physics/waccmx/ion_electron_temp.F90
        modified:   src/utils/cam_map_utils.F90
@fvitt fvitt added BFB bit for bit tag bug-fix This PR was created to fix a specific bug. labels May 26, 2021
@fvitt fvitt added this to the CESM2.3 milestone May 26, 2021
@fvitt fvitt self-assigned this May 26, 2021
@cacraigucar cacraigucar requested a review from peverwhee June 28, 2021 22:35
Copy link
Collaborator

@nusbaume nusbaume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Just a couple optional requests to change the log output, and one question related to possibly skipping a file read.

Comment on lines 295 to 296
if (masterproc) write(iulog,*) 'ion_electron_temp_inidat: Not able to read temperature from IC file.' &
//' Set TElec to NaN'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add to this message stating that both TElec and TIon will be set to phys_state%t, which I assume is the neutral temperature?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would make sense.

call infld( 'T',ncid_ini,dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, &
tI, found, gridname='physgrid')
endif
if (found) then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If initialized_TiTe is false (i.e. neither the election temperatures nor neutral temperatures were found above) , then should one even bother trying to read in the ion temperatures, given that they will be overwritten by ion_electron_temp_timestep_init anyways?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.

if (found) then
call pbuf_set_field(pbuf2d, index_ti, tI)
else
if (masterproc) write(iulog,*) 'ion_electron_temp_inidat: Not able to read temperature from IC file.' &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add to this message stating that both TElec and TIon will be set to phys_state%t, which I assume is the neutral temperature?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

Copy link
Collaborator

@gold2718 gold2718 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a couple of comments and questions but nothing that looks like it needs fixing (but please look at the question in election_ion_temp.F90).


!
fileSize = product(filelens)
fileSize = product( int(filelens,kind=iMap) )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh, nice catch!

water_species_in_air_num = 0
do i = 1, num_names_max
if (.not. LEN(TRIM(dry_air_species(i)))==0) then
if ((.not. LEN(TRIM(dry_air_species(i)))==0).and.(TRIM(dry_air_species(i))/='N2')) then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtruesdal, @PeterHjortLauritzen,
Have you had a chance to review the changes in this module?
Also, the logic could be cleaner (including use of the LEN_TRIM Fortran intrinsic:

Suggested change
if ((.not. LEN(TRIM(dry_air_species(i)))==0).and.(TRIM(dry_air_species(i))/='N2')) then
if ((LEN_TRIM(dry_air_species(i)) > 0) .and. (TRIM(dry_air_species(i)) /= 'N2')) then

There are other places in this module where LEN(TRIM(xx)) should be replaced with LEN_TRIM(xx).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I have reviewed the code and I am happy with it. @gold2718 Do you have ideas for a cleaner implementation?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PeterHjortLauritzen just checking if you took a look at the fvitt changes to physconst and approve them (PR #382)?

Comment on lines +208 to +209
call pbuf_set_field(phys_buffer_chunk,index_te,phys_state(lchnk)%t(:ncol,:),start=(/1,1/), kount=(/ncol,pver/))
call pbuf_set_field(phys_buffer_chunk,index_ti,phys_state(lchnk)%t(:ncol,:),start=(/1,1/), kount=(/ncol,pver/))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At line 278, the pbuf_set_field calls are within a if (index_te>0) then block. Why not here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

Copy link
Collaborator

@cacraigucar cacraigucar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When cam6_3_026 is tagged, please merge your code forward. At that point, I will verify that the cime version is okay and submit my approval. I've tentatively slated this PR for cam6_3_027.

@cacraigucar cacraigucar changed the title Bug fixes for WACCMX cam6_3_027?: Bug fixes for WACCMX Jul 13, 2021
@jtruesdal
Copy link
Collaborator

jtruesdal commented Jul 13, 2021 via email

Copy link
Collaborator

@PeterHjortLauritzen PeterHjortLauritzen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtruesdal yes I approve. Just had some clarifying questions

if (masterproc) then
write(iulog, *) "Dry air composition ",TRIM(dry_air_species(i)),&
icnst,thermodynamic_active_species_idx(icnst),&
icnst, -1,&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to write "icnst -1" to log file?

water_species_in_air_num = 0
do i = 1, num_names_max
if (.not. LEN(TRIM(dry_air_species(i)))==0) then
if ((.not. LEN(TRIM(dry_air_species(i)))==0).and.(TRIM(dry_air_species(i))/='N2')) then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I have reviewed the code and I am happy with it. @gold2718 Do you have ideas for a cleaner implementation?

@fvitt fvitt merged commit 14254c3 into ESCOMP:cam_development Jul 20, 2021
@cacraigucar cacraigucar changed the title cam6_3_027?: Bug fixes for WACCMX cam6_3_027: Bug fixes for WACCMX Jul 22, 2021
Copy link
Collaborator

@cacraigucar cacraigucar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post merge approval of Externals.cfg not being changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BFB bit for bit tag bug-fix This PR was created to fix a specific bug.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants