@@ -5,7 +5,7 @@ module mo_aurora
55! Auroral oval parameterization. See reference:
66! R.G. Roble, E.C. Ridley
77! An auroral model for the NCAR thermospheric general circulation model (TGCM)
8- ! Annales Geophysicae,5A, (6), 369-382, 1987.
8+ ! Annales Geophysicae,5A, (6), 369-382, 1987.
99!
1010! The aurora oval is a circle in auroral circle coordinates. Auroral circle
1111! coordinates are offset from magnetic coordinates by offa degrees (radians)
@@ -46,7 +46,7 @@ module mo_aurora
4646! 1) sub aurora_cons called once per time step from advance.
4747! 2) sub aurora called from dynamics, inside parallel latitude scan.
4848! 3) subs aurora_cusp and aurora_heat called from sub aurora.
49- ! 4) sub aurora_ions called from sub aurora.
49+ ! 4) sub aurora_ions called from sub aurora.
5050!
5151!- ----------------------------------------------------------------------
5252
@@ -71,7 +71,7 @@ module mo_aurora
7171 private
7272 public :: aurora_inti, aurora_timestep_init, aurora
7373 public :: aurora_register
74-
74+
7575 integer , parameter :: isouth = 1
7676 integer , parameter :: inorth = 2
7777
@@ -143,7 +143,6 @@ module mo_aurora
143143
144144 contains
145145
146-
147146 !- ---------------------------------------------------------------------
148147 !- ---------------------------------------------------------------------
149148 subroutine aurora_register
@@ -197,9 +196,14 @@ subroutine aurora_inti(pbuf2d)
197196 call pbuf_set_field(pbuf2d, indxKev, x_nan)
198197 endif
199198
199+ ! initialize these fields to zero here since some chunks of colunms not near
200+ ! the poles will not get set to real values
200201 if (indxAIPRS> 0 ) then
201202 call pbuf_set_field(pbuf2d, indxAIPRS, 0._r8 )
202203 endif
204+ if (indxQTe> 0 ) then
205+ call pbuf_set_field(pbuf2d, indxQTe, 0._r8 )
206+ endif
203207
204208 theta0(:) = nan
205209 offa(:) = nan
@@ -347,9 +351,9 @@ subroutine aurora_timestep_init( )
347351!- ----------------------------------------------------------------------
348352
349353 rh = (h2 - h1) / (h1 + h2)
350- h0 = 0.5_r8 * (h1 + h2) * d2r
351-
352-
354+ h0 = 0.5_r8 * (h1 + h2) * d2r
355+
356+
353357! roth = MLT of max width of aurora in hours
354358! rote = MLT of max energy flux of aurora in hours
355359
@@ -459,7 +463,6 @@ subroutine aurora_prod( tn, o2, o1, mbar, rlats, &
459463 logical :: do_aurora(ncol)
460464
461465 real (r8 ) :: dayfrac, rotation
462- real (r8 ), pointer :: qteaur(:) ! for electron temperature
463466
464467 if (.not. aurora_active) return
465468
@@ -479,11 +482,6 @@ subroutine aurora_prod( tn, o2, o1, mbar, rlats, &
479482 call outfld( ' ALONM' , r2d* alonm(:ncol,lchnk), ncol, lchnk )
480483 call outfld( ' ALATM' , r2d* alatm(:ncol,lchnk), ncol, lchnk )
481484
482- if (indxQTe> 0 ) then
483- call pbuf_get_field(pbuf, indxQTe, qteaur)
484- qteaur(:) = 0._r8
485- endif
486-
487485!- ----------------------------------------------------------------------
488486! aurora is active for columns poleward of 30 deg
489487!- ----------------------------------------------------------------------
@@ -501,7 +499,7 @@ subroutine aurora_prod( tn, o2, o1, mbar, rlats, &
501499 do i = 1 ,ncol
502500 if ( do_aurora(i) ) then
503501 dlat_aur(i) = alatm(i,lchnk)
504- dlon_aur(i) = alonm(i,lchnk) + rotation ! rotate it
502+ dlon_aur(i) = alonm(i,lchnk) + rotation ! rotate it
505503 if ( dlon_aur(i) > pi ) then
506504 dlon_aur(i) = dlon_aur(i) - twopi
507505 else if ( dlon_aur(i) < - pi ) then
@@ -659,7 +657,7 @@ subroutine aurora_hrate( tn, mbar, rlats, &
659657 do i = 1 ,ncol
660658 if ( do_aurora(i) ) then
661659 dlat_aur(i) = alatm(i,lchnk)
662- dlon_aur(i) = alonm(i,lchnk) + rotation ! rotate it
660+ dlon_aur(i) = alonm(i,lchnk) + rotation ! rotate it
663661 if ( dlon_aur(i) > pi ) then
664662 dlon_aur(i) = dlon_aur(i) - twopi
665663 else if ( dlon_aur(i) < - pi ) then
@@ -714,7 +712,7 @@ subroutine aurora_hrate( tn, mbar, rlats, &
714712 call aurora_heat( flux, flux2, alfa, alfa2, &
715713 drizl, do_aurora, hemis, &
716714 alon, colat, ncol, pbuf )
717-
715+
718716!- ----------------------------------------------------------------------
719717! ... auroral additions to ionization rates
720718!- ----------------------------------------------------------------------
@@ -763,7 +761,7 @@ subroutine aurora_cusp( cusp, do_aurora, hemis, colat, alon, ncol )
763761 cusp(:) = 0._r8
764762 endwhere
765763
766- end subroutine aurora_cusp
764+ end subroutine aurora_cusp
767765
768766 subroutine aurora_heat ( flux , flux2 , alfa , alfa2 , &
769767 drizl , do_aurora , hemis , &
@@ -772,7 +770,7 @@ subroutine aurora_heat( flux, flux2, alfa, alfa2, &
772770! ... calculate alfa, flux, and drizzle
773771!- ----------------------------------------------------------------------
774772 use physics_buffer,only: physics_buffer_desc,pbuf_get_field
775-
773+
776774 implicit none
777775
778776!- ----------------------------------------------------------------------
@@ -798,12 +796,12 @@ subroutine aurora_heat( flux, flux2, alfa, alfa2, &
798796 halfwidth, & ! oval half-width
799797 wrk, & ! temp wrk array
800798 dtheta ! latitudinal variation (Gaussian)
801- real (r8 ) :: ekev
799+ real (r8 ) :: ekev
802800 real (r8 ), pointer :: pr_efx(:) ! Pointer to pbuf prescribed energy flux (mW m-2)
803801 real (r8 ), pointer :: pr_kev(:) ! Pointer to pbuf prescribed mean energy (keV)
804802 real (r8 ), pointer :: qteaur(:) ! for electron temperature
805803 integer :: n
806-
804+
807805!- ----------------------------------------------------------------------
808806! Low-energy protons:
809807!
@@ -850,7 +848,7 @@ subroutine aurora_heat( flux, flux2, alfa, alfa2, &
850848 endwhere
851849
852850!- ----------------------------------------------------------------------
853- ! ... for electron temperature (used in settei):
851+ ! ... for electron temperature (used in settei):
854852!- ----------------------------------------------------------------------
855853 if (indxQTe> 0 ) then
856854 call pbuf_get_field(pbuf, indxQTe, qteaur)
@@ -954,14 +952,14 @@ subroutine aurora_ions( drizl, cusp, alfa1, alfa2, &
954952 real (r8 ) :: wrk(ncol,pver)
955953
956954 real (r8 ), pointer :: aurIPRateSum(:,:) ! Pointer to pbuf auroral ion production sum for O2+,O+,N2+ (s-1 cm-3)
957-
955+
958956 qia(:) = 0._r8
959957 wrk(:,:) = 0._r8
960958
961959 !- ----------------------------------------------------------
962- ! Point to production rates array in physics buffer where
963- ! rates will be stored for ionosphere module access. Also,
964- ! initialize rates to zero before column loop since only
960+ ! Point to production rates array in physics buffer where
961+ ! rates will be stored for ionosphere module access. Also,
962+ ! initialize rates to zero before column loop since only
965963 ! daylight values are filled
966964 !- ----------------------------------------------------------
967965 if (indxAIPRS> 0 ) then
@@ -1041,15 +1039,15 @@ subroutine aurora_ions( drizl, cusp, alfa1, alfa2, &
10411039 end do level_loop
10421040
10431041 !- ---------------------------------------------------------------
1044- ! Store the sum of the ion production rates in pbuf to be used
1045- ! in the ionosx module
1042+ ! Store the sum of the ion production rates in pbuf to be used
1043+ ! in the ionosx module
10461044 !- ---------------------------------------------------------------
10471045 if (indxAIPRS> 0 ) then
1048-
1049- aurIPRateSum(1 :ncol,1 :pver) = wrk(1 :ncol,1 :pver)
1050-
1046+
1047+ aurIPRateSum(1 :ncol,1 :pver) = wrk(1 :ncol,1 :pver)
1048+
10511049 endif
1052-
1050+
10531051 call outfld( ' QSUM' , wrk, ncol, lchnk )
10541052
10551053 end subroutine aurora_ions
@@ -1165,9 +1163,9 @@ subroutine aion( si, so, do_aurora, ncol )
11651163!- ----------------------------------------------------------------------
11661164! Calculates integrated f(x) needed for total auroral ionization.
11671165! See equations (10-12) in Roble,1987.
1168- ! Coefficients for equation (12) of Roble,1987 are in variable cc
1166+ ! Coefficients for equation (12) of Roble,1987 are in variable cc
11691167! (revised since 1987):
1170- ! Uses the identity x**y = exp(y*ln(x)) for performance
1168+ ! Uses the identity x**y = exp(y*ln(x)) for performance
11711169! (fewer (1/2) trancendental functions are required).
11721170!- -----------------------------------------------------------------------
11731171
0 commit comments