diff --git a/plasim/src/icemod.f90 b/plasim/src/icemod.f90 index 27fd7fd06f254191102a55e38897d9ee76048fb7..31e2c2c9280f189b8532014e55c74c66f659c683 100644 --- a/plasim/src/icemod.f90 +++ b/plasim/src/icemod.f90 @@ -1,10 +1,9 @@ module icemod - use resmod ! ! version identifier (date) ! - character(len=80) :: version = '06.03.2013 by Larry' + character(len=80) :: version = '15.02.2018' ! ! ! Parameter @@ -50,6 +49,7 @@ integer :: nentropy = 0 ! switch for entropy diagnostics integer :: ngui = 0 ! switch for gui integer :: naout = 0 ! no additional output fields + integer :: nmaxd = 1 ! switch for flx due to xmaxd (1=add) ! real :: taunc = 0. ! time scale for newtonian cooling real :: xmind = 0.1 ! minimal ice thickness (m) @@ -114,9 +114,9 @@ ! ! Climatological fields ! - real :: xclsst(NHOR,0:13) =-999.! climatological sst - real :: xclicec(NHOR,0:13)=-999.! climatological ice cover - real :: xcliced(NHOR,0:13)=-999.! climatological ice thickness + real :: xclsst(NHOR,0:13) = 273.15 ! climatological sst + real :: xclicec(NHOR,0:13)= -999. ! climatological ice cover + real :: xcliced(NHOR,0:13)= -999. ! climatological ice thickness real :: xflxice(NHOR,0:13)= 0.! flux correction (W/m^2) real :: xclsst2(NHOR) = 0. ! climatological sst real :: xclssto(NHOR) = 0. ! climatological sst (t-1) @@ -256,7 +256,7 @@ ! namelist/icemod_nl/nout,nfluko,nperpetual_ice,ntspd,nprint,nprhor & & ,nentropy,nice,nsnow,ntskin,ncpl_ice_ocean,taunc & - & ,xmind,xmaxd,thicec,newsurf,naout + & ,xmind,xmaxd,thicec,newsurf,naout,nmaxd ! ! copy input parameter to icemod ! @@ -309,6 +309,7 @@ call mpbci(nprhor) call mpbci(nentropy) call mpbci(naout) + call mpbci(nmaxd) call mpbcr(taunc) call mpbcr(xmind) call mpbcr(xmaxd) @@ -320,9 +321,15 @@ taunc = solar_day * taunc if (nrestart == 0) then ! read start file - + call read_ice_surface ! +! limit ice thickness to xmaxd (if set) +! + if(xmaxd > 0.) then + xcliced(:,:)=AMIN1(xcliced(:,:),xmaxd) + endif +! ! initialize ! call iceget @@ -364,6 +371,7 @@ call mpgetgp('csnow' ,csnow ,NHOR, 1) call mpgetgp('xflxicea',xflxicea,NHOR, 1) call mpgetgp('xheata' ,xheata ,NHOR, 1) + call mpgetgp('xcfluxr' ,xcfluxr ,NHOR, 1) call mpgetgp('xofluxa' ,xofluxa ,NHOR, 1) call mpgetgp('xqmelta' ,xqmelta ,NHOR, 1) call mpgetgp('xcfluxa' ,xcfluxa ,NHOR, 1) @@ -470,7 +478,6 @@ xscflx(:)=0. xcfluxn(:)=0. xsndch(:)=0. - xcfluxr(:)=0. ! ! copy input to icemod ! @@ -489,6 +496,13 @@ xtauy(:)=ptauy(:) xust3(:)=pust3(:) ! +! add (sub) residual flux due to limit of ice to xmaxd +! (if switched on by nmaxd) +! + if(nmaxd > 0) then + xheat(:)=xheat(:)-xcfluxr(:) + endif +! ! get climatology ! call iceget @@ -638,19 +652,14 @@ ! update ximelt ! zcflux(:)=0. + xcfluxr(:)=0. if(xmaxd >= 0.) then where(xiced(:) > xmaxd) zcflux(:)=(xiced(:)-xmaxd)*zrhoilfdt xiced(:)=xmaxd xcfluxr(:)=xcfluxr(:)+zcflux(:) ximelt(:)=ximelt(:)+zcflux(:) -! -! diagnose the lost ice as accumulated snow -! (to make the budged from the atm. output) -! - xsndch(:)=xsndch(:)+zcflux(:)*1000./CRHOI/zrhoilfdt/xdt end where - call getiflx endif ! ! depug print out if needed @@ -931,6 +940,7 @@ call mpputgp('csnow' ,csnow ,NHOR, 1) call mpputgp('xflxicea',xflxicea,NHOR, 1) call mpputgp('xheata' ,xheata ,NHOR, 1) + call mpputgp('xcfluxr' ,xcfluxr ,NHOR, 1) call mpputgp('xofluxa' ,xofluxa ,NHOR, 1) call mpputgp('xqmelta' ,xqmelta ,NHOR, 1) call mpputgp('xcfluxa' ,xcfluxa ,NHOR, 1) @@ -1879,38 +1889,3 @@ return end subroutine make_ice_thickness -! ================== -! SUBROUTINE GETIFLX -! ================== - - subroutine getiflx - use icemod -! - real :: zsum(2) - real :: zflx(NHOR) = 0. -! - zrhoilfdt=CRHOI*CLFI/xdt -! - where(xls(:) < 1.) - zflx(:)=AMAX1(0.,xmaxd-xiced(:))*zrhoilfdt - endwhere -! - zsum(1)=SUM(xcfluxr(:)*xgw(:),MASK=(xls(:) < 1.)) - zsum(2)=SUM(zflx(:)*xgw(:),MASK=(xls(:) < 1.)) - call mpsumbcr(zsum,2) -! - if(zsum(1) > 0. .and. zsum(2) > 0.) then - zfac=zsum(1)/zsum(2) - if(zfac <= 1.) then - where(xls(:) < 1.) - zflx(:)=zflx(:)*zfac - endwhere - endif - where(xls(:) < 1.) - xcfluxr(:)=xcfluxr(:)-zflx(:) - xcflux(:)=xcflux(:)-zflx(:) - endwhere - endif -! - return - end subroutine getiflx diff --git a/plasim/src/oceanmod.f90 b/plasim/src/oceanmod.f90 index 5b795f389067a9f41dfef359ddf692521701eba9..47dd9118d946bdceefbc8e1bb4b4d7f3465532e3 100644 --- a/plasim/src/oceanmod.f90 +++ b/plasim/src/oceanmod.f90 @@ -4,7 +4,7 @@ ! ! version identifier (date) ! - character(len=80) :: version = '13.10.2005 by Larry' + character(len=80) :: version = '15.02.2018' ! ! Parameter ! @@ -91,7 +91,7 @@ real :: ydsst(NHOR) = 0. ! heat flux from vdiff (w/m2) real :: yqhd(NHOR) = 0. ! heat flux from hdiff (w/m2) - real :: yclsst(NHOR,0:13) ! climatological sst (K) + real :: yclsst(NHOR,0:13)= 273.15 ! climatological sst (K) real :: yfsst(NHOR,0:13) = 0. ! flux corr. sst (W/m**2) real :: yclsst2(NHOR) = 0. ! climatological sst (K) diff --git a/plasim/src/restartmod.f90 b/plasim/src/restartmod.f90 index 5bbfd6f19a1f412ffb8933ea3de0f1f8d2784cdd..377c5453f97f23b57e9bf2bf1fca8681ef1857a2 100644 --- a/plasim/src/restartmod.f90 +++ b/plasim/src/restartmod.f90 @@ -1,4 +1,9 @@ module restartmod +! +! version identifier (date) +! + character(len=80) :: version = '15.02.2018' + integer, parameter :: nresdim = 200 ! Max number of records integer, parameter :: nreaunit = 33 ! FORTRAN unit for reading integer, parameter :: nwriunit = 34 ! FORTRAN unit for writing @@ -21,6 +26,10 @@ character (len=*) :: yrfile character (len=16) :: yn ! variable name + write(nud,'(/," ***********************************************")') + write(nud,'(" * RESTARTMOD ",a32," *")') trim(version) + write(nud,'(" ***********************************************")') + inquire(file=yrfile,exist=lrestart) if (lrestart) then open(nreaunit,file=yrfile,form='unformatted') @@ -128,9 +137,9 @@ endif enddo if (nexcheck == 1) then - write(nud,*)'*** Error in get_restart_array ***' + write(nud,*)'*** WARNING in get_restart_array ***' write(nud,*)'Requested array {',yn,'} was not found' - stop + write(nud,*)'Default values will be used' endif return end subroutine get_restart_array diff --git a/plasim/src/surfmod.f90 b/plasim/src/surfmod.f90 index 6283778a4abd9d35b30e9cf92a5f8115e643ad47..7f14f7e8b5f417ee64195b493ec2580efc7a17b1 100644 --- a/plasim/src/surfmod.f90 +++ b/plasim/src/surfmod.f90 @@ -1,7 +1,7 @@ module surfmod use pumamod - character(len=80) :: version = '12.06.2014 by Edi' + character(len=80) :: version = '15.02.2018' integer, parameter :: nsurdim = 100 ! max # of variables integer, parameter :: nsurunit = 35 ! read unit @@ -346,14 +346,14 @@ open(11,file=surfmod_namelist) read(11,surfmod_nl) close(11) - write(nud,'(/,"***********************************************")') - write(nud,'("* SURFMOD ",a35," *")') trim(version) - write(nud,'("***********************************************")') + write(nud,'(/," ***********************************************")') + write(nud,'(" * SURFMOD ",a35," *")') trim(version) + write(nud,'(" ***********************************************")') if (naqua /= 0) then - write(nud,'("* AQUA planet mode - ignoring land data *")') + write(nud,'(" * AQUA planet mode - ignoring land data *")') endif - write(nud,'("* Namelist SURFMOD_NL from <surfmod_namelist> *")') - write(nud,'("***********************************************")') + write(nud,'(" * Namelist SURFMOD_NL from <surfmod_namelist> *")') + write(nud,'(" ***********************************************")') write(nud,surfmod_nl) endif @@ -368,6 +368,13 @@ so(:) = 0.0 ! spectral orography sp(:) = 0.0 ! spectral pressure spm(:) = 0.0 ! spectral pressure scattered +! +! add noise +! + if (mypid == NROOT) then + call noise + endif + call mpscsp(sp,spm,1) endif if (nrestart == 0 .and. naqua == 0) then ! need to read start data