-
Notifications
You must be signed in to change notification settings - Fork 181
WACCMX-MAGE 2-way coupling #1649
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: cam_development
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ module dpie_coupling | |
| use perf_mod, only: t_startf, t_stopf | ||
| use amie_module, only: getamie | ||
| use ltr_module, only: getltr | ||
| use mage_module, only: mage_advance | ||
| use edyn_solve, only: phihm | ||
| use edyn_params, only: dtr, rtd | ||
| use aurora_params, only: prescribed_period ! turns on overwrite of energy fields in aurora phys | ||
|
|
@@ -119,7 +120,7 @@ subroutine d_pie_init( edyn_active_in, oplus_xport_in, oplus_nsplit_in, crit_col | |
| end subroutine d_pie_init | ||
|
|
||
| !----------------------------------------------------------------------- | ||
| subroutine d_pie_epotent( highlat_potential_model, crit_out, cols, cole, efx_phys, kev_phys, amie_in, ltr_in ) | ||
| subroutine d_pie_epotent( highlat_potential_model, crit_out, cols, cole, efx_phys, kev_phys, amie_in, ltr_in, mage_in ) | ||
| use edyn_solve, only: pfrac ! NH fraction of potential (nmlonp1,nmlat0) | ||
| use time_manager, only: get_curr_date | ||
| use heelis, only: heelis_model | ||
|
|
@@ -142,6 +143,7 @@ subroutine d_pie_epotent( highlat_potential_model, crit_out, cols, cole, efx_phy | |
| integer, optional, intent(in) :: cols, cole | ||
| logical, optional,intent(in) :: amie_in | ||
| logical, optional,intent(in) :: ltr_in | ||
| logical, optional,intent(in) :: mage_in | ||
|
|
||
| ! Prescribed energy flux | ||
| real(r8), optional, intent(out) :: efx_phys(:) | ||
|
|
@@ -151,7 +153,7 @@ subroutine d_pie_epotent( highlat_potential_model, crit_out, cols, cole, efx_phy | |
| ! | ||
| ! local vars | ||
| ! | ||
| logical :: amie_inputs, ltr_inputs | ||
| logical :: amie_inputs, ltr_inputs, mage_inputs | ||
|
|
||
| real(r8) :: secs ! time of day in seconds | ||
| integer :: iyear,imo,iday,tod ! tod is time-of-day in seconds | ||
|
|
@@ -202,10 +204,12 @@ subroutine d_pie_epotent( highlat_potential_model, crit_out, cols, cole, efx_phy | |
|
|
||
| amie_inputs=.false. | ||
| ltr_inputs=.false. | ||
| 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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be |
||
|
|
||
| prescribed_inputs: if (amie_inputs .or. ltr_inputs) then | ||
| prescribed_inputs: if (amie_inputs .or. ltr_inputs .or. mage_inputs) then | ||
|
|
||
| if (.not. (present(kev_phys).and.present(efx_phys)) ) then | ||
| call endrun('d_pie_epotent: kev_phys and efx_phys must be present') | ||
|
|
@@ -224,6 +228,14 @@ subroutine d_pie_epotent( highlat_potential_model, crit_out, cols, cole, efx_phy | |
| write(iulog,"('After Calling getamie >>> iamie = ', i2)") iamie | ||
| end if | ||
| prescribed_period = iamie == 1 | ||
| else if (mage_inputs) then | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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? |
||
| if (masterproc) then | ||
| write(iulog,*) 'Calling mage_advance >>> ' | ||
| end if | ||
|
|
||
| call mage_advance( iyear, imo, iday, tod, & | ||
| prescr_phihm, prescr_efxm, prescr_kevm ) | ||
| prescribed_period = .TRUE. | ||
| else | ||
| if (masterproc) then | ||
| write(iulog,*) 'Calling getltr >>> ' | ||
|
|
||
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.
Is MAGE a welknown acronym, or should the namelist description give a little more information?