Line data Source code
1 : 2 : module mag_parms 3 : 4 : use shr_kind_mod, only : r8 => shr_kind_r8 5 : use solar_parms_data, only : wkp=>solar_parms_kp, wf107=>solar_parms_f107 6 : use cam_abortutils, only : endrun 7 : 8 : implicit none 9 : 10 : private 11 : public :: get_mag_parms 12 : 13 : contains 14 : 15 32256 : subroutine get_mag_parms( by, bz, hpower, ctpoten ) 16 : !--------------------------------------------------------------- 17 : ! ... retrieve magnetic field parmaters 18 : !--------------------------------------------------------------- 19 : 20 : implicit none 21 : 22 : !--------------------------------------------------------------- 23 : ! ... dummy arguments 24 : !--------------------------------------------------------------- 25 : real(r8), optional, intent(out) :: by 26 : real(r8), optional, intent(out) :: bz 27 : real(r8), optional, intent(out) :: hpower 28 : real(r8), optional, intent(out) :: ctpoten 29 : 30 32256 : if( present( by ) ) then 31 0 : by = 0._r8 32 : end if 33 32256 : if( present( bz ) ) then 34 : bz = .433726_r8 - wkp*(.0849999_r8*wkp + .0810363_r8) & 35 0 : + wf107*(.00793738_r8 - .00219316_r8*wkp) 36 : end if 37 : ! modified by LQIAN, 2008 38 : ! for wkp<=7: formula given by Zhang Yongliang based on TIMED/GUVI 39 : ! for wkp>7: power is 153.13 when wkp=7 from Zhang's formula, 40 : ! assume power is 300.(based on NOAA satellites) when wkp=9 41 : ! do linear interporation in between 42 32256 : if( present( hpower ) ) then 43 32256 : if (wkp <=7._r8) hpower = 16.82_r8*exp(0.32_r8*wkp)-4.86_r8 44 32256 : if (wkp > 7._r8) hpower = 153.13_r8+(wkp-7._r8)/ & 45 0 : (9._r8-7._r8)*(300._r8-153.13_r8) 46 : 47 : end if 48 : ! 49 : ! modified by LQIAN, 2008 50 : ! formula given by Wenbin based on data fitting 51 : ! 52 : ! 9/18/15 btf: If Weimer model was used for high-latitude potential, 53 : ! then use ctpoten that was returned by weimer (see sub weimer05 in 54 : ! wei05sc.F90, called by dpie_coupling.F90) 55 : ! 56 32256 : if( present( ctpoten ) ) then 57 32256 : ctpoten = 15._r8+15._r8*wkp + 0.8_r8*wkp**2 58 : end if 59 : 60 32256 : end subroutine get_mag_parms 61 : 62 : end module mag_parms