List of changes for various versions
- From 02g to 02g2: if you have your own elcirc5_01_02g.f90, you can incorporate the changes using the following simple UNIX command: patch elcirc5_01_02g_myversion.f90 patch_02g_02g2
This produces a revised elcirc5_01_02g_myversion.f90 with the new patches,
which can be dowloaded here .
-
Problem description: the hydrostatic pressure correction in the equation of state amplifies instability in a stable stratification test.
- Affected versions: 5.01.01c and 5.01.02g
- Temporary fix for 5.01.02g: comment out lines 4397-4418, and 4459-4479 in routine eqstate, to turn off the hydrostatic pressure correction.
! Account for pressure for depth > 100m
! if(.not.first_call.and.zmsl-ztot(k).gt.100) then
! pres=0
! do kk=k,kfp(i)
! ptmp=9.81*prho(i,kk)*dzp(i,kk)
! if(kk.eq.k) then
! pres=pres+1.e-5*ptmp/2
! else
! pres=pres+1.e-5*ptmp
! endif
! enddo !kk
! Secant bulk modulus
! sbm=19652.21+148.4206*ttmp-2.327105*ttmp**2+1.360477e-2*ttmp**3-5.155288e-5*ttmp**4+ &
! &pres*(3.239908+1.43713e-3*ttmp+1.16092e-4*ttmp**2-5.77905e-7*ttmp**3)+ &
! &pres**2*(8.50935e-5-6.12293e-6*ttmp+5.2787e-8*ttmp**2)+ &
! &stmp*(54.6746-0.603459*ttmp+1.09987e-2*ttmp**2-6.1670e-5*ttmp**3)+ &
! &dsqrt(stmp)**3*(7.944e-2+1.6483e-2*ttmp-5.3009e-4*ttmp**2)+ &
! &pres*stmp*(2.2838e-3-1.0981e-5*ttmp-1.6078e-6*ttmp**2)+1.91075e-4*pres*dsqrt(stmp)**3- &
! &9.9348e-7*pres**2*stmp+2.0816e-8*ttmp*pres**2*stmp+9.1697e-10*ttmp**2*pres**2*stmp
! ratio=1/(1-pres/sbm)
! prho(i,k)=prho(i,k)*ratio
! endif !.not.first_call.and.zmsl-ztot(k).gt.100
!... Fake eqstate option
if(ieqstate==1) prho(i,k)=1000+0.8*stmp
if(prho(i,k).lt.980) then
write(11,*)'Weird density at node',i,k,prho(i,k),ttmp,stmp
stop
endif
enddo !k=kbp(i),kfp(i)
! Extend to account for level changes
do k=1,kbp(i)-1
prho(i,k)=prho(i,kbp(i))
enddo
do k=kfp(i)+1,nvrt
prho(i,k)=prho(i,kfp(i))
enddo
400 continue !i=1,np
!... At sides
do 445 i=1,ns
! Dry sides will not be updated
if(kfs(i).eq.0) go to 445
do k=kbs(i),kfs(i)
ttmp=tsd(i,k)
stmp=ssd(i,k)
if(ttmp.lt.0.or.ttmp.gt.40.or.stmp.lt.0.or.stmp.gt.42) then
write(11,*)'Invalid side temp. or salinity for density'
write(11,*)ttmp,stmp,i,k,kfs(i)
stop
endif
! Density at one standard atmosphere
srho(i,k)=1000-0.157406+6.793952E-2*ttmp-9.095290E-3*ttmp**2&
&+1.001685E-4*ttmp**3-1.120083E-6*ttmp**4+6.536332E-9*ttmp**5+ &
&stmp*(0.824493-4.0899E-3*ttmp+&
&7.6438E-5*ttmp**2-8.2467E-7*ttmp**3+5.3875E-9*ttmp**4)+&
&dsqrt(stmp)**3*(-5.72466E-3+1.0227E-4*ttmp-1.6546E-6*ttmp**2)+&
&4.8314E-4*stmp**2
! Account for pressure for depth > 100m
! if(.not.first_call.and.zmsl-ztot(k).gt.100) then
! pres=0
! do kk=k,kfs(i)
! ptmp=9.81*srho(i,kk)*dz(i,kk)
! if(kk.eq.k) then
! pres=pres+1.e-5*ptmp/2
! else
! pres=pres+1.e-5*ptmp
! endif
! enddo !kk
! Secant bulk modulus
! sbm=19652.21+148.4206*ttmp-2.327105*ttmp**2+1.360477e-2*ttmp**3-5.155288e-5*ttmp**4+ &
! &pres*(3.239908+1.43713e-3*ttmp+1.16092e-4*ttmp**2-5.77905e-7*ttmp**3)+ &
! &pres**2*(8.50935e-5-6.12293e-6*ttmp+5.2787e-8*ttmp**2)+ &
! &stmp*(54.6746-0.603459*ttmp+1.09987e-2*ttmp**2-6.1670e-5*ttmp**3)+ &
! &dsqrt(stmp)**3*(7.944e-2+1.6483e-2*ttmp-5.3009e-4*ttmp**2)+ &
! &pres*stmp*(2.2838e-3-1.0981e-5*ttmp-1.6078e-6*ttmp**2)+1.91075e-4*pres*dsqrt(stmp)**3- &
! &9.9348e-7*pres**2*stmp+2.0816e-8*ttmp*pres**2*stmp+9.1697e-10*ttmp**2*pres**2*stmp
! srho(i,k)=srho(i,k)/(1-pres/sbm)
! endif !.not.first_call.and.zmsl-ztot(k).gt.100
!... Fake eqstate option
if(ieqstate==1) srho(i,k)=1000+0.8*stmp
- Bug: line 1934, "bgiff" should be changed to "bgdiff".
!... For UB & MYG, compute vertical diffusivities at whole levels
if(itur.eq.3) then
do i=1,ns
do j=kbs(i),kfs(i) !wet sides
call asm(g,i,j,vd,td,qd,qd2)
vdiff(i,j)=dmin1(diffmax(i),dmax1(bgiff,vd))
tdiff(i,j)=dmin1(diffmax(i),dmax1(bgdiff,td))
qdiff(i,j)=dmin1(diffmax(i),dmax1(bgdiff,qd))
qdiff2(i,j)=dmin1(diffmax(i),dmax1(bgdiff,qd2))
enddo !j=kbs(i),kfs(i)
enddo !i=1,ns
endif !itur=3
- Bug: in routine tgrad(), variable "i" is not defined. Just remove the entire routine as it is never used.
- Bug: Lines 2514-15; 2573, and 2595. Replace all klev-1 with max0(klev-1,kbs(j)).
|