It seems that the option "DIURNAL_SRFLUX" is necessary to be enabled when I focus the mix layer depth.
ROMS calculats the diurnal cycle of shortwave radiation with the formula
cff1=SIN(LatRad)*SIN(Dangle)
cff2=COS(LatRad)*COS(Dangle)
and cff=(cff1*ACOS(-cff1/cff2)+SQRT(cff2*cff2-cff1*cff1))/pi
My problem is the cff1/cff2 is a value great than 1 that means the ACOS() is invalid in this time.
my region is from 78S to 70N and 0E to 360, how to resolve this problem ?
By the way, the reference paper to calculated the diurnal cycle of shortwave radiation is not listed in ROMS.
Problem with diurnal cycle of shortwave radiation
Re: Problem with diurnal cycle of shortwave radiation
If cff2 < cff1 the sun is below the horizon. This can be seen in the ALBEDO code for analytical shortwave radiation based on latitude and year-day. While this does lead to a complex ACOS result the case is trapped by the srflx = max(0,...) statement.ygwang_FIO wrote:It seems that the option "DIURNAL_SRFLUX" is necessary to be enabled when I focus the mix layer depth.
ROMS calculats the diurnal cycle of shortwave radiation with the formula
cff1=SIN(LatRad)*SIN(Dangle)
cff2=COS(LatRad)*COS(Dangle)
and cff=(cff1*ACOS(-cff1/cff2)+SQRT(cff2*cff2-cff1*cff1))/pi
My problem is the cff1/cff2 is a value great than 1 that means the ACOS() is invalid in this time.
my region is from 78S to 70N and 0E to 360, how to resolve this problem ?
By the way, the reference paper to calculated the diurnal cycle of shortwave radiation is not listed in ROMS.
The code notes that the so-called 'albedo' calculation is documented in
! ALBEDO option: Compute shortwave radiation flux using the Laevastu
! cloud correction to the Zillman equation for cloudless
! radiation (Parkinson and Washington 1979, JGR, 84, 311-337). Notice
! that flux is scaled from W/m2 to degC m/s by dividing by (rho0*Cp).
The subsequent calculation of DIRUNAL_SRFLUX modulation is just a bit of math.
John.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu
Re: Problem with diurnal cycle of shortwave radiation
I'm now getting a problem when the sun is very near the horizon (December in the Chukchi Sea). In the code:
I have
Code: Select all
cff=(cff1*ACOS(-cff1/cff2)+SQRT(cff2*cff2-cff1*cff1))/pi
srflx(i,j)=MAX(0.0_r8, &
& srflx(i,j)/cff* &
& (cff1+cff2*COS(Hangle-lonr(i,j)*deg2rad)))
- cff=-1.5890952880675496E-013
- cff1=-0.3648175112485696
- cff2=0.3648175119668081
- srflx(i,j)=174166.8878345824
Re: Problem with diurnal cycle of shortwave radiation
Hi Katekate wrote:I'm now getting a problem when the sun is very near the horizon (December in the Chukchi Sea). In the code:I haveCode: Select all
cff=(cff1*ACOS(-cff1/cff2)+SQRT(cff2*cff2-cff1*cff1))/pi srflx(i,j)=MAX(0.0_r8, & & srflx(i,j)/cff* & & (cff1+cff2*COS(Hangle-lonr(i,j)*deg2rad)))
- cff=-1.5890952880675496E-013
- cff1=-0.3648175112485696
- cff2=0.3648175119668081
Dividing by such a small number as cff seems like a bad idea - any suggestions?
- srflx(i,j)=174166.8878345824
I am currently experiencing a similar problem and was wondering if you remember how you approached this problem. Did you just set cff to a more reasonable fixed value?
Marc
Re: Problem with diurnal cycle of shortwave radiation
Something like that:
Code: Select all
cff=(cff1*ACOS(-cff1/cff2)+SQRT((cff2+cff1)*(cff2-cff1)))/pi
IF (cff .lt. 10.e-10) THEN
srflx(i,j)=0.0_r8
ELSE
srflx(i,j)=MAX(0.0_r8, &
& srflx(i,j)/cff* &
& (cff1+cff2*COS(Hangle-lonr(i,j)*deg2rad)))
END IF