Skip to content

Commit

Permalink
Coszen made not optional in Dudhia shortwave scheme (#1675)
Browse files Browse the repository at this point in the history
TYPE: bug fix
KEYWORDS: shortwave option 1, coszen not optional

SOURCE: internal, reported by CWB, Taiwan

DESCRIPTION OF CHANGES:
Problem:
Compiler picked up use of uninitialized eot. This was in the case of no coszen passed in which does not happen in ARW.

Solution:
coszen is no longer optional and branch for no coszen input is removed.

LIST OF MODIFIED FILES:
M phys/module_ra_sw.F

TESTS CONDUCTED:
Jenkins tests have passed.
  • Loading branch information
dudhia authored Mar 15, 2022
1 parent 4e9fcb6 commit 179fd33
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions phys/module_ra_sw.F
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ SUBROUTINE SWRAD(dt,RTHRATEN,GSW,XLAT,XLONG,ALBEDO, &
INTEGER, INTENT(IN ) :: JULDAY

! --- jararias 14/08/2013
REAL, DIMENSION( ims:ime, jms:jme ), OPTIONAL, INTENT(IN) :: COSZEN
REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: COSZEN
REAL, OPTIONAL, INTENT(IN) :: JULIAN

!-- amontornes-bcodina 2015/09
Expand Down Expand Up @@ -285,7 +285,7 @@ SUBROUTINE SWPARA(TTEN,GSW,XLAT,XLONG,ALBEDO, &
SOLCON,XLAT,XLONG,ALBEDO, &
RADFRQ, DEGRAD

REAL, OPTIONAL, INTENT(IN) :: COSZEN, JULIAN ! jararias, 14/08/2013
REAL, INTENT(IN) :: COSZEN, JULIAN

!
INTEGER, INTENT(IN) :: icloud
Expand Down Expand Up @@ -346,20 +346,7 @@ SUBROUTINE SWPARA(TTEN,GSW,XLAT,XLONG,ALBEDO, &
bexth2o=5.E-6
! SOLTOP=SOLCON
SOLTOP = SOLCON*(1-obscur0)
! jararias, 14/08/2013
if (present(coszen)) then
csza=coszen
else
! da=6.2831853071795862*(julian-1)/365.
! eot=(0.000075+0.001868*cos(da)-0.032077*sin(da) &
! -0.014615*cos(2*da)-0.04089*sin(2*da))*(229.18)
xt24 = mod(xtime+radfrq*0.5,1440.)+eot
tloctm = gmt + xt24/60. + xlong/15.
hrang = 15. * (tloctm-12.) * degrad
xxlat = xlat * degrad
csza = sin(xxlat) * sin(declin) &
+ cos(xxlat) * cos(declin) * cos(hrang)
end if
csza=coszen

! RETURN IF NIGHT
IF(CSZA.LE.1.E-9)GOTO 7
Expand Down

0 comments on commit 179fd33

Please sign in to comment.