diff --git a/src/Hydro/schism_init.F90 b/src/Hydro/schism_init.F90 index 24b4cdd56..c94508216 100644 --- a/src/Hydro/schism_init.F90 +++ b/src/Hydro/schism_init.F90 @@ -5563,15 +5563,20 @@ subroutine schism_init(iorder,indir,iths,ntime) do l=1,wqhot(k)%dims(2) if(myrank==0) then j=nf90_inq_varid(ncid2,trim(adjustl(wqhot(k)%name)),mm) - if(j/=NF90_NOERR) call parallel_abort('hotstart.nc, ICM 1: '//trim(adjustl(wqhot(k)%name))) - if(wqhot(k)%ndim==1) j=nf90_get_var(ncid2,mm,buf3(1:ne_global),(/1/),(/ne_global/)) - if(wqhot(k)%ndim==2) j=nf90_get_var(ncid2,mm,buf3(1:ne_global),(/l,1/),(/1,ne_global/)) - if(wqhot(k)%ndim==3) j=nf90_get_var(ncid2,mm,buf3(1:ne_global),(/m,l,1/),(/1,1,ne_global/)) - if(j/=NF90_NOERR) call parallel_abort('hotstart.nc, ICM 2: '//trim(adjustl(wqhot(k)%name))) + if(j/=NF90_NOERR) then !skip reading variable, and pass -9999 + buf3(1:ne_global)=-9999.0 + write(16,*) 'WARNING ICM hotstart.nc: variable not found (use values in icm.nml), '//trim(adjustl(wqhot(k)%name)) + else + if(wqhot(k)%ndim==1) j=nf90_get_var(ncid2,mm,buf3(1:ne_global),(/1/),(/ne_global/)) + if(wqhot(k)%ndim==2) j=nf90_get_var(ncid2,mm,buf3(1:ne_global),(/l,1/),(/1,ne_global/)) + if(wqhot(k)%ndim==3) j=nf90_get_var(ncid2,mm,buf3(1:ne_global),(/m,l,1/),(/1,1,ne_global/)) + if(j/=NF90_NOERR) call parallel_abort('ICM hotstart.nc, failed in read: '//trim(adjustl(wqhot(k)%name))) + endif endif call mpi_bcast(buf3,ns_global,rtype,0,comm,istat) do i=1,ne_global if(iegl(i)%rank==myrank) then + if(abs(buf3(i)+9999.d0)<1.d-6) cycle if(wqhot(k)%ndim==1) wqhot(k)%p1(iegl(i)%id)=buf3(i) if(wqhot(k)%ndim==2) wqhot(k)%p2(l,iegl(i)%id)=buf3(i) if(wqhot(k)%ndim==3) wqhot(k)%p3(m,l,iegl(i)%id)=buf3(i) diff --git a/src/ICM/icm_init.F90 b/src/ICM/icm_init.F90 index d77136587..f614de8f4 100644 --- a/src/ICM/icm_init.F90 +++ b/src/ICM/icm_init.F90 @@ -1041,16 +1041,23 @@ subroutine icm_vars_init if(iPh==1) ppatch(i)=nint(ppatch0) if(jsav/=0) then spatch(i)=nint(spatch0); sav(:,i)=sav0; call get_canopy(i) - if(jsav==2) EP(i)=EP0; TEP(i)=EP0*sav0(1) + if(jsav==2) then; EP(i)=EP0; TEP(i)=EP0*sav0(1); endif + if(spatch(i)==0) then !zero for other region + sav(:,i)=0; sht(i)=0 + if(jsav==2) then; EP(i)=0; TEP(i)=0; endif + endif endif if(jmarsh==1) then vpatch(i)=nint(vpatch0); vmarsh(:,:,i)=vmarsh0; call get_canopy(i) + if(vpatch(i)==0) then; vmarsh(:,:,i)=0; vht(:,i)=0; endif endif if(iBA==1) then gpatch(i)=nint(gpatch0); gBA(i)=gBA0 + if(gpatch(i)==0) gBA(i)=0 !zero for other region endif if(iClam==1) then cpatch(i)=nint(cpatch0); CLAM(1:nclam,i)=clam0 + if(cpatch(i)==0) CLAM(1:nclam,i)=0 !zero for other region endif enddo