diff --git a/src/conv_mod.f90 b/src/conv_mod.f90 index b2c7efcf5f5cb390773b266b64bb050b3151bffb..76a639c3fd9b1811d01581ee163d5a14378d53d8 100644 --- a/src/conv_mod.f90 +++ b/src/conv_mod.f90 @@ -438,7 +438,7 @@ subroutine convmix(itime) ! Now visit all grid columns where particles are present ! by going through the sorted particles !$OMP PARALLEL PRIVATE (igrold,kpart,ipart,igr,jy,ix,kz,lconv, & -!$OMP ktop,ztold,nage,ipconv,itage,lcalcflux) +!$OMP ktop,ztold,nage,ipconv,itage,lcalcflux,ithread) igrold = -1 #if (defined _OPENMP) ithread = OMP_GET_THREAD_NUM()+1 ! Starts at 1 diff --git a/src/drydepo_mod.f90 b/src/drydepo_mod.f90 index 98bf7c653873446964cdff93e2f7911e61257a19..9bd0ee83e6a15b1328e2f0ed11c2898fb8db83bf 100644 --- a/src/drydepo_mod.f90 +++ b/src/drydepo_mod.f90 @@ -38,18 +38,25 @@ subroutine alloc_drydepo if (.not. drydep) return write(*,*) 'allocate drydepo fields' allocate(xlanduse(0:nxmax-1,0:nymax-1,numclass), & - xlandusen(0:nxmaxn-1,0:nymaxn-1,numclass,numbnests), & vdep(0:nxmax-1,0:nymax-1,maxspec,numwfmem), & - z0_drydep(0:nxmax-1,0:nymax-1), & - z0_drydepn(0:nxmax-1,0:nymax-1,numbnests), stat=stat) + z0_drydep(0:nxmax-1,0:nymax-1), stat=stat) if (stat.ne.0) error stop "Could not allocate drydepo fields" + if (numbnests.ge.1) then + allocate(xlandusen(0:nxmaxn-1,0:nymaxn-1,numclass,numbnests), & + vdepn(0:nxmaxn-1,0:nymaxn-1,maxspec,numwfmem,numbnests), & + z0_drydepn(0:nxmaxn-1,0:nymaxn-1,numbnests), stat=stat) + if (stat.ne.0) error stop "Could not allocate drydepo fields" + endif end subroutine alloc_drydepo subroutine dealloc_drydepo if (.not. drydep) return - deallocate(xlanduse,xlandusen,vdep,z0_drydep,z0_drydepn) + deallocate(xlanduse,vdep,z0_drydep) + if (numbnests.ge.1) then + deallocate(xlandusen,vdepn,z0_drydepn) + endif end subroutine dealloc_drydepo diff --git a/src/interpol_mod.f90 b/src/interpol_mod.f90 index 8cd29e3ffb5739c2524810f0d44d4f528a82817b..8620892bf66adcbcf8b1a82982e492c1dc0171b4 100644 --- a/src/interpol_mod.f90 +++ b/src/interpol_mod.f90 @@ -136,8 +136,8 @@ subroutine find_grid_indices(xt,yt) ! jy=int(ytn) ! nix=nint(xtn) ! njy=nint(ytn) - nix=max(min(nint(xtn),nxn(ngrid)-1),0) - njy=max(min(nint(ytn),nyn(ngrid)-1),0) + nix=max(min(int(xtn),nxn(ngrid)-1),0) + njy=max(min(int(ytn),nyn(ngrid)-1),0) ix=nix jy=njy ixp=ix+1 @@ -1987,4 +1987,4 @@ subroutine stdev_meter(iw) end subroutine stdev_meter #endif -end module interpol_mod \ No newline at end of file +end module interpol_mod diff --git a/src/make_command.sh b/src/make_command.sh deleted file mode 100755 index deb0e704a23a0da693480e6e4455e4a5d0c7a559..0000000000000000000000000000000000000000 --- a/src/make_command.sh +++ /dev/null @@ -1,23 +0,0 @@ - -module purge -module load eccodes -export CPATH=/opt/tools/eccodes/2.28.0-gcc9.4/include:/opt/tools/netcdf-fortran/4.6.0-gcc9.4/include -export LIBRARY_PATH=$LIBRARY_PATH:/opt/tools/eccodes/2.28.0-gcc9.4/lib - -rm -f *.o *.mod - -# eta ncf - new default FLEXPART_ETA -FC=/opt/tools/gcc/9.4.0/bin/gfortran make -f makefile_gfortran -#executable: FLEXPART_ETA - -# meter bin - classic -#FC=/opt/tools/gcc/9.4.0/bin/gfortran make -f makefile_gfortran eta=no ncf=no -# executable: FLEXPART_BIN - -# meter ncf: -#FC=/opt/tools/gcc/9.4.0/bin/gfortran make -f makefile_gfortran eta=no -# executable: FLEXPART - -# eta/bin -#FC=/opt/tools/gcc/9.4.0/bin/gfortran make -f makefile_gfortran ncf=no -# executable: FLEXPART_ETA_BIN diff --git a/src/outgrid_mod.f90 b/src/outgrid_mod.f90 index 97138884050729ef12d3fac1009277e4e6b0d6b4..42da3f162f7db28322fac5bc913dcb123315ebba 100644 --- a/src/outgrid_mod.f90 +++ b/src/outgrid_mod.f90 @@ -273,8 +273,8 @@ subroutine outgrid_init if (ngrid.gt.0) then xtn=(xl-xln(ngrid))*xresoln(ngrid) ytn=(yl-yln(ngrid))*yresoln(ngrid) - ix=max(min(nint(xtn),nxn(ngrid)-1),0) - jy=max(min(nint(ytn),nyn(ngrid)-1),0) + ix=max(min(int(xtn),nxn(ngrid)-1),0) + jy=max(min(int(ytn),nyn(ngrid)-1),0) ! ix=int(xtn) ! jy=int(ytn) ddy=ytn-real(jy) diff --git a/src/sort_mod.f90 b/src/sort_mod.f90 index d34ecf9c6eedbc16e712d957ffe58aeb6634c907..a17f20906f9bf7c2cf67050826bed38c6ffe1dc9 100644 --- a/src/sort_mod.f90 +++ b/src/sort_mod.f90 @@ -55,8 +55,8 @@ !! in the Fortran Standard Library under the MIT license provided !! we cite: !! -!! Musser, D.R., “Introspective Sorting and Selection Algorithms,” -!! Software—Practice and Experience, Vol. 27(8), 983–993 (August 1997). +!! Musser, D.R., "Introspective Sorting and Selection Algorithms," +!! Software-Practice and Experience, Vol. 27(8), 983-993 (August 1997). !! !! as the official source of the algorithm. @@ -523,4 +523,4 @@ contains end subroutine reverse_segment -end module sort_mod \ No newline at end of file +end module sort_mod diff --git a/src/wetdepo_mod.f90 b/src/wetdepo_mod.f90 index e13a9c42da4e2e40df6716c9ed7135a0d92926b3..f76aa59124e296c0c9b9e53143e818f9e66e8c9a 100644 --- a/src/wetdepo_mod.f90 +++ b/src/wetdepo_mod.f90 @@ -324,7 +324,7 @@ subroutine get_wetscav(itime,jpart,ks,gridfract,wetscav) #endif ! Interpolate cloud information - call interpol_rain(itime,kz,lsp,convp,cc,t_particle,cl,icbot,ictop,icmv) + call interpol_rain(itime,kz,lsp,convp,cc,t_particle,cl,icbot,ictop,icmv) ! cc = total cloud cover ! cl = ctwc diff --git a/src/windfields_mod.f90 b/src/windfields_mod.f90 index 5ba63cce159cf8ddddda1dbd5f4567924c979295..e2e7dac30dbff969c130c24643b21c987aac1842 100644 --- a/src/windfields_mod.f90 +++ b/src/windfields_mod.f90 @@ -93,7 +93,7 @@ module windfields_mod ctwc ! ESO: =icloud_stats(:,:,4,:) total cloud water content integer,allocatable,dimension(:,:,:) :: & ! new scavenging AT 2021 icloudbot, & ! cloud bottom height [m/eta] - icloudtop ! cloud top [m/eta] + icloudtop ! cloud top [m/eta] ! 3d nested fields !***************** @@ -129,7 +129,7 @@ module windfields_mod ctwcn ! ESO: =icloud_stats(:,:,4,:) total cloud water content integer,allocatable,dimension(:,:,:,:) :: & ! new scavenging AT 2021 icloudbotn, & ! cloud bottom height [m/eta] - icloudtopn ! cloud thickness [m/eta] + icloudtopn ! cloud thickness [m/eta] ! 2d fields !********** @@ -152,11 +152,11 @@ module windfields_mod oli ! inverse Obukhov length (1/L) [m] ! 2d fields - !********** + !********** real, allocatable,dimension(:,:,:,:,:) :: & ! newWetDepoScheme, extra precip dimension AT 2021 lsprec, & ! large scale total precipitation [mm/h] convprec ! convective precipitation [mm/h] - + ! 2d nested fields !******************* real, allocatable,dimension(:,:,:,:,:) :: & @@ -179,11 +179,11 @@ module windfields_mod vdepn ! ! 2d fields - !********** + !********** real, allocatable,dimension(:,:,:,:,:,:) :: & ! newWetDepoScheme, extra precip dimension AT 2021 lsprecn, & ! large scale total precipitation [mm/h] convprecn ! convective precipitation [mm/h] - + integer :: metdata_format ! storing the input data type (ECMWF/NCEP) !**************************************************************************** @@ -443,19 +443,19 @@ subroutine gridcheck_ecmwf !read the grib2 identifiers call grib_get_int(igrib,'discipline',discipl,iret) call grib_check(iret,thisSubr,gribErrorMsg) - + call grib_get_int(igrib,'parameterCategory',parCat,iret) call grib_check(iret,thisSubr,gribErrorMsg) - + call grib_get_int(igrib,'parameterNumber',parNum,iret) call grib_check(iret,thisSubr,gribErrorMsg) - + call grib_get_int(igrib,'typeOfFirstFixedSurface',typSfc,iret) call grib_check(iret,thisSubr,gribErrorMsg) - + call grib_get_int(igrib,'level',k,iret) call grib_check(iret,thisSubr,gribErrorMsg) - + call grib_get_int(igrib,'paramId',parId,iret) call grib_check(iret,thisSubr,gribErrorMsg) @@ -1882,11 +1882,8 @@ subroutine gridcheck_nest ! Allocate memory for windfields using nxmax, nymaxn, numbnest !************************************************************* - if (numbnests.ge.1) then - ! If nested wind fields are used, allocate arrays - !************************************************ - call alloc_windfields_nest - endif + call alloc_windfields_nest + return @@ -4303,8 +4300,6 @@ subroutine alloc_windfields_nest if (stat.ne.0) error stop "Could not allocate tropopausen" allocate(olin(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,numbnests),stat=stat) if (stat.ne.0) error stop "Could not allocate olin" - allocate(vdepn(0:nxmaxn-1,0:nymaxn-1,maxspec,numwfmem,numbnests),stat=stat) - if (stat.ne.0) error stop "Could not allocate vdepn" ! Initialise !************ @@ -4362,7 +4357,7 @@ subroutine dealloc_windfields_nest #endif deallocate(psn,sdn,msln,tccn,u10n,v10n,tt2n,td2n,lsprecn,convprecn, & - sshfn,ssrn,sfcstressn,ustarn,wstarn,hmixn,tropopausen,olin,vdepn) + sshfn,ssrn,sfcstressn,ustarn,wstarn,hmixn,tropopausen,olin) deallocate(xresoln,yresoln,xln,yln,xrn,yrn) end subroutine dealloc_windfields_nest