Changeset 1070b4c in flexpart.git


Ignore:
Timestamp:
Aug 27, 2020, 9:51:56 PM (4 years ago)
Author:
Espen Sollum ATMOS <eso@…>
Branches:
GFS_025, dev
Children:
b0ecb61
Parents:
8c0ae9b (diff), a803521 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'espen' into dev

Location:
src
Files:
2 added
19 edited

Legend:

Unmodified
Added
Removed
  • src/com_mod.f90

    r07c3e71 ra756649  
    2525  !****************************************************************
    2626
    27   character :: path(numpath+2*maxnests)*120
     27  character :: path(numpath+2*maxnests)*200
    2828  integer :: length(numpath+2*maxnests)
    2929  character(len=256) :: pathfile, flexversion, flexversion_major, arg1, arg2
  • src/concoutput_mpi.f90

    r92fab65 ra803521  
    5959  real :: sp_fact
    6060  real :: outnum,densityoutrecept(maxreceptor),xl,yl
     61! RLT
     62  real :: densitydryrecept(maxreceptor)
     63  real :: factor_dryrecept(maxreceptor)
    6164
    6265!real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid),
     
    9396  character(LEN=8),save :: file_stat='REPLACE'
    9497  logical :: ldates_file
     98  logical :: lexist
    9599  integer :: ierr
    96100  character(LEN=100) :: dates_char
     
    194198        densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,mind)*dz1+ &
    195199             rho(iix,jjy,kzz-1,mind)*dz2)/dz
     200! RLT
     201        densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,mind)*dz1+ &
     202             rho_dry(iix,jjy,kzz-1,mind)*dz2)/dz 
    196203      end do
    197204    end do
     
    205212    !densityoutrecept(i)=rho(iix,jjy,1,2)
    206213    densityoutrecept(i)=rho(iix,jjy,1,mind)
     214! RLT
     215    densitydryrecept(i)=rho_dry(iix,jjy,1,mind)
    207216  end do
    208217
     218! RLT
     219! conversion factor for output relative to dry air
     220  factor_drygrid=densityoutgrid/densitydrygrid
     221  factor_dryrecept=densityoutrecept/densitydryrecept
    209222
    210223! Output is different for forward and backward simulations
     
    259272        write(unitoutgrid) itime
    260273      endif
    261 
    262274      if ((iout.eq.2).or.(iout.eq.3)) then      ! mixing ratio
    263275        open(unitoutgridppt,file=path(2)(1:length(2))//'grid_pptv_'//adate// &
    264276             atime//'_'//anspec,form='unformatted')
    265 
    266277        write(unitoutgridppt) itime
    267278      endif
     
    607618  end do
    608619
     620! RLT Aug 2017
     621! Write out conversion factor for dry air
     622  inquire(file=path(2)(1:length(2))//'factor_drygrid',exist=lexist)
     623  if (lexist) then
     624    ! open and append
     625    open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&
     626            status='old',action='write',access='append')
     627  else
     628    ! create new
     629    open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&
     630            status='new',action='write')
     631  endif
     632  sp_count_i=0
     633  sp_count_r=0
     634  sp_fact=-1.
     635  sp_zer=.true.
     636  do kz=1,numzgrid
     637    do jy=0,numygrid-1
     638      do ix=0,numxgrid-1
     639        if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then
     640          if (sp_zer.eqv..true.) then ! first value not equal to one
     641            sp_count_i=sp_count_i+1
     642            sparse_dump_i(sp_count_i)= &
     643                  ix+jy*numxgrid+kz*numxgrid*numygrid
     644            sp_zer=.false.
     645            sp_fact=sp_fact*(-1.)
     646          endif
     647          sp_count_r=sp_count_r+1
     648          sparse_dump_r(sp_count_r)= &
     649               sp_fact*factor_drygrid(ix,jy,kz)
     650        else ! factor is one
     651          sp_zer=.true.
     652        endif
     653      end do
     654    end do
     655  end do
     656  write(unitoutfactor) sp_count_i
     657  write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i)
     658  write(unitoutfactor) sp_count_r
     659  write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r)
     660  close(unitoutfactor)
     661
     662
    609663  if (gridtotal.gt.0.) gridtotalunc=gridsigmatotal/gridtotal
    610664  if (wetgridtotal.gt.0.) wetgridtotalunc=wetgridsigmatotal/ &
     
    633687  endif
    634688
    635 
     689! RLT Aug 2017
     690! Write out conversion factor for dry air
     691  if (numreceptor.gt.0) then
     692    inquire(file=path(2)(1:length(2))//'factor_dryreceptor',exist=lexist)
     693     if (lexist) then
     694     ! open and append
     695      open(unitoutfactor,file=path(2)(1:length(2))//'factor_dryreceptor',form='unformatted',&
     696              status='old',action='write',access='append')
     697    else
     698      ! create new
     699      open(unitoutfactor,file=path(2)(1:length(2))//'factor_dryreceptor',form='unformatted',&
     700              status='new',action='write')
     701    endif
     702    write(unitoutfactor) itime
     703    write(unitoutfactor) (factor_dryrecept(i),i=1,numreceptor)
     704    close(unitoutfactor)
     705  endif
    636706
    637707! Reinitialization of grid
  • src/concoutput_nest.f90

    r92fab65 ra803521  
    588588  close(unitoutfactor)
    589589
    590 
    591590  ! Reinitialization of grid
    592591  !*************************
  • src/concoutput_nest_mpi.f90

    r92fab65 ra803521  
    3939  !                                                                            *
    4040  !*****************************************************************************
    41 
    4241
    4342  use unc_mod
     
    5655  real :: sp_fact
    5756  real :: outnum,densityoutrecept(maxreceptor),xl,yl
     57! RLT
     58  real :: densitydryrecept(maxreceptor)
     59  real :: factor_dryrecept(maxreceptor)
    5860
    5961  !real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid),
     
    8284  character :: adate*8,atime*6
    8385  character(len=3) :: anspec
     86  logical :: lexist
    8487  integer :: mind
    8588! mind        eso:added to ensure identical results between 2&3-fields versions
     
    158161        densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,mind)*dz1+ &
    159162             rho(iix,jjy,kzz-1,mind)*dz2)/dz
     163! RLT
     164        densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,mind)*dz1+ &
     165             rho_dry(iix,jjy,kzz-1,mind)*dz2)/dz
    160166      end do
    161167    end do
     
    169175    !densityoutrecept(i)=rho(iix,jjy,1,2)
    170176    densityoutrecept(i)=rho(iix,jjy,1,mind)
     177! RLT
     178    densitydryrecept(i)=rho_dry(iix,jjy,1,mind)
    171179  end do
    172180
     181! RLT
     182! conversion factor for output relative to dry air
     183  factor_drygrid=densityoutgrid/densitydrygrid
     184  factor_dryrecept=densityoutrecept/densitydryrecept
    173185
    174186  ! Output is different for forward and backward simulations
     
    193205
    194206  write(anspec,'(i3.3)') ks
     207 
     208  if (DRYBKDEP.or.WETBKDEP) then !scavdep output
     209      if (DRYBKDEP) &
     210      open(unitoutgrid,file=path(2)(1:length(2))//'grid_drydep_nest_'//adate// &
     211           atime//'_'//anspec,form='unformatted')
     212      if (WETBKDEP) &
     213      open(unitoutgrid,file=path(2)(1:length(2))//'grid_wetdep_nest_'//adate// &
     214           atime//'_'//anspec,form='unformatted')
     215      write(unitoutgrid) itime
     216  else
    195217  if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then
    196218    if (ldirect.eq.1) then
     
    205227     write(unitoutgrid) itime
    206228   endif
     229  endif
    207230
    208231  if ((iout.eq.2).or.(iout.eq.3)) then      ! mixing ratio
     
    535558  end do
    536559
    537 
    538 
    539   ! Reinitialization of grid
    540   !*************************
    541 
    542   do ks=1,nspec
    543     do kp=1,maxpointspec_act
    544       do i=1,numreceptor
    545         creceptor(i,ks)=0.
    546       end do
    547       do jy=0,numygridn-1
    548         do ix=0,numxgridn-1
    549           do l=1,nclassunc
    550             do nage=1,nageclass
    551               do kz=1,numzgrid
    552                 griduncn(ix,jy,kz,ks,kp,l,nage)=0.
    553               end do
    554             end do
    555           end do
    556         end do
     560! RLT Aug 2017
     561! Write out conversion factor for dry air
     562  inquire(file=path(2)(1:length(2))//'factor_drygrid_nest',exist=lexist)
     563  if (lexist) then
     564    ! open and append
     565    open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',&
     566            status='old',action='write',access='append')
     567  else
     568    ! create new
     569    open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',&
     570            status='new',action='write')
     571  endif
     572  sp_count_i=0
     573  sp_count_r=0
     574  sp_fact=-1.
     575  sp_zer=.true.
     576  do kz=1,numzgrid
     577    do jy=0,numygridn-1
     578      do ix=0,numxgridn-1
     579        if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then
     580          if (sp_zer.eqv..true.) then ! first value not equal to one
     581            sp_count_i=sp_count_i+1
     582            sparse_dump_i(sp_count_i)= &
     583                  ix+jy*numxgridn+kz*numxgridn*numygridn
     584            sp_zer=.false.
     585            sp_fact=sp_fact*(-1.)
     586          endif
     587          sp_count_r=sp_count_r+1
     588          sparse_dump_r(sp_count_r)= &
     589               sp_fact*factor_drygrid(ix,jy,kz)
     590        else ! factor is one
     591          sp_zer=.true.
     592        endif
    557593      end do
    558594    end do
    559595  end do
    560 
     596  write(unitoutfactor) sp_count_i
     597  write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i)
     598  write(unitoutfactor) sp_count_r
     599  write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r)
     600  close(unitoutfactor)
     601
     602  ! Reinitialization of grid
     603  !*************************
     604
     605  ! do ks=1,nspec
     606  !   do kp=1,maxpointspec_act
     607  !     do i=1,numreceptor
     608  !       creceptor(i,ks)=0.
     609  !     end do
     610  !     do jy=0,numygridn-1
     611  !       do ix=0,numxgridn-1
     612  !         do l=1,nclassunc
     613  !           do nage=1,nageclass
     614  !             do kz=1,numzgrid
     615  !               griduncn(ix,jy,kz,ks,kp,l,nage)=0.
     616  !             end do
     617  !           end do
     618  !         end do
     619  !       end do
     620  !     end do
     621  !   end do
     622  ! end do
     623  creceptor(:,:)=0.
     624  griduncn(:,:,:,:,:,:,:)=0.
     625 
    561626  if (mp_measure_time) call mpif_mtime('iotime',1)
    562627  ! if (mp_measure_time) then
  • src/concoutput_surf_nest_mpi.f90

    r92fab65 ra803521  
    633633
    634634  do ks=1,nspec
    635   do kp=1,maxpointspec_act
    636     do i=1,numreceptor
    637       creceptor(i,ks)=0.
    638     end do
    639     do jy=0,numygridn-1
    640       do ix=0,numxgridn-1
    641         do l=1,nclassunc
    642           do nage=1,nageclass
    643             do kz=1,numzgrid
    644               griduncn(ix,jy,kz,ks,kp,l,nage)=0.
     635    do kp=1,maxpointspec_act
     636      do i=1,numreceptor
     637        creceptor(i,ks)=0.
     638      end do
     639      do jy=0,numygridn-1
     640        do ix=0,numxgridn-1
     641          do l=1,nclassunc
     642            do nage=1,nageclass
     643              do kz=1,numzgrid
     644                griduncn(ix,jy,kz,ks,kp,l,nage)=0.
     645              end do
    645646            end do
    646647          end do
     
    648649      end do
    649650    end do
    650   end do
    651651  end do
    652652
  • src/gributils/class_gribfile_mod.f90

    r61e07ba ra756649  
    7878        ! module
    7979
    80         USE grib_api
     80        use grib_api
    8181
    8282        IMPLICIT NONE
  • src/gridcheck_ecmwf.f90

    r3ea93bb ra803521  
    5555  !**********************************************************************
    5656
    57   use grib_api
     57  use eccodes
    5858  use par_mod
    5959  use com_mod
  • src/gridcheck_gfs.f90

    r92fab65 ra803521  
    5656  !**********************************************************************
    5757
    58   use grib_api
     58  use eccodes
    5959  use par_mod
    6060  use com_mod
  • src/gridcheck_nests.f90

    r92fab65 ra803521  
    1919  !*****************************************************************************
    2020
    21   use grib_api
     21  use eccodes
    2222  use par_mod
    2323  use com_mod
  • src/makefile

    rc56da45 r71f2128  
    6262        LIBPATH1 = ${ROOT_DIR}/lib
    6363else
    64 # Compiled libraries under user ~flexpart, gfortran v5.4
    65         ROOT_DIR = /homevip/flexpart/
    66 
     64# Using system installed libraries at njord.nilu.no
    6765        F90       = /usr/bin/gfortran
    6866        MPIF90    = /usr/bin/mpifort
    69 
    70         INCPATH1  = ${ROOT_DIR}/gcc-5.4.0/include       
     67        LIBPATH1 = /opt/eccodes/lib
     68        INCPATH1  = /opt/eccodes/include
    7169        INCPATH2  = /usr/include
    72         LIBPATH1 = ${ROOT_DIR}/gcc-5.4.0/lib
     70
     71
     72# INCPATH1  = /usr/include     
     73# INCPATH2  = /usr/include
    7374endif
    7475
     
    8889
    8990## OPTIMIZATION LEVEL
    90 O_LEV = 0 # [0,1,2,3,g,s,fast]
     91O_LEV = 2 # [0,1,2,3,g,s,fast]
    9192O_LEV_DBG = g # [0,g]
    9293
    9394## LIBRARIES
    94 #LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper -lnetcdff
    95 LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper $(NCOPT)
     95LIBS = -leccodes -leccodes_f90 -lm  $(NCOPT)
    9696
    9797FFLAGS   = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) $(NCOPT) $(FUSER)  #-Warray-bounds -fcheck=all # -march=native
     
    128128        redist.o                \
    129129        concoutput_surf.o       concoutput_surf_nest.o  \
    130         concoutput_inversion_nest.o     \
    131         concoutput_inversion.o \
    132130        getfields.o \
    133         readwind_ecmwf.o
     131        readwind_ecmwf.o \
     132        initial_cond_output.o \
     133        initial_cond_output_inversion.o
    134134
    135135## For MPI version
     
    145145        concoutput_surf_mpi.o   concoutput_surf_nest_mpi.o      \
    146146        getfields_mpi.o \
    147         readwind_ecmwf_mpi.o
     147        readwind_ecmwf_mpi.o \
     148        initial_cond_output_mpi.o \
     149        initial_cond_output_inversion_mpi.o
    148150
    149151OBJECTS_NCF = netcdf_output_mod.o
    150152
    151153OBJECTS = \
     154initial_cond_calc.o \
    152155advance.o               initialize.o            \
    153156writeheader.o           writeheader_txt.o       \
     
    202205drydepokernel_nest.o    zenithangle.o \
    203206ohreaction.o            getvdep_nests.o \
    204 initial_cond_calc.o     initial_cond_output.o initial_cond_output_inversion.o \
    205207dynamic_viscosity.o     get_settling.o  \
    206208initialize_cbl_vel.o    re_initialize_particle.o \
    207 cbl.o
     209cbl.o \
     210concoutput_inversion_nest.o     \
     211concoutput_inversion.o \
     212
    208213
    209214ifeq ($(ncf), yes)
     
    325330init_domainfill_mpi.o: com_mod.o mpi_mod.o par_mod.o point_mod.o random_mod.o
    326331initial_cond_calc.o: com_mod.o outg_mod.o par_mod.o unc_mod.o
     332initial_cond_calc_mpi.o: com_mod.o outg_mod.o par_mod.o unc_mod.o
    327333initial_cond_output.o: com_mod.o outg_mod.o par_mod.o point_mod.o unc_mod.o
     334initial_cond_output_mpi.o: com_mod.o outg_mod.o par_mod.o point_mod.o unc_mod.o mpi_mod.o
    328335initial_cond_output_inversion.o: com_mod.o outg_mod.o par_mod.o point_mod.o \
     336        unc_mod.o
     337initial_cond_output_inversion_mpi.o: com_mod.o outg_mod.o par_mod.o point_mod.o \
    329338        unc_mod.o
    330339initialize.o: com_mod.o hanna_mod.o interpol_mod.o par_mod.o random_mod.o
  • src/mpi_mod.f90

    r92fab65 ra803521  
    25792579601 end subroutine mpif_tm_reduce_grid_nest
    25802580
     2581
     2582  subroutine mpif_tm_reduce_initcond
     2583!***********************************************************************
     2584! Collect init_cond to PID 0, adding from all processes.
     2585!
     2586!
     2587!***********************************************************************
     2588    use com_mod
     2589    use unc_mod
     2590    use par_mod
     2591
     2592    implicit none
     2593
     2594    integer :: grid_size
     2595
     2596!**********************************************************************
     2597
     2598    grid_size=numxgrid*numygrid*numzgrid*maxspec* &
     2599         & maxpointspec_act
     2600
     2601! Time for MPI communications
     2602    if (mp_measure_time) call mpif_mtime('commtime',0)
     2603
     2604
     2605#ifdef USE_MPIINPLACE
     2606! Using in-place reduction
     2607    if (lroot) then
     2608      call MPI_Reduce(MPI_IN_PLACE, init_cond, grid_size, mp_sp, MPI_SUM, id_root, &
     2609           & mp_comm_used, mp_ierr)
     2610      if (mp_ierr /= 0) goto 600
     2611    else
     2612      call MPI_Reduce(init_cond, 0, grid_size, mp_sp, MPI_SUM, id_root, &
     2613           & mp_comm_used, mp_ierr)
     2614      if (mp_ierr /= 0) goto 600
     2615    end if
     2616
     2617#else
     2618    call MPI_Reduce(init_cond, init_cond0, grid_size, mp_sp, MPI_SUM, id_root, &
     2619         & mp_comm_used, mp_ierr)
     2620    if (mp_ierr /= 0) goto 600
     2621!    if (lroot) init_cond = init_cond0
     2622#endif
     2623
     2624    if (mp_measure_time) call mpif_mtime('commtime',1)
     2625
     2626    goto 601
     2627
     2628600 write(*,*) "mpi_mod> mp_ierr \= 0", mp_ierr
     2629    stop
     2630
     2631601 end subroutine mpif_tm_reduce_initcond
     2632   
    25812633
    25822634  subroutine mpif_mtime(ident,imode)
  • src/outgrid_init.f90

    r92fab65 ra803521  
    297297         maxpointspec_act),stat=stat)
    298298    if (stat.ne.0) write(*,*)'ERROR: could not allocate init_cond'
     299    if (mpi_mode.gt.0) then
     300      if (lroot) then
     301        allocate(init_cond0(0:numxgrid-1,0:numygrid-1,numzgrid,maxspec, &
     302             maxpointspec_act),stat=stat)
     303      else
     304        allocate(init_cond0(1,1,1,1,1))
     305      end if
     306    end if
    299307  endif
    300308
  • src/par_mod.f90

    r92fab65 ra803521  
    133133  ! ECMWF
    134134! integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92,nxshift=359 ! 1.0 degree 92 level
    135 !  integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=0 ! 1.0 degree 138 level
     135  integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=0 ! 1.0 degree 138 level
    136136!   integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=359 ! 1.0 degree 138 level
    137137! integer,parameter :: nxmax=721,nymax=361,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=359  ! 0.5 degree 138 level
     
    139139
    140140! GFS
    141    integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138
    142    integer :: nxshift=0 ! shift not fixed for the executable
     141   ! integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138
     142   ! integer :: nxshift=0 ! shift not fixed for the executable
    143143
    144144
     
    205205  !**************************************************
    206206
    207   integer,parameter :: maxpart=100000
    208   integer,parameter :: maxspec=1
     207  integer,parameter :: maxpart=10000000
     208  integer,parameter :: maxspec=6
    209209
    210210  real,parameter :: minmass=0.0001
  • src/readwind_ecmwf.f90

    r92fab65 ra803521  
    4848!**********************************************************************
    4949
    50   use grib_api
     50  use eccodes
    5151  use par_mod
    5252  use com_mod
  • src/readwind_gfs.f90

    r92fab65 ra803521  
    4747  !***********************************************************************
    4848
    49   use grib_api
     49  use eccodes
    5050  use par_mod
    5151  use com_mod
  • src/readwind_nests.f90

    r92fab65 ra803521  
    2222  !*****************************************************************************
    2323
    24   use grib_api
     24  use eccodes
    2525  use par_mod
    2626  use com_mod
  • src/timemanager.f90

    r92fab65 ra803521  
    9090  implicit none
    9191
     92  integer(selected_int_kind(16)) :: idummy,idummy2
    9293  integer :: metdata_format
    9394  integer :: j,ks,kp,l,n,itime=0,nstop,nstop1
    9495! integer :: ksp
    9596  integer :: loutnext,loutstart,loutend
    96   integer :: ix,jy,ldeltat,itage,nage,idummy
     97  integer :: ix,jy,ldeltat,itage,nage
    9798  integer :: i_nan=0,ii_nan,total_nan_intl=0  !added by mc to check instability in CBL scheme
    9899  real :: outnum,weight,prob_rec(maxspec),prob(maxspec),decfact,wetscav
     
    379380              call concoutput(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
    380381            endif
    381           else
     382          else ! surf only
    382383            if (verbosity.eq.1) then
    383              print*,'call concoutput_surf '
    384              call system_clock(count_clock)
    385              write(*,*) 'system clock',count_clock - count_clock0   
     384              print*,'call concoutput_surf '
     385              call system_clock(count_clock)
     386              write(*,*) 'system clock',count_clock - count_clock0   
    386387            endif
    387388            if (lnetcdfout.eq.1) then
     
    398399                endif
    399400              else
    400               call concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
     401                call concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
    401402              endif
    402403              if (verbosity.eq.1) then
     
    416417                  call concoutput_inversion_nest(itime,outnum)
    417418                else
    418                 call concoutput_surf_nest(itime,outnum)
    419               endif
     419                  call concoutput_surf_nest(itime,outnum)
     420                endif
    420421              endif
    421422            else
     
    581582       do ks=1,nspec
    582583         if  ((xscav_frac1(j,ks).lt.0)) then
    583             call get_wetscav(itime,lsynctime,loutnext,j,ks,grfraction,idummy,idummy,wetscav)
     584            call get_wetscav(itime,lsynctime,loutnext,j,ks,grfraction,idummy,idummy2,wetscav)
    584585            if (wetscav.gt.0) then
    585586                xscav_frac1(j,ks)=wetscav* &
  • src/timemanager_mpi.f90

    r92fab65 ra803521  
    9191  implicit none
    9292
     93  integer(selected_int_kind(16)) :: idummy,idummy2
    9394  integer :: metdata_format
    9495  logical :: reqv_state=.false. ! .true. if waiting for a MPI_Irecv to complete
     
    9798  integer :: ip,irec
    9899  integer :: loutnext,loutstart,loutend
    99   integer :: ix,jy,ldeltat,itage,nage,idummy
     100  integer :: ix,jy,ldeltat,itage,nage
    100101  integer :: i_nan=0,ii_nan,total_nan_intl=0  !added by mc to check instability in CBL scheme
    101102  integer :: numpart_tot_mpi ! for summing particles on all processes
     
    159160!********************************************************************
    160161
    161     if (mp_dbg_mode) write(*,*) 'myid, itime: ',mp_pid,itime
     162!    if (mp_dbg_mode) write(*,*) 'myid, itime: ',mp_pid,itime
    162163   
    163164    if (WETDEP .and. itime .ne. 0 .and. numpart .gt. 0) then
     
    280281
    281282    if (lmpreader.and.lmp_use_reader) then
    282       if (itime.lt.ideltas*ldirect) then
     283      if (abs(itime).lt.ideltas*ldirect) then
    283284        cycle
    284285      else
     
    480481              creceptor(:,:)=0.
    481482            end if
    482           else
     483          else ! surf only
    483484            if (lroot) then
    484485              if (lnetcdfout.eq.1) then
     
    488489#endif
    489490              else
    490                 call concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
     491                if (linversionout.eq.1) then
     492                  call concoutput_inversion(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
     493                else
     494                  call concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
     495                end if
    491496              end if
    492497            else
     
    516521
    517522              else
    518                 call concoutput_surf_nest(itime,outnum)
     523                if(linversionout.eq.1) then
     524                  if (lroot) then
     525                    call concoutput_inversion_nest(itime,outnum)
     526                  else
     527                    griduncn(:,:,:,:,:,:,:)=0.
     528                  end if
     529                else
     530                  if (lroot) then
     531                    call concoutput_surf_nest(itime,outnum)
     532                  else
     533                    griduncn(:,:,:,:,:,:,:)=0.
     534                  end if
     535                end if
    519536              end if
    520537            else
     
    724741       do ks=1,nspec
    725742         if  ((xscav_frac1(j,ks).lt.0)) then
    726             call get_wetscav(itime,lsynctime,loutnext,j,ks,grfraction,idummy,idummy,wetscav)
     743            call get_wetscav(itime,lsynctime,loutnext,j,ks,grfraction,idummy,idummy2,wetscav)
    727744            if (wetscav.gt.0) then
    728745                xscav_frac1(j,ks)=wetscav* &
     
    877894!*****************************************************************************
    878895
    879 ! eso :TODO: this not implemented yet (transfer particles to PID 0 or rewrite)
    880 ! the tools to do this are already in mpi_mod.f90
    881   if (lroot) then
    882     do j=1,numpart
    883       if (linit_cond.ge.1) call initial_cond_calc(itime,j)
    884     end do
    885   end if
    886 
    887 
     896  do j=1,numpart
     897    if (linit_cond.ge.1) call initial_cond_calc(itime,j)
     898  end do
     899
     900! Transfer sum of init_cond field to root process, for output
     901  call mpif_tm_reduce_initcond
     902   
    888903  if (ipout.eq.2) then
    889904! MPI process 0 creates the file, the other processes append to it
     
    897912  end if
    898913
    899 ! eso :TODO: MPI
    900   if (linit_cond.ge.1.and.lroot) call initial_cond_output(itime)   ! dump initial cond. field
     914 
     915  if (linit_cond.ge.1.and.lroot) then
     916    if(linversionout.eq.1) then
     917      call initial_cond_output_inversion(itime)   ! dump initial cond. field
     918    else
     919      call initial_cond_output(itime)   ! dump initial cond. fielf
     920    endif
     921  endif
    901922
    902923
  • src/unc_mod.f90

    r92fab65 ra803521  
    3535
    3636  real,allocatable, dimension (:,:,:,:,:) :: init_cond
     37  real,allocatable, dimension (:,:,:,:,:) :: init_cond0 ! for MPI
    3738
    3839end module unc_mod
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG