WACCMX-MAGE 2-way coupling - #1649
Conversation
modified: bld/namelist_files/namelist_definition.xml modified: src/ionosphere/waccmx/dpie_coupling.F90 modified: src/ionosphere/waccmx/edynamo.F90 modified: src/ionosphere/waccmx/ionosphere_interface.F90 new file: src/ionosphere/waccmx/mage_module.F90
cacraigucar
left a comment
There was a problem hiding this comment.
I have not done a thorough review of mage_module.F90 as it feels like it is not ready for CAM. Should we be using ESMF instead of these MPI calls (with comments which do not instill confidence)?
A regression test for this needs to be added (or even better modify a WACCMX test to include testing it).
| @@ -0,0 +1,556 @@ | |||
| module mage_module | |||
| ! | |||
| ! Module used to exchange data back and forth with MAGE | |||
There was a problem hiding this comment.
Is there a DOI or other reference which describes what MAGE is?
|
|
||
| <entry id="ionos_epotential_mage" type="logical" category="waccmx" | ||
| group="ionosphere_nl" valid_values=""> | ||
| For 2-way coupling WACCM-X with MAGE magnetosphere |
There was a problem hiding this comment.
Is MAGE a welknown acronym, or should the namelist description give a little more information?
| mage_inputs=.false. | ||
| if (present(amie_in)) amie_inputs=amie_in | ||
| if (present(ltr_in)) ltr_inputs= ltr_in | ||
| if (present(ltr_in)) mage_inputs= mage_in |
There was a problem hiding this comment.
Should this be if (present(mage_in))?
| write(iulog,"('After Calling getamie >>> iamie = ', i2)") iamie | ||
| end if | ||
| prescribed_period = iamie == 1 | ||
| else if (mage_inputs) then |
There was a problem hiding this comment.
This logic indicates that only one of amie_inputs or mage_inputs is used. Should there be a check during namelist setting to exit with an error if both are set to true?
| call addfld ('Early_AZIGM2', horiz_only, 'I', ' ','EDYN_ZIGM2' ,gridname='gmag_grid') | ||
| call addfld ('Early_AZIGM1', horiz_only, 'I', ' ','EDYN_ZIGM2' ,gridname='gmag_grid') |
There was a problem hiding this comment.
Both of these have EDYN_ZIGM2. Is this correct?
| ! This Bcast is causing a lot of issues. I don't know if this is needed or | ||
| ! if it will cause problems for voltron and other models. The behavior here is odd. |
There was a problem hiding this comment.
Another comment which does not instill confidence in this module
| !if (avar2d(j,i,2) .ne. avar2d(j,i,2)) write(*,*) "AVAR2?? ",avar2d(j,i,2),j,i | ||
| !if (avar2d(j,i,3) .ne. avar2d(j,i,3)) write(*,*) "AVAR3?? ",avar2d(j,i,3),j,i | ||
| !if (avar2d(j,i,2) .lt. 0) write(*,*) "AVAR4?? ",avar2d(j,i,2),j,i | ||
| !if (avar2d(j,i,3) .lt. 0) write(*,*) "AVAR5?? ",avar2d(j,i,3),j,i |
| if (nmixinapex .ne. 0) then | ||
| call MPI_BCAST(avar2d, nmlat*nmlonp1*nmixinapex, MPI_DOUBLE_PRECISION, mixCplRank, CplComm, ierr) | ||
| if (ierr == MPI_ERROR) then | ||
| write(6,"('>>> Error from MPI_BCAST: ierr=',i4)") ierr |
There was a problem hiding this comment.
All writes should use iulog
| ! Prepare the export data | ||
| hidra_prep = .false. | ||
| nreq = 0 | ||
| !if (mytid == 0) write(iulog,*) "W Starting Export Prep" |
There was a problem hiding this comment.
Delete all commened out code throughout this module
| integer, parameter :: &! For MPI-based coupling tag | ||
| myAppId = 67, &! waccmxID | ||
| voltId = 116, &! voltronID | ||
| gamId = 45, &! gameraID | ||
| rcmId = 34, &! rcmID | ||
| mageId = 26, &! mageID | ||
| hidraId = 40, &! hidraID | ||
| hidraNId = 54, &! hidraNID | ||
| hidraSId = 59, &! hidraSID | ||
| tiegcmId = 57 ! tiegcmID |
There was a problem hiding this comment.
I am not a MPI expert, but this feels clunky (assigning IDs to set numbers)
This enables 2-way coupling between WACCM-X and MAGE magnetosphere model.
Closes #1647