Commit 3a16a08e authored by ph290's avatar ph290
Browse files

changing the default model version to include prescribed downwelling short and...

changing the default model version to include prescribed downwelling short and longwave radiation. For older runs without this compile s2p3_rv2.0_no_prescribed_radiation.f90
parent ab5fa801
......@@ -30,10 +30,11 @@ MODULE physics
double precision :: lon,lat,kb,f0,f1,lambda,heat_shade,vismax,qsdt,stressx,stressy,windspeed,polarisn(6),rad_out, &
dewT,stresss,stressb,Px,Py,slopex(5),slopey(5),tsteps,orient(5),semi_major(5),semi_minor(5), &
first_temp,sx,sy,radsum,omega(5),major_phase(5),background_mol,u_bed,v_bed,speed_mag(200),mean_speed, &
rad0,speed,speed1,speed2,speed3,time,depth,newdepth,grav_accel,radiation_zerocloud(40000),radiation_fullcloud(40000), &
rad0,lw_rad_down0,speed,speed1,speed2,speed3,time,depth,newdepth,grav_accel,radiation_zerocloud(40000), &
radiation_fullcloud(40000), &
uac,uc,gac1,gac2,gac,gc1,gc2,gc,strat_jul,rad_sum,acount
DOUBLE PRECISION :: wind_speed(40000),wind_dir(40000),std_dir(40000),std_speed(40000),&
radiation(40000),humid(40000),airP(40000),airT(40000), &
radiation(40000),humid(40000),airP(40000),airT(40000),rad_input(40000),lw_rad_down(40000), &
cloud(40000),declination(40000)
real :: tid,tid2,uamp(5),vamp(5),vphase(5),uphase(5)
integer :: idmet,iday_front1,iday_front2,iday_front3,iday_front4
......@@ -1088,10 +1089,15 @@ newdepth = alldepth
!newN=20; kb=0.003
!original values above - just changed to 10 to speed up for demonstartion
!purposes
newN=20; kb=0.0025
if(alldepth.lt.30) newN = 10
if(alldepth.lt.10) newN = 5
if(alldepth.lt.5) newN = 3
!newN=20; kb=0.0025
!if(alldepth.lt.30) newN = 10
!if(alldepth.lt.10) newN = 5
!if(alldepth.lt.5) newN = 3
kb=0.0025
!All vertical levels set to 2m
newN=nint(alldepth/2.0)
!set up equal depth intervals of 2m for sections:
if(imode.eq.2) then
......@@ -1285,10 +1291,12 @@ Subroutine grazing() ! Get phytoplankton grazing parameters
airT(i)=12.5-3.3*cos(real(i)*0.017214191)-2.5*sin(real(i)*0.017214191)
airP(i)=1016.0 !*(1.014-0.0004*cos(real(i)*0.017214191)+0.0009*sin(real(i)*0.017214191))
day_angle=360.0*real(i)/real(ndays)
rad_input(i) = 200.0
declination(i)=0.39637-22.9133*MyCOS(day_angle)+4.02543*MySIN(day_angle)-0.3872*MyCOS(2.0*day_angle)&
+0.052*MySIN(2.0*day_angle)
cloud(i)=66.5+5.1*cos(real(i)*0.017214191)-4.1*sin(real(i)*0.017214191) !100.0*(0.15*cos(real(i)*0.017214191)+0.65)
write(60,fmt="(i4,6f10.2)") i,wind_speed(i),wind_dir(i),cloud(i),airT(i),airP(i),humid(i)
write(60,fmt="(i4,7f10.2)") i,wind_speed(i),wind_dir(i),cloud(i),airT(i),airP(i),humid(i)&
,rad_input(i)
! print*, i,wind_speed(i),wind_dir(i),cloud(i),airT(i),airP(i),humid(i)
end do
close(60)
......@@ -1304,7 +1312,7 @@ Subroutine grazing() ! Get phytoplankton grazing parameters
i=1
1301 metfile_error=1
read(60,*,end=1302,err=1303) idum,wind_speed(i),wind_dir(i),cloud(i),airT(i),airP(i),humid(i)
read(60,*,end=1302,err=1303) idum,wind_speed(i),wind_dir(i),cloud(i),airT(i),airP(i),humid(i),rad_input(i),lw_rad_down(i)
! print*, idum,wind_speed(i),wind_dir(i),cloud(i),airT(i),airP(i),humid(i)
metfile_error=0
i=i+1
......@@ -1331,6 +1339,8 @@ Subroutine grazing() ! Get phytoplankton grazing parameters
airP(ndays+1)=airP(ndays)
airT(ndays+1)=airT(ndays)
cloud(ndays+1)=cloud(ndays)
rad_input(ndays+1)=rad_input(ndays)
lw_rad_down(ndays+1)= lw_rad_down(ndays)
declination(ndays+1)=declination(ndays)
1303 return
......@@ -1646,9 +1656,12 @@ timeloop: do itime=1,itotal ! <A NAME="START OF TIME LOOP">
day_time=(time/(24.0*3600.0))-noon_time
day_angle=(2.0*3.1415927)*day_time
sin_solar_elev=dcos(day_angle)*MyCOS(lat)*MyCOS(declination(idmet))+MySIN(lat)*MySIN(declination(idmet))
rad_ideal=1368.0*0.76*sin_solar_elev*(1.0-0.06) ! clear sky irradiance W m-2
rad0=rad_ideal*(1.0-0.01*cloud(idmet)*0.4-0.000038*cloud(idmet)**2.0) ! irradiance with cloud
if(rad0.lt.0.0)rad0=0.0
!now directly reading downwelling radiation in
rad0 = rad_input(idmet)
lw_rad_down0 = lw_rad_down(idmet)
! rad_ideal=1368.0*0.76*sin_solar_elev*(1.0-0.06) ! clear sky irradiance W m-2
! rad0=rad_ideal*(1.0-0.01*cloud(idmet)*0.4-0.000038*cloud(idmet)**2.0) ! irradiance with cloud
! if(rad0.lt.0.0)rad0=0.0
!
! Heat the surface and distribute heat through the water column
!
......@@ -2420,7 +2433,9 @@ sat_vap=10.0**((0.7859+0.03477*temp_old(N))/(1.0+0.00412*temp_old(N)))
vap=0.01*humid(idmet)*sat_vap
spec_hum1=0.62*sat_vap/(airP(idmet)-0.38*sat_vap)
spec_hum2=0.62*vap/(airP(idmet)-0.38*vap)
hl=0.985*5.67d-8*(surf_temp**4.0)*(0.39-0.05*vap**0.5)*(1.0-0.6d-4*cloud(idmet)**2.0) !Longwave
!hl=0.985*5.67d-8*(surf_temp**4.0)*(0.39-0.05*vap**0.5)*(1.0-0.6d-4*cloud(idmet)**2.0) !original codes Longwave
!Net longwave radiation flux=IR_surface_emissivity_1_for_black_body(Stefan_Boltzmann_constant * T**4.8 - downwelling_longwave) Note T should really be skin temp
hl=0.985*5.67d-8*(surf_temp**4.0)-lw_rad_down0 !Longwave
sk=1.45d-3*1.3*1004.0*wind_speed(idmet)*(temp_old(N)-airT(idmet)) !Sensible
ske=1.5d-3*1.3*wind_speed(idmet)*(spec_hum1-spec_hum2)*(2.5d6-2.3d3*temp_old(N)) !Evaporation
rad_out=-(hl+sk+ske)
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment