From 0f7835d03c332f5ff00577f23b0a0d791e42b9dc Mon Sep 17 00:00:00 2001
From: Espen Sollum ATMOS <eso@nilu.no>
Date: Wed, 3 Aug 2016 17:02:42 +0200
Subject: [PATCH] Changed a variable in domain-filling option (MPI). Deleted an
 unused function from mpi_mod.f90

---
 src/boundcond_domainfill_mpi.f90 |  8 ++--
 src/init_domainfill_mpi.f90      |  8 ++--
 src/mpi_mod.f90                  | 75 --------------------------------
 src/timemanager_mpi.f90          |  6 ---
 4 files changed, 8 insertions(+), 89 deletions(-)

diff --git a/src/boundcond_domainfill_mpi.f90 b/src/boundcond_domainfill_mpi.f90
index 66b1a9e1..22beaa2a 100644
--- a/src/boundcond_domainfill_mpi.f90
+++ b/src/boundcond_domainfill_mpi.f90
@@ -231,7 +231,7 @@ subroutine boundcond_domainfill(itime,loutend)
         endif
 
         do m=1,mmass
-          do ipart=minpart,maxpart
+          do ipart=minpart,maxpart_mpi
 
   ! If a vacant storage space is found, attribute everything to this array element
   !*****************************************************************************
@@ -330,7 +330,7 @@ subroutine boundcond_domainfill(itime,loutend)
               goto 73      ! Storage space has been found, stop searching
             endif
           end do
-          if (ipart.gt.maxpart) &
+          if (ipart.gt.maxpart_mpi) &
                stop 'boundcond_domainfill.f: too many particles required'
 73        minpart=ipart+1
 71        continue
@@ -463,7 +463,7 @@ subroutine boundcond_domainfill(itime,loutend)
         endif
 
         do m=1,mmass
-          do ipart=minpart,maxpart
+          do ipart=minpart,maxpart_mpi
 
   ! If a vacant storage space is found, attribute everything to this array element
   !*****************************************************************************
@@ -561,7 +561,7 @@ subroutine boundcond_domainfill(itime,loutend)
               goto 173      ! Storage space has been found, stop searching
             endif
           end do
-          if (ipart.gt.maxpart) &
+          if (ipart.gt.maxpart_mpi) &
                stop 'boundcond_domainfill.f: too many particles required'
 173       minpart=ipart+1
 171       continue
diff --git a/src/init_domainfill_mpi.f90 b/src/init_domainfill_mpi.f90
index b28068da..eb1183c3 100644
--- a/src/init_domainfill_mpi.f90
+++ b/src/init_domainfill_mpi.f90
@@ -304,12 +304,12 @@ subroutine init_domainfill
   end do
 
 
-! Check whether numpart is really smaller than maxpart
-!*****************************************************
+! Check whether numpart is really smaller than maxpart per process
+!*****************************************************************
 
-  if (numpart.gt.maxpart) then
+  if (numpart.gt.maxpart_mpi) then
     write(*,*) 'numpart too large: change source in init_atm_mass.f'
-    write(*,*) 'numpart: ',numpart,' maxpart: ',maxpart
+    write(*,*) 'numpart: ',numpart,' maxpart: ',maxpart_mpi
   endif
 
 
diff --git a/src/mpi_mod.f90 b/src/mpi_mod.f90
index 772a5ac7..4e20a81f 100644
--- a/src/mpi_mod.f90
+++ b/src/mpi_mod.f90
@@ -2443,79 +2443,4 @@ contains
 
     end subroutine write_data_dbg
 
-
-  subroutine set_fields_synthetic()
-!*******************************************************************************
-! DESCRIPTION
-!   Set all meteorological fields to synthetic (usually constant/homogeneous)
-!   values.
-!   Used for validation and error-checking
-!
-! NOTE
-!   This version uses asynchronious communications.
-!
-! VARIABLES
-!   
-!
-!
-!*******************************************************************************
-    use com_mod
-
-    implicit none
-
-    integer :: li=1, ui=2 ! wfmem indices (i.e, operate on entire field)
-
-    if (.not.lmp_sync) ui=3
-
-
-! Variables transferred at initialization only
-!*********************************************
-!    readclouds=readclouds_
-    oro(:,:)=0.0
-    excessoro(:,:)=0.0
-    lsm(:,:)=0.0
-    xlanduse(:,:,:)=0.0
-!    wftime
-!    numbwf
-!    nmixz
-!    height
-
-! Time-varying fields:
-    uu(:,:,:,li:ui) = 10.0
-    vv(:,:,:,li:ui) = 0.0
-    uupol(:,:,:,li:ui) = 10.0
-    vvpol(:,:,:,li:ui)=0.0
-    ww(:,:,:,li:ui)=0.
-    tt(:,:,:,li:ui)=300.
-    rho(:,:,:,li:ui)=1.3
-    drhodz(:,:,:,li:ui)=.0
-    tth(:,:,:,li:ui)=0.0
-    qvh(:,:,:,li:ui)=1.0
-    qv(:,:,:,li:ui)=1.0
-
-    pv(:,:,:,li:ui)=1.0
-    clouds(:,:,:,li:ui)=0
-
-    clwc(:,:,:,li:ui)=0.0
-    ciwc(:,:,:,li:ui)=0.0
-  
-! 2D fields
-
-    cloudsh(:,:,li:ui)=0
-    vdep(:,:,:,li:ui)=0.0
-    ps(:,:,:,li:ui)=1.0e5
-    sd(:,:,:,li:ui)=0.0
-    tcc(:,:,:,li:ui)=0.0
-    tt2(:,:,:,li:ui)=300.
-    td2(:,:,:,li:ui)=250.
-    lsprec(:,:,:,li:ui)=0.0
-    convprec(:,:,:,li:ui)=0.0
-    ustar(:,:,:,li:ui)=1.0
-    wstar(:,:,:,li:ui)=1.0
-    hmix(:,:,:,li:ui)=10000.
-    tropopause(:,:,:,li:ui)=10000.
-    oli(:,:,:,li:ui)=0.01
- 
-  end subroutine set_fields_synthetic
-
 end module mpi_mod
diff --git a/src/timemanager_mpi.f90 b/src/timemanager_mpi.f90
index 52d67115..40a118b6 100644
--- a/src/timemanager_mpi.f90
+++ b/src/timemanager_mpi.f90
@@ -274,12 +274,6 @@ subroutine timemanager
 
     if (mp_measure_time.and..not.(lmpreader.and.lmp_use_reader)) call mpif_mtime('getfields',1)
 
-! For validation and tests: call the function below to set all fields to simple
-! homogeneous values
-!    if (mp_dev_mode) call set_fields_synthetic
-
-!*******************************************************************************
-
     if (lmpreader.and.nstop1.gt.1) stop 'NO METEO FIELDS AVAILABLE'
 
 ! Reader process goes back to top of time loop (unless simulation end)
-- 
GitLab