diff --git a/.gitignore b/.gitignore index fff6f47..ca9ed71 100644 --- a/.gitignore +++ b/.gitignore @@ -13,13 +13,27 @@ *.grb1 *.grb2 dp-p[0-9]* + bin.block/example_modis_sst/* bin.block/example_reynolds_sst/* +bin.block/mk-blkfiles* +bin.block/CreateSSTblockfiles.sc +bin.block/run_test_sstfiles.sc + bin.dp.grib1/example_data/* +bin.dp.grib1/dgrib* +bin.dp.grib1/rams_wgrib + bin.dp.grib2/example_data/* -bin.revu/example_data/* bin.dp.grib2/wgrib* +bin.dp.grib2/dgrib* + +bin.revu/example_data/* +bin.revu/revu* + bin.rams/dprep.test/* +bin.rams/rams* +bin.rams/cleanup.sc # Ignore external libraries misc/* diff --git a/bin.block/Makefile b/bin.block/Makefile new file mode 100755 index 0000000..97e7c8b --- /dev/null +++ b/bin.block/Makefile @@ -0,0 +1,74 @@ +#Makefile +############################################################################### +# Include definitions +############################################################################### +include ../include.mk +############################################################################### +# Compiler commands +############################################################################### +INCLUDES = $(UTILS_INCS) $(PAR_INCS) $(HDF5_INCS) +F_CD1 = $(F_COMP) -c $(F_OPTS1) $(INCLUDES) +F_CD2 = $(F_COMP) -c $(F_OPTS2) $(INCLUDES) +C_CD = $(C_COMP) -c $(C_OPTS) $(INCLUDES) $(PAR_DEFS) $(HDF5_DEFS) + +C_CM =$(C_CD) -D$(CMACH) $< && $(ARCH) $@ $( module list - - Currently Loaded Modules: - 1) ncarenv/1.2 2) intel/17.0.1 3) ncarcompilers/0.4.1 4) slurm/17.02.4 - -Then save this state as your default: - - module save default - -Then log out and log back in again. You need to do all of the above steps in order to clear out a -bunch of variables that point to the built-in libraries (NCAR_LDFLAGS_*, specifically). - - - -Once the environment is set properly, untar the source code for the MPI libraries and run configure -(change --prefix path to where you want the libraries to be installed): - - ./configure --prefix=/glade/u/home/stephenh/Rams/misc/mpich2-1.4.1-install --disable-f77 -disable-fc --disable-cxx -enable-fast=O3 CPPFLAGS=-DNDEBUG --with-device=ch3:nemesis CC=icc FC=ifort F90= - -Then compile the MPI libraries: - - make - make install - -Compile the HDF5 libraries (set --prefix to where you want the libraries installed, and set the path -to mpicc accordingly): - - ./configure --prefix=/glade/u/home/stephenh/Rams/misc/hdf5-1.8.9-install --disable-fortran --disable-fortran2003 --enable-parallel CC=/glade/u/home/stephenh/Rams/misc/mpich2-1.4.1-install/bin/mpicc - make - make install - - -Then use the source code saved in rams_20171109_rce_6.2.08 to compile RAMS. Set the paths for -HDF5_ROOT and MPI_ROOT accordingly in the include.mk.cheyenne.mylibs file. - - diff --git a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/README_compile_cheyenne b/docs/ComputerDocs-Cheyenne/Scripts_and_Files/README_compile_cheyenne deleted file mode 100644 index 3e0b30f..0000000 --- a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/README_compile_cheyenne +++ /dev/null @@ -1,44 +0,0 @@ -I could not get the large channel sim to run on Cheyenne until I compiled our versions of the MPI -HDF5 libraries and linked to those (as opposed to the Cheyenne built-in libraries). - - - -In order to do compile our own HDF5 and MPI libriares, you need to clear paths to the -Cheyenne built-in libraries. Load/unload modules to get the following state: - - stephenh@cheyenne2:~/Rams/misc> module list - - Currently Loaded Modules: - 1) ncarenv/1.2 2) intel/17.0.1 3) ncarcompilers/0.4.1 4) slurm/17.02.4 - -Then save this state as your default: - - module save default - -Then log out and log back in again. You need to do all of the above steps in order to clear out a -bunch of variables that point to the built-in libraries (NCAR_LDFLAGS_*, specifically). - - - -Once the environment is set properly, untar the source code for the MPI libraries and run configure -(change --prefix path to where you want the libraries to be installed): - - ./configure --prefix=/glade/u/home/stephenh/Rams/misc/mpich2-1.4.1-install --disable-f77 -disable-fc --disable-cxx -enable-fast=O3 CPPFLAGS=-DNDEBUG --with-device=ch3:nemesis CC=icc FC=ifort F90= - -Then compile the MPI libraries: - - make - make install - -Compile the HDF5 libraries (set --prefix to where you want the libraries installed, and set the path -to mpicc accordingly): - - ./configure --prefix=/glade/u/home/stephenh/Rams/misc/hdf5-1.8.9-install --disable-fortran --disable-fortran2003 --enable-parallel CC=/glade/u/home/stephenh/Rams/misc/mpich2-1.4.1-install/bin/mpicc - make - make install - - -Then use the source code saved in rams_20171109_rce_6.2.08 to compile RAMS. Set the paths for -HDF5_ROOT and MPI_ROOT accordingly in the include.mk.cheyenne.mylibs file. - - diff --git a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/fix_file_timestamps b/docs/ComputerDocs-Cheyenne/Scripts_and_Files/fix_file_timestamps deleted file mode 100644 index 284b61e..0000000 --- a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/fix_file_timestamps +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/bash -# -# Script to fix timestamps on the RAMS analysis files. -# -# For some reason the HDF5 files are getting dated in the future -# which is subsequently causing the repack script to wait until -# that future date to compress the file. -# -# The header files are getting the correct timestamp. To fix -# this, use touch command to make the timestamp on each -# analysis file match that of its corresponding header -# file. - -RamsDir="$1" - -for Hfile in $(ls -1 $RamsDir/*-head.txt) -do - AfilePat=$(echo $Hfile | sed 's/-head.txt/-*.h5/') - Afiles=$(ls $AfilePat) - - echo "**********************************************************" - Cmd="touch -r $Hfile $Afiles" - echo "Running: $Cmd" - $Cmd -done diff --git a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/include.mk.cheyenne b/docs/ComputerDocs-Cheyenne/Scripts_and_Files/include.mk.cheyenne deleted file mode 100644 index 5d00dbb..0000000 --- a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/include.mk.cheyenne +++ /dev/null @@ -1,120 +0,0 @@ -############################################################################# -# Define make (gnu make works best) -############################################################################# -MAKE=/usr/bin/make - -############################################################################# -# Set your RAMS root path and version number -############################################################################# -RAMS_ROOT=/glade/u/home/stephenh/Rams/rams_20171109_rce_6.2.08 -RAMS_VERSION=6.2.08 - -#HDF5_ROOT=/glade/u/home/stephenh/Rams/misc/hdf5-1.8.9-install -#MPI_ROOT=/glade/u/home/stephenh/Rams/misc/mpich2-1.4.1-install - -MODEL=$(RAMS_ROOT)/src/$(RAMS_VERSION) -UTILS_INCS=-I$(MODEL)/include - -############################################################################# -# HDF libraries -# Note that linking libraries below are in a particular order to work! -############################################################################# -#HDF5_LIBS=-L$(HDF5_ROOT)/lib -lhdf5_hl -lhdf5 -lsz -lz -#HDF5_INCS=-I$(HDF5_ROOT)/include -#HDF5_DEFS= - -############################################################################# -# TYPE OF COMPUTER SYSTEM (used for DEFINE statements for intrinsic calls) -############################################################################# -CMACH=PC_LINUX1 #Standard Linux (only option available now) - -############################################################################# -# UNCOMMENT 1 LINUX FORTRAN COMPILER SET OF FLAGS BELOW -############################################################################# -# Note that some Fortran optimizations greater than -O1 will not necessarily -# produce identical results when running same executable multiple times. -# This is perhaps due to order of operations or unrolling loop order that -# changes solutions slightly. This is not ideal for research applications -# involving sensitivity studies that require exact duplication. As such, -# the Makefile is setup to allow different optimizations for different source -# files. The F_OPTS1 and F_OPTS2 variables below can hold different compiler -# flags as needed. Further, for duplication of results you may need to force -# IEEE standard which is done in examples below. -# Please coordinate variables below with the commands in the Makefile. -# Mandatory fortran variables are (F_COMP, F_OPTS1, F_OPTS2, LOADER,OPTS). - -#Definitions of compiler flags below -# F_COMP = path to compiler executable -# F_OPTS1 = Uses of flags for lower optimization for some files -# F_OPTS2 = Uses of flags for higher optimization for some files -# LOADER_OPTS = Flags and optimaztion for LOADER -# LIBS = Extra system libraries for linking that some compilers need - -#***************************** -# FOR INTEL IFORT COMPILER -#***************************** -# (-g) for debugging, (-traceback) for more compiler error info -# (-check bounds) for array bounds checking, (-fp-model precise) for IEEE -# (-check uninit) for finding uninitialized variables, (-free) for free format -F_COMP=mpif90 -F_OPTS=-free -static-intel -fp-model precise -traceback -march=corei7 -axAVX -#F_OPTS=-free -fp-model precise -traceback -static-intel -march=corei7 -axAVX -check bounds -check uninit -F_OPTS1=-O1 $(F_OPTS) -F_OPTS2=-O2 $(F_OPTS) -LOADER=$(F_COMP) -LOADER_OPTS=$(F_OPTS2) -#LOADER=./run_ld -#LOADER_OPTS= -#LIBS=-L/usr/lib/x86_64-linux-gnu -lrt - -#***************************** -# FOR PGI PGF90 COMPILER -#***************************** -# (-g) for debugging, (-Kieee) for IEEE, (-Mfree) for free format -#F_COMP=/usr/local/pgi/linux86-64/15.10/bin/pgf90 -#F_OPTS1=-Mfree -O1 -Kieee -#F_OPTS2=-Mfree -O2 -Kieee -#LOADER_OPTS=-Mfree -O2 -Kieee -#LIBS= - -#***************************** -# FOR GFORTRAN COMPILER -#***************************** -# (-Wall) for warnings, (-ffree-form) for free format -# (-fno-sign-zero) for not making zeros negative values -# (-fcheck=bounds) check for array bounds issues -# (-fcheck=all) all runtime checking -#F_COMP=/usr/bin/gfortran -#F_OPTS1=-ffree-form -O1 -#F_OPTS2=-ffree-form -O2 -#LOADER_OPTS=-ffree-form -O2 -#LIBS=-L/usr/lib/x86_64-linux-gnu -lrt -lpthread - -############################################################################# -# LINUX C compiler choice and flags (gcc) -############################################################################# -C_COMP=mpicc -C_OPTS=-O3 -DUNDERSCORE -DLITTLE - -############################################################################# -# System archive command syntax -############################################################################# -ARCH=ar rs - -############################################################################# -# MPI - parallel processing choices -############################################################################# -PAR_LIBS= #leave blank (override below if using MPI) -PAR_DEFS= #leave blank (override below if using MPI) -#---------------------------------------------------------------------------- -# If using MPI libraries: -#---------------------------------------------------------------------------- -#---------------LINUX MPICH---------------------------------------------------- -#PAR_INCS=-I$(MPI_ROOT)/include -#PAR_LIBS=-L$(MPI_ROOT)/lib -lmpich -lmpl -llmpe -PAR_DEFS=-DRAMS_MPI - -#---------------LINUX OPENMPI------------------------------------------------ -#PAR_INCS=-I$(MPI_ROOT)/include -#PAR_LIBS=-L$(MPI_ROOT)/lib -lmpi -#PAR_DEFS=-DRAMS_MPI diff --git a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/repack_files b/docs/ComputerDocs-Cheyenne/Scripts_and_Files/repack_files deleted file mode 100644 index 2e00507..0000000 --- a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/repack_files +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash - -############################################################################################## -# Script to repack (compress) HDF5 simulation output files - -Usage="USAGE: $0 " - -if [ "$1" == "" ] -then - echo "ERROR: must supply one argument to script" - echo "" - echo $Usage - exit -1 -fi - -RamsinFile=$1 - -GzipLevel=6 - -# Get the analysis file prefix out of the ramsin file, and use -# this for a pattern match to find the rams output files for this -# simulation. -# -# The first sed filter is to get rid of comments (don't want to pick up a commented -# out value for AFILEPREF) -FilePref=$(sed 's/[!].*//g' $RamsinFile | grep AFILEPREF | sed -e 's/.*=//' -e "s/[', \t]//g") - -for RamsFile in ${FilePref}*.h5 -do - echo "***************** $RamsFile ****************************" - NumGzipDsets=$(h5stat --dset $RamsFile | grep GZIP | sed 's/GZIP filter: //') - if [ $NumGzipDsets -gt 0 ] - then - echo "File is already compressed" - else - echo "File needs to be compressed" - - TempFile="${RamsFile}.temp" - RepackCmd="h5repack -f SHUF -f GZIP=$GzipLevel $RamsFile $TempFile" - echo "$RepackCmd" - $RepackCmd - - # only replace the original file if the repack command succeeded - if [ $? -eq 0 ] - then - MvCmd="mv $TempFile $RamsFile" - echo "$MvCmd" - $MvCmd - fi - fi -done - diff --git a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_job b/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_job deleted file mode 100644 index d925327..0000000 --- a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_job +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env bash - -############################################################################################## -# Script to automatically restart a RAMS simulation (HISTORY start). -# -# This is useful after starting the first run (RUNTYPE = 'INITIAL'), and you want -# to automatically fire off a new job via a history start (RUNTYPE = 'HISTORY'). - -Usage="USAGE: $0 " - -if [ $# != 3 ] -then - echo "ERROR: must supply exactly three arguments to script" - echo "" - echo $Usage - exit -1 -fi - -QsubScript=$1 -RamsFile=$2 -EndRamsFile=$3 - -echo "***************************************************************" -echo "Attempting to restart RAMS job" -echo " qsub script: $QsubScript" -echo " ramsin file: $RamsFile" -echo " end rams file: $EndRamsFile" -echo "" - -RamsFileTemplate="${RamsFile}.template" -if [ ! -f $RamsFileTemplate ] -then - echo "ERROR: cannot read RAMSIN template file: $RamsFileTemplate" - echo "" - echo $Usage - exit -2 -fi - -# Get the pbs job name from the qsub script file and see if the job is running. -# Unfortunately, the only way I know of getting the full job name is through -# the "qstat -f job_id" invocation of qstat. Doing less verbose options of qstat -# will truncate the name if longer than 11 or 15 characters. So, do an initial -# qstat to find the all of this users jobs that are in the queue, and check each -# one to see if it matches the full job name. -JobName=$(grep PBS $QsubScript | grep "\-N" | sed 's/.* //') -UserName=$(id -un) -NumJobsRunning=$( - for JobId in $(qstat -u $UserName | grep $UserName | sed 's/\..*//') - do - qstat -f $JobId | grep Job_Name | sed 's/.* //' - done | grep -c "^${JobName}$" - ) - -if [ $NumJobsRunning -gt 0 ] -then - echo "Job is still running, try again later" - exit 0 -fi - -# If we made it here, we are going to attempt a history start. -# -# Determine the file to use for the history start. Use either the last or next -# to last of the header files. The idea is that the RAMS analysis files are -# written before the header file so if a header file exists, the associated -# analysis files are intact. Ideally, you want to use the latest header file, -# but if the job died during the write of that header file, the restart won't -# work. If that's the case, the last header file will not match in size with -# the second to the last header file. In this case the second to last header -# file should be used for the restart. -# - If there are not at least two header files, then might as well do an -# initial run again. -# - If the sizes of the final two header files match, then use the final -# header file. -# - If the sizes don't match, use the second to last header file. - -# Get the analysis file prefix out of the RAMS file. -FilePref="$(sed 's/[!].*//g' $RamsFile | grep AFILEPREF | sed -e 's/.*=//' -e "s/[', \t]//g")-A-" - -# Set positional parameters to the final two header files. If there are < 2 files, -# then bail out. HeadFile1 will be the second to last file, HeadFile2 will be -# the last file. -set -- $(ls ${FilePref}*-head.txt | tail -n 2) -HeadFile1=$1 -HeadFile2=$2 -if [ "$HeadFile1" == "" ] || [ "$HeadFile2" == "" ] -then - echo "Not enough header files for a restart. Redo the INITIAL run." - exit 0 -fi - -# Get the sizes of the two header files. If sizes match, use header 2. -# If sizes don't match, use header 1. -SizeHF1=$(wc -c $HeadFile1 | sed 's/ .*//') -SizeHF2=$(wc -c $HeadFile2 | sed 's/ .*//') - -if [ $SizeHF1 -eq $SizeHF2 ] -then - RestartFile=$HeadFile2 -else - RestartFile=$HeadFile1 -fi - -# Check the restart file to see if it matches the end file. If so, then the -# job has completed in which case the restart is not necessary. -if [ "$RestartFile" == "$EndRamsFile" ] -then - echo "Job has completed, skipping restart." - exit 0 -fi - -# Change HFILIN to the new restart file in the RAMS file -# Use "@" for delimiter in the substitue command for sed below since -# RestartFile can contain slashes. -sed "s@@$RestartFile@g" $RamsFileTemplate > ${RamsFile}.temp -if [ $? -ne 0 ] -then - echo "Error occurred while attempting to change HFILIN in $RamsFile" - echo "Skipping the restart" - exit -3 -else - mv ${RamsFile}.temp $RamsFile -fi - -# Fire off the history restart -QsubCmd="qsub ./$QsubScript" - -echo "Restarting RAMS:" -echo " HFILIN: $RestartFile" -echo " Command: $QsubCmd" -echo "" - -$QsubCmd diff --git a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_rce_sims b/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_rce_sims deleted file mode 100644 index 9a45bfb..0000000 --- a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_rce_sims +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -############################################################################################## -# Script to restart a list of RCE simulations - -#SimList="RCE_3km_1mom_db_udef RCE_3km_1mom_db_rlongup RCE_3km_2mom_db_udef RCE_3km_2mom_db_rlongup" -SimList="RCE_CHAN_S300" - -echo "Restarting RCE simulations: $SimList" -echo - -for Sim in $SimList -do - cd $HOME/Sims/${Sim} - restart_job run_rams RAMSIN ./RAMS/${Sim}-A-2012-04-30-000000-head.txt - echo -done diff --git a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_tsd_1grid b/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_tsd_1grid deleted file mode 100644 index b4fbe9d..0000000 --- a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_tsd_1grid +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -############################################################################################## -# Script to restart the 1 grid TS Debby simulation - -#cd $HOME/Sims/TSD_SPIN_UP_1G -#restart_job run_rams RAMSIN.spin_up ./RAMS/TSD_SPIN_UP_1G-A-2006-08-22-060000-head.txt -cd $HOME/Sims/TSD_SD_1G -restart_job run_rams RAMSIN ./RAMS/TSD_SD_1G-A-2006-08-24-180000-head.txt diff --git a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_tsd_1km b/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_tsd_1km deleted file mode 100644 index adfe8b9..0000000 --- a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_tsd_1km +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -############################################################################################## -# Script to restart the 1 grid TS Debby simulation - -cd $HOME/Sims/TSD_SD_1KM -restart_job run_rams RAMSIN ./RAMS/TSD_SD_1G-A-2006-08-24-140000-head.txt diff --git a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_tsd_3grids b/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_tsd_3grids deleted file mode 100644 index 97a72fb..0000000 --- a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_tsd_3grids +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -############################################################################################## -# Script to restart the 3 grid TS Debby simulation - -#cd $HOME/Sims/TSD_SPIN_UP -#restart_job run_rams RAMSIN.spin_up ./RAMS/TSD_SPIN_UP-A-2006-08-22-060000-head.txt -cd $HOME/Sims/TSD_SD -restart_job run_rams RAMSIN ./RAMS/TSD_SD-A-2006-08-24-180000-head.txt diff --git a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_tsd_500m b/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_tsd_500m deleted file mode 100644 index 2f7903b..0000000 --- a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/restart_tsd_500m +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -############################################################################################## -# Script to restart the 1 grid TS Debby simulation - -cd $HOME/Sims/TSD_SD_500M -restart_job run_rams RAMSIN ./RAMS/TSD_SD_1G-A-2006-08-24-140000-head.txt diff --git a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/run_rams b/docs/ComputerDocs-Cheyenne/Scripts_and_Files/run_rams deleted file mode 100644 index 3022384..0000000 --- a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/run_rams +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -### Job Name -#PBS -N RceChS300 -### Project code -#PBS -A UCSU0054 -#PBS -l walltime=12:00:00 -#PBS -q economy -### Output and error files -#PBS -e LOG_FILES -#PBS -o LOG_FILES -### Select 42 nodes with 36 CPUs each for a total of 1512 MPI processes -### This yields an average of 397 columns/core -#PBS -l select=42:ncpus=36:mpiprocs=36 -### Send email on abort, begin and end -#PBS -m abe -### Specify mail recipient -#PBS -M stephen.herbener@colostate.edu - -### Run the executable -export MPI_TYPE_DEPTH=20 -#mpiexec_mpt dplace -s 1 ./rams -f RAMSIN -/glade/u/home/stephenh/Rams/misc/mpich2-1.4.1-install/bin/mpirun -np 1512 ./rams -f RAMSIN diff --git a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/x.repack.sh b/docs/ComputerDocs-Cheyenne/Scripts_and_Files/x.repack.sh deleted file mode 100644 index ef08f8a..0000000 --- a/docs/ComputerDocs-Cheyenne/Scripts_and_Files/x.repack.sh +++ /dev/null @@ -1,287 +0,0 @@ -#! /bin/bash -############################################################## -# Program: x.repack.sh -# Programmer: Robert Seigel -# University of Miami -# rseigel@rsmas.miami.edu -# 16 March 2013 -# Execute: x.repack.sh [] [] -# : surface or analysis MANDATORY -# []: MANDATORY if = analysis -# If using LSF job execution, then -# = Job Name -# If NOT using LSF job execution, then -# = 6.0-opt, if the -# executable is rams-6.0-opt -# []: OPTIONAL 3rd argument if RAMS has already -# finished and the user wants to repack all -# files in the supplied directory -# *** dummy argument 2 still required *** -# Purpose: This script repacks the HDF5 files while a distributive -# memory RAMS run is occurring. Because Parallel HDF5 is -# not yet supporting online compression, this script -# takes its place to conserve disk space. -# Overview: This script runs while RAMS is running. It first looks -# in RAMSIN to find where the files are being written. -# Then, it iteratively checks to see if new files are -# created. If a new file is output, it waits until the -# file is created and then uses h5repack to repack -# the HDF5 file. Once the RAMS processes are finished, -# x.repack.sh will terminate. -# -#****************************************************************** -# It is suggested to run this process in the background, as -# simulations often take a long time. To do so, here is an example: -# nohup x.repack.sh analysis 6.0-opt > repack.txt & -# This will execute x.repack.sh to repack the HDF5 analysis files -# that are output from rams-6.0-opt. The script output is placed -# in repack.txt for reference. -############################################################## - - -############################################################## -# FUNCTION to find the new file and repack it according to -# specified gzip level -repack () -{ - echo "Start repack" - - # Initialize some variables if this is our first entry into this routine - if [ $lastmod -eq 0 ]; then - newmod=0 - oldfsize=0 - fi - - # Loop over .h5 files in requested directory - for f in $thisdir*'.h5' - do - - # get time since file was last modified - modsecs=$(date --utc --reference=$f +%s) - nowsecs=$(date +%s) - delta=$(($nowsecs-$modsecs)) - filesize=$(stat -c%s "$f") - - # Test if the following are true in order to repack the file - # (1) Current file AGE is LE user-defined age threshold (filter out old sims) - # (2) Current file is EITHER (1) newer than previous file OR - # (2) larger than previous file - # (3) Current file SIZE is GT user-defined size threshold (filter out already - # repacked files) - if [[ $delta -le $repacksecs ]] && \ - [[ ( $modsecs -gt $lastmod || $filesize -gt $prevfilesize ) ]] && \ - [[ $filesize -gt $unpackFsize ]]; then - - # Wait UNTIL header file exists to make sure HDF5 write is done - if [ $runtype == "analysis" ]; then - hfile=${f:0:$((${#f}-5))}'head.txt' - - until [ -e $hfile ]; do sleep 1; done - - # Case where file is being overwritten - until [ ! $hfile -ot $f ]; do sleep 2; done - - # In case the header file is big - sleep 3 - fi - - # Repack the file - echo "h5repack -f SHUF -f GZIP=$gziplevel $f $f.temp" #***UNCOMMENT - h5repack -f SHUF -f GZIP=$gziplevel $f $f.temp #***UNCOMMENT - mv $f.temp $f #***UNCOMMENT - echo "New file $f has been repacked because it was created $delta secs ago" - newmod=$(date --utc --reference=$f +%s) - - # Now copy the file to a remote computer. RSA keys have already been generated. - #scp $f ldgrant@frost.atmos.colostate.edu:$supcelldir - #scp $hfile ldgrant@frost.atmos.colostate.edu:$supcelldir -# scp $f $copydir -# scp $hfile $copydir - - fi - prevfilesize=$(stat -c%s "$f") - - done - lastmod=$newmod -} -###################################################################################### -###################################################################################### -# ONLYEDIT THESE - -#set -x - -# Define some parameters -exectype=1 # Type of job execution. - # 1 = LSF - # 2 = Standard way, using a direct call to MPI -runtype=$1 # this is either surface or analysis from command line -ramsname=$2 # second command line input *MANDATORY for analysis* - # This is not used if exectype=1 -#repacksecs=108000 # maximum age in seconds of a file that is to be repacked (30 h) -repacksecs=1080000 # maximum age in seconds of a file that is to be repacked (30 h) -unpackFsize=5000 # megabyte threshold for unpacked file size (~ 5G) -#unpackFsize=1 # megabyte threshold for unpacked file size (~ 1M) -gziplevel=6 # gzip level -checkint=120 # in seconds -#supcelldir='/tasman/ldgrant/LPsup_300/' # Directory for file transfers -#copydir='ldgrant@frost.atmos.colostate.edu:/tasman/ldgrant/LPsup_300/z.'$2'/' # Directory for file transfers -#echo "copydir: $copydir" - -# END ONLYEDIT -###################################################################################### -###################################################################################### -# Perform some checks - -# Did the user input the process name during an analysis repack? -if [ "$ramsname" == "rams-" -a "$runtype" == "analysis" ]; then - echo 'Please specify the RAMS executable name, excluding rams-' - exit -fi -# Is the user exercising the 3rd argument? If so, dont read RAMSIN -if [ -z "$3" ]; then - RAMSINread=1 -else - RAMSINread=0 -fi -# Convert file size to megabytes -unpackFsize=$((unpackFsize*1024*1024)) - -############################################################## -# First Read RAMSIN to grab file locations -# This method is based on the fact that each RAMSIN parameter -# is preceeded by THREE SPACES. -if [ $RAMSINread -eq 1 ]; then - # TOPFILES - # find the line - topdir=`egrep '^ TOPFILES' RAMSIN` - # remove suffix from 2nd single quote - topdir=${topdir%\'*} - # remove prefix from 1st single quote - topdir=${topdir#*\'} - - # SFCFILES - sfcdir=`egrep '^ SFCFILES' RAMSIN` - sfcdir=${sfcdir%\'*} - sfcdir=${sfcdir#*\'} - - # SSTFILES - sstdir=`egrep '^ SSTFPFX' RAMSIN` - sstdir=${sstdir%\'*} - sstdir=${sstdir#*\'} - - # NDVIFILES - ndvidir=`egrep '^ NDVIFPFX' RAMSIN` - ndvidir=${ndvidir%\'*} - ndvidir=${ndvidir#*\'} - - # ANALFILES - analdir=`egrep '^ AFILEPREF' RAMSIN` - analdir=${analdir%\'*} - analdir=${analdir#*\'} -fi - -############################################################## -# Execute repacking of HDF5 files - -if [ -z "$3" ]; then - if [ "$runtype" == "surface" ]; then - - # topo files - lastmod=0 - thisdir=$topdir - repack - - # sfc files - lastmod=0 - thisdir=$sfcdir - repack - - # sst files - lastmod=0 - thisdir=$sstdir - repack - - # ndvi files - lastmod=0 - thisdir=$ndvidir - repack - - elif [ "$runtype" == "analysis" ]; then - - # Copy RAMSIN to the directory on frost - #scp RAMSIN ldgrant@frost.atmos.colostate.edu:$supcelldir -# scp RAMSIN $copydir - - - # analysis files - thisdir=$analdir - - # Determine job string for repack execution - if [ $exectype -eq 1 ]; then # LSF - jobout=$(bjobs | grep $ramsname | grep RUN 2>&1 | sed "s/ .*//") - elif [ $exectype -eq 2 ]; then # Standard - jobout=$(pidof -s $ramsname) - fi - echo "jobout1: $jobout" - - # Initialize filecounts. - # The repacking process can take a long time. During the repacking, files - # may be generated and the loop in 'repack' does not see them. These vars - # will test if new files have been created. - prefilecount=`ls -1 $thisdir*'.h5' | wc -l` - postfilecount=0 - echo "prefilecount, postfilecount: $prefilecount $postfilecount" - - # Continue to execute repack if (1) the model is running OR - # (2) the number of files have changed since - # last repack, i.e. new files were generated - lastmod=0 - while [[ -n "$jobout" ]] || [[ $prefilecount -ne $postfilecount ]] - do - - # Reset prefilecount before repack call - prefilecount=`ls -1 $thisdir*'.h5' | wc -l` - - # Execute the repack function. - repack - - # Regrab file count. If this number is different than prefilecount, the - # repack function will execute again - postfilecount=`ls -1 $thisdir*'.h5' | wc -l` - echo "prefilecount, postfilecount: $prefilecount $postfilecount" - - # execute time controller - sleep $checkint - - # Check again for job name to see if it finished - # Determine job string for repack execution - if [ $exectype -eq 1 ]; then # LSF - jobout=$(bjobs | grep $ramsname | grep RUN 2>&1) - elif [ $exectype -eq 2 ]; then # Standard - jobout=$(pidof -s $ramsname) - fi - echo "jobout2: $jobout" - done - # One final check after while loop to catch the ending file - #repack - - # We are done - echo $ramsname" finished and x.repack.sh is terminating" - else - echo "Runtype not recognized!" - echo "Runtype must be either 'surface' or 'analysis'" - exit - fi -else - lastmod=0 - repacksecs=31556900 # seconds in a year. If files are older, change. - thisdir=$3 # set directory to third argumemnt - repack - exit -fi - -exit - -############################################################### - - diff --git a/docs/ComputerDocs-Cheyenne/include.mk.cheyenne.mylibs b/docs/ComputerDocs-Cheyenne/include.mk.cheyenne.mylibs deleted file mode 100644 index 4372cd1..0000000 --- a/docs/ComputerDocs-Cheyenne/include.mk.cheyenne.mylibs +++ /dev/null @@ -1,117 +0,0 @@ -############################################################################# -# Define make (gnu make works best) -############################################################################# -MAKE=/usr/bin/make - -############################################################################# -# Set your RAMS root path and version number -############################################################################# -RAMS_ROOT=/glade/u/home/stephenh/Rams/rams_20171109_rce_6.2.08 -RAMS_VERSION=6.2.08 - -HDF5_ROOT=/glade/u/home/stephenh/Rams/misc/hdf5-1.8.9-install -MPI_ROOT=/glade/u/home/stephenh/Rams/misc/mpich2-1.4.1-install - -MODEL=$(RAMS_ROOT)/src/$(RAMS_VERSION) -UTILS_INCS=-I$(MODEL)/include - -############################################################################# -# HDF libraries -# Note that linking libraries below are in a particular order to work! -############################################################################# -HDF5_LIBS=-L$(HDF5_ROOT)/lib -lhdf5_hl -lhdf5 -lz -HDF5_INCS=-I$(HDF5_ROOT)/include -HDF5_DEFS= - -############################################################################# -# TYPE OF COMPUTER SYSTEM (used for DEFINE statements for intrinsic calls) -############################################################################# -CMACH=PC_LINUX1 #Standard Linux (only option available now) - -############################################################################# -# UNCOMMENT 1 LINUX FORTRAN COMPILER SET OF FLAGS BELOW -############################################################################# -# Note that some Fortran optimizations greater than -O1 will not necessarily -# produce identical results when running same executable multiple times. -# This is perhaps due to order of operations or unrolling loop order that -# changes solutions slightly. This is not ideal for research applications -# involving sensitivity studies that require exact duplication. As such, -# the Makefile is setup to allow different optimizations for different source -# files. The F_OPTS1 and F_OPTS2 variables below can hold different compiler -# flags as needed. Further, for duplication of results you may need to force -# IEEE standard which is done in examples below. -# Please coordinate variables below with the commands in the Makefile. -# Mandatory fortran variables are (F_COMP, F_OPTS1, F_OPTS2, LOADER,OPTS). - -#Definitions of compiler flags below -# F_COMP = path to compiler executable -# F_OPTS1 = Uses of flags for lower optimization for some files -# F_OPTS2 = Uses of flags for higher optimization for some files -# LOADER_OPTS = Flags and optimaztion for LOADER -# LIBS = Extra system libraries for linking that some compilers need - -#***************************** -# FOR INTEL IFORT COMPILER -#***************************** -# (-g) for debugging, (-traceback) for more compiler error info -# (-check bounds) for array bounds checking, (-fp-model precise) for IEEE -# (-check uninit) for finding uninitialized variables, (-free) for free format -F_COMP=ifort -F_OPTS=-free -static-intel -fp-model precise -traceback -march=corei7 -axAVX -F_OPTS1=-O1 $(F_OPTS) -F_OPTS2=-O2 $(F_OPTS) - -LOADER=$(F_COMP) -LOADER_OPTS=$(F_OPTS2) - -#***************************** -# FOR PGI PGF90 COMPILER -#***************************** -# (-g) for debugging, (-Kieee) for IEEE, (-Mfree) for free format -#F_COMP=/usr/local/pgi/linux86-64/15.10/bin/pgf90 -#F_OPTS1=-Mfree -O1 -Kieee -#F_OPTS2=-Mfree -O2 -Kieee -#LOADER_OPTS=-Mfree -O2 -Kieee -#LIBS= - -#***************************** -# FOR GFORTRAN COMPILER -#***************************** -# (-Wall) for warnings, (-ffree-form) for free format -# (-fno-sign-zero) for not making zeros negative values -# (-fcheck=bounds) check for array bounds issues -# (-fcheck=all) all runtime checking -#F_COMP=/usr/bin/gfortran -#F_OPTS1=-ffree-form -O1 -#F_OPTS2=-ffree-form -O2 -#LOADER_OPTS=-ffree-form -O2 -#LIBS=-L/usr/lib/x86_64-linux-gnu -lrt -lpthread - -############################################################################# -# LINUX C compiler choice and flags (gcc) -############################################################################# -C_COMP=$(MPI_ROOT)/bin/mpicc -C_OPTS=-O3 -DUNDERSCORE -DLITTLE - -############################################################################# -# System archive command syntax -############################################################################# -ARCH=ar rs - -############################################################################# -# MPI - parallel processing choices -############################################################################# -#PAR_LIBS= #leave blank (override below if using MPI) -#PAR_DEFS= #leave blank (override below if using MPI) -#---------------------------------------------------------------------------- -# If using MPI libraries: -#---------------------------------------------------------------------------- -#---------------LINUX MPICH---------------------------------------------------- -PAR_INCS=-I$(MPI_ROOT)/include -PAR_LIBS=-L$(MPI_ROOT)/lib -lmpich -lmpl -llmpe -lrt -PAR_DEFS=-DRAMS_MPI - -#---------------LINUX OPENMPI------------------------------------------------ -#PAR_INCS=-I$(MPI_ROOT)/include -#PAR_LIBS=-L$(MPI_ROOT)/lib -lmpi -#PAR_DEFS=-DRAMS_MPI diff --git a/docs/GridStruct3D.pdf b/docs/GridStruct3D.pdf new file mode 100644 index 0000000..7077f99 Binary files /dev/null and b/docs/GridStruct3D.pdf differ diff --git a/docs/GridStructXY.pdf b/docs/GridStructXY.pdf new file mode 100644 index 0000000..4ebefa9 Binary files /dev/null and b/docs/GridStructXY.pdf differ diff --git a/docs/GridStructXZ.pdf b/docs/GridStructXZ.pdf new file mode 100644 index 0000000..0fd9d38 Binary files /dev/null and b/docs/GridStructXZ.pdf differ diff --git a/docs/RAMS-Namelist.pdf b/docs/RAMS-Namelist.pdf index b1665e9..7b34e13 100644 Binary files a/docs/RAMS-Namelist.pdf and b/docs/RAMS-Namelist.pdf differ diff --git a/docs/RAMS-OutputVariablesREVU.pdf b/docs/RAMS-OutputVariablesREVU.pdf index 8db4d45..b9d4edb 100644 Binary files a/docs/RAMS-OutputVariablesREVU.pdf and b/docs/RAMS-OutputVariablesREVU.pdf differ diff --git a/docs/RAMS-Updates.pdf b/docs/RAMS-Updates.pdf index 4f50c52..8086d32 100644 Binary files a/docs/RAMS-Updates.pdf and b/docs/RAMS-Updates.pdf differ diff --git a/docs/RAMS-VariableList.pdf b/docs/RAMS-VariableList.pdf index 9b1c80e..19ca5a9 100644 Binary files a/docs/RAMS-VariableList.pdf and b/docs/RAMS-VariableList.pdf differ diff --git a/docs/RAMS-radiation-bands.pdf b/docs/RAMS-radiation-bands.pdf new file mode 100644 index 0000000..3ac851c Binary files /dev/null and b/docs/RAMS-radiation-bands.pdf differ diff --git a/docs/README-FIRST-RAMS.pdf b/docs/README-FIRST-RAMS.pdf index 0444e75..9adf835 100644 Binary files a/docs/README-FIRST-RAMS.pdf and b/docs/README-FIRST-RAMS.pdf differ diff --git a/include.mk b/include.mk index 47aaf10..acd56c7 100644 --- a/include.mk +++ b/include.mk @@ -1,3 +1,17 @@ +# NOTES: +# For doing parallel simulations, compile MPICH or OPENMPI with both FORTRAN +# and C bindings turned on like the following configure statement for +# compiling MPICH. Most of the time you enter the software package main +# directory, issue the "configure" command, run "make", and then "make install". +# For the configure statement to work, your ".bash_profile" needs to know "which" +# C and Fortran compilers you are using. After compiling MPICH in this example, +# it will create "mpif90" and "mpicc" that you can use in this include.mk file +# for "F_COMP" and "C_COMP" env variables below. Make sure the paths to these +# compilers and associated libraries are in your .bash_profile PATH and +# LD_LIBRARY_PATH as needed. +# ./configure --prefix=/file-path-here-for-mpi/mpich-3.3.2 \ +# --enable-fast=O3 CPPFLAGS=-DNDEBUG CC=gcc FC=ifort + ############################################################################# # Define make (gnu make works best). ############################################################################# @@ -6,8 +20,8 @@ MAKE=/usr/bin/make ############################################################################# # Set your RAMS root path and version number. ############################################################################# -RAMS_ROOT=/home/smsaleeb/rams_20210806_dev -RAMS_VERSION=6.3.02 +RAMS_ROOT=/home/smsaleeb/rams_git_dev +RAMS_VERSION=6.3.04 ############################################################################# # Set root locations for HDF5 I/O software. @@ -26,7 +40,7 @@ MPI_ROOT=/home/smsaleeb/software/mpich-3.3.2 ############################################################################# # Do not change these 2. They point from RAMS_ROOT to the source code. ############################################################################# -MODEL=$(RAMS_ROOT)/src/$(RAMS_VERSION) +MODEL=$(RAMS_ROOT)/src UTILS_INCS=-I$(MODEL)/include ############################################################################# @@ -78,7 +92,8 @@ CMACH=PC_LINUX1 #Standard Linux (only option available now) # (-g) for debugging, (-traceback) for more compiler error info # (-check bounds) for array bounds checking, (-fp-model precise) for IEEE # (-check uninit) for finding uninitialized variables, (-free) for free format -F_COMP=/home/smsaleeb/intel/composer_xe_2011_sp1.8.273/bin/intel64/ifort +#F_COMP=/home/smsaleeb/intel/composer_xe_2011_sp1.8.273/bin/intel64/ifort +F_COMP=/home/smsaleeb/software/mpich-3.3.2/bin/mpif90 F_OPTS1=-free -O1 -fp-model precise F_OPTS2=-free -O2 -fp-model precise LOADER_OPTS= -free -O2 -fp-model precise @@ -124,7 +139,7 @@ LIBS=-L/usr/lib/x86_64-linux-gnu -lrt -lpthread -lsz -lz ############################################################################# # C compiler choice and flags (gcc) and (mpicc) are most common # Add the "-DRAMS_DOUBLE_PREC" compiler flag to "C_OPTS" for turning on -# double precision rather than default double precision. Note that using +# double precision rather than default single precision. Note that using # double will make output and runtimes substantially longer but provide the # extra precision needed in some highly sensitive simulations. # @@ -141,7 +156,8 @@ LIBS=-L/usr/lib/x86_64-linux-gnu -lrt -lpthread -lsz -lz # that are not really as issue for us, but you can turn warnings back on by # removing the "-w" if you wish to alter code to eliminate warnings. ############################################################################# -C_COMP=gcc +#C_COMP=gcc +C_COMP=/home/smsaleeb/software/mpich-3.3.2/bin/mpicc C_OPTS=-O3 -DUNDERSCORE -DLITTLE -std=gnu99 -DENABLE_PARALLEL_COMPRESSION -w #C_OPTS=-O3 -DUNDERSCORE -DLITTLE -std=gnu99 -DRAMS_DOUBLE_PREC \ # -DENABLE_PARALLEL_COMPRESSION -w @@ -161,9 +177,10 @@ ARCH=ar rsU # software and HDF5 software. # Add or remove needed libraries to PAR_LIBS. Missing or needed libraries # will be highlighted in compile time error messages. Typical library -# specs are: -lmpich, -lmpl, -lmpi. +# specs are: -lmpich, -lmpl, -lmpi, -lmpifort # Comment out these "PAR_" lines for serial processing compile. ############################################################################# PAR_INCS=-I$(MPI_ROOT)/include -PAR_LIBS=-L$(MPI_ROOT)/lib -lmpich -lmpl +#PAR_LIBS=-L$(MPI_ROOT)/lib -lmpich -lmpl +PAR_LIBS=-L$(MPI_ROOT)/lib PAR_DEFS=-DRAMS_MPI diff --git a/src/6.3.02/bc/cyclic_mod.f90 b/src/bc/cyclic_mod.f90 similarity index 100% rename from src/6.3.02/bc/cyclic_mod.f90 rename to src/bc/cyclic_mod.f90 diff --git a/src/6.3.02/bc/rbnd.f90 b/src/bc/rbnd.f90 similarity index 92% rename from src/6.3.02/bc/rbnd.f90 rename to src/bc/rbnd.f90 index 7a5b8f1..e130876 100644 --- a/src/6.3.02/bc/rbnd.f90 +++ b/src/bc/rbnd.f90 @@ -13,12 +13,14 @@ Subroutine latbnd () ! and the recomputation of all boundary tendencies on nested grids ! after the first nested grid timestep. -if (nxtnest(ngrid) .eq. 0) then +! LDG, 11/2022: call boundary conditions on all grids for 1-way nesting +! Commented out check for grid number +!if (nxtnest(ngrid) .eq. 0) then ! Radiative and/or mesoscale compensation region lateral ! boundary conditions. - if (ibnd .eq. 1 .or. jbnd .eq. 1) then + if (ibnd .eq. 1 .or. jbnd .eq. 1 .or. ngrid .gt. 1) then CALL latnormv (mzp,mxp,myp,ibcon & ,basic_g(ngrid)%up (1,1,1) ,tend%ut (1) & @@ -27,7 +29,7 @@ Subroutine latbnd () endif -endif +!endif return END SUBROUTINE latbnd @@ -287,7 +289,9 @@ Subroutine vpsets () implicit none -if (nxtnest(ngrid) .eq. 0) then +! LDG, 11/2022: call boundary conditions on all grids for 1-way nesting +! Commented out check for grid number +!if (nxtnest(ngrid) .eq. 0) then CALL latset (mzp,mxp,myp,ia,iz,ja,jz,ibcon,'U' & ,basic_g(ngrid)%up (1,1,1) ,basic_g(ngrid)%up (1,1,1) & ,basic_g(ngrid)%vp (1,1,1) ,grid_g(ngrid)%dxu (1,1) & @@ -308,7 +312,7 @@ Subroutine vpsets () ,basic_g(ngrid)%vp (1,1,1) ,grid_g(ngrid)%dxu (1,1) & ,grid_g(ngrid)%dxm (1,1) ,grid_g(ngrid)%dyv (1,1) & ,grid_g(ngrid)%dym (1,1) ,'NULL') -endif +!endif if (nsttop .eq. 1) then CALL topset (mzp,mxp,myp,basic_g(ngrid)%up(1,1,1),'U') @@ -328,7 +332,9 @@ Subroutine vpsets () CALL dumset (mzp,mxp,myp,ibcon,basic_g(ngrid)%up(1,1,1),'U') CALL dumset (mzp,mxp,myp,ibcon,basic_g(ngrid)%vp(1,1,1),'V') -if (nxtnest(ngrid) .eq. 0) then +! LDG, 11/2022: call boundary conditions on all grids for 1-way nesting +! Commented out check for grid number +!if (nxtnest(ngrid) .eq. 0) then CALL latset (mzp,mxp,myp,ia,iz,ja,jz,ibcon,'U' & ,basic_g(ngrid)%uc (1,1,1) ,basic_g(ngrid)%up (1,1,1) & ,basic_g(ngrid)%vp (1,1,1) ,grid_g(ngrid)%dxu (1,1) & @@ -349,7 +355,7 @@ Subroutine vpsets () ,basic_g(ngrid)%vp (1,1,1) ,grid_g(ngrid)%dxu (1,1) & ,grid_g(ngrid)%dxm (1,1) ,grid_g(ngrid)%dyv (1,1) & ,grid_g(ngrid)%dym (1,1) ,'NULL') -endif +!endif if (nsttop .eq. 1) then CALL topset (mzp,mxp,myp,basic_g(ngrid)%uc(1,1,1),'U') @@ -398,13 +404,15 @@ Subroutine trsets () scalarp => scalar_tab(n,ngrid)%var_p scalart => scalar_tab(n,ngrid)%var_t - if (nxtnest(ngrid) .eq. 0) then + ! LDG, 11/2022: call boundary conditions on all grids for 1-way nesting + ! Commented out check for grid number + !if (nxtnest(ngrid) .eq. 0) then CALL latset (mzp,mxp,myp,ia,iz,ja,jz,ibcon,'TR' & ,scalarp ,basic_g(ngrid)%up (1,1,1) & ,basic_g(ngrid)%vp (1,1,1) ,grid_g(ngrid)%dxu (1,1) & ,grid_g(ngrid)%dxm (1,1) ,grid_g(ngrid)%dyv (1,1) & ,grid_g(ngrid)%dym (1,1) ,scalar_tab(n,ngrid)%name) - endif + !endif if (nsttop .eq. 1) & CALL topset (mzp,mxp,myp,scalarp,'T') @@ -430,7 +438,8 @@ Subroutine latset (m1,m2,m3,ia,iz,ja,jz,ibcon,vnam,ap,uc,vc,dxu,dxm,dyv,dym & implicit none -integer :: m1,m2,m3,ia,iz,ja,jz,ibcon,i,j,k,lbw,lbe,lbs,lbn,setlbcinit +integer :: m1,m2,m3,ia,iz,ja,jz,ibcon,i,j,k,lbw,lbe,lbs,lbn,setlbcinit & + ,lsflg_thisgrid,ibnd_thisgrid real :: thresh,dtlx,c1,dxr,dyr,atau real, dimension(m1,m2,m3) :: ap,uc,vc real, dimension(m2,m3) :: dxu,dxm,dyv,dym @@ -442,6 +451,20 @@ Subroutine latset (m1,m2,m3,ia,iz,ja,jz,ibcon,vnam,ap,uc,vc,dxu,dxm,dyv,dym & lbs=0 !Variable initialized lbn=0 !Variable initialized +! LDG 11/2022: variable lsflg_thisgrid is used in place of lsflg throughout +! this routine. We want to use conditions equivalent of lsflg=2 (constant +! inflow, radiative outflow) for ngrid>1: constant inflow leaves the +! boundary tendencies untouched for inflow conditions since boundary values +! for nests are handled in nstbtnd, and it allows features to pass smoothly +! out of the nest for outflow conditions, which is desirable for 1-way +! nesting setups. Note that this would need modification if 2-way nesting +! were ever re-introduced. +lsflg_thisgrid = lsflg +if (ngrid .gt. 1) lsflg_thisgrid = 2 +! Do the same for ibnd, since this routine can be called for all grids +ibnd_thisgrid = ibnd +if (ngrid .gt. 1) ibnd_thisgrid = 1 + if (iand(ibcon,1) .gt. 0) lbw = ia - 1 if (iand(ibcon,2) .gt. 0) lbe = iz + 1 if (iand(ibcon,4) .gt. 0) lbs = ja - 1 @@ -465,8 +488,8 @@ Subroutine latset (m1,m2,m3,ia,iz,ja,jz,ibcon,vnam,ap,uc,vc,dxu,dxm,dyv,dym & if(iaerolbc(ngrid)==1)then if( ((sname == 'CIFNP') .and. & (jnmb(3)>=5 .and. (iifn==1.or.iifn==2))) .or. & - ((sname == 'CCCNP' .or. sname == 'CCCMP' .or. & - sname == 'GCCNP' .or. sname == 'GCCMP') .and. & + ((sname == 'CN1NP' .or. sname == 'CN1MP' .or. & + sname == 'CN2NP' .or. sname == 'CN2MP') .and. & iaerosol==1) .or. & ((sname == 'MD1NP' .or. sname == 'MD1MP' .or. & sname == 'MD2NP' .or. sname == 'MD2MP') .and. & @@ -492,11 +515,11 @@ Subroutine latset (m1,m2,m3,ia,iz,ja,jz,ibcon,vnam,ap,uc,vc,dxu,dxm,dyv,dym & allocate(temp_v1(m1)) allocate(temp_v2(m1)) -if (ibnd .ne. 2 .and. vnam .ne. 'U' .and. lsflg .ne. 3) then +if (ibnd_thisgrid .ne. 2 .and. vnam .ne. 'U' .and. lsflg_thisgrid .ne. 3) then -! Western and Eastern boundaries for zero gradient option +! Western and Eastern boundaries for zero gradient option (grid 1 only) - if (lsflg .eq. 0) then + if (lsflg_thisgrid .eq. 0) then if (iand(ibcon,1) .gt. 0) then do j = 1,m3 do k = 1,m1 @@ -519,7 +542,7 @@ Subroutine latset (m1,m2,m3,ia,iz,ja,jz,ibcon,vnam,ap,uc,vc,dxu,dxm,dyv,dym & endif else -! Western boundary for lsflg = 1 or 2 +! Western boundary for lsflg = 1 or 2, or ngrid > 1 if (iand(ibcon,1) .gt. 0) then do j = 1,m3 @@ -563,7 +586,7 @@ Subroutine latset (m1,m2,m3,ia,iz,ja,jz,ibcon,vnam,ap,uc,vc,dxu,dxm,dyv,dym & else !radiative BC ap(k,lbw,j) = temp_v2(k) endif - elseif (lsflg .eq. 1) then + elseif (lsflg_thisgrid .eq. 1) then if(setlbcinit==1) then ap(k,ia,j) = ap(k,ia,j)+(ap(k,lbw,j)-ap(k,ia,j))*(dtlt/atau) endif @@ -573,7 +596,7 @@ Subroutine latset (m1,m2,m3,ia,iz,ja,jz,ibcon,vnam,ap,uc,vc,dxu,dxm,dyv,dym & enddo endif -! Eastern Boundary for LSFLG = 1 or 2 +! Eastern Boundary for LSFLG = 1 or 2, or ngrid > 1 if (iand(ibcon,2) .gt. 0) then do j = 1,m3 @@ -617,7 +640,7 @@ Subroutine latset (m1,m2,m3,ia,iz,ja,jz,ibcon,vnam,ap,uc,vc,dxu,dxm,dyv,dym & else !radiative BC ap(k,lbe,j) = temp_v2(k) endif - elseif (lsflg .eq. 1) then + elseif (lsflg_thisgrid .eq. 1) then if(setlbcinit==1) then ap(k,iz,j) = ap(k,iz,j)+(ap(k,lbe,j)-ap(k,iz,j))*(dtlt/atau) endif @@ -629,11 +652,11 @@ Subroutine latset (m1,m2,m3,ia,iz,ja,jz,ibcon,vnam,ap,uc,vc,dxu,dxm,dyv,dym & endif endif -if(jdim.eq.1.and.jbnd.ne.2.and.vnam.ne.'V'.and.lsflg.ne.3)then +if(jdim.eq.1.and.jbnd.ne.2.and.vnam.ne.'V'.and.lsflg_thisgrid.ne.3)then -! Southern and Northern boundaries for zero gradient option +! Southern and Northern boundaries for zero gradient option (grid 1 only) - if (lsflg .eq. 0) then + if (lsflg_thisgrid .eq. 0) then if (iand(ibcon,4) .gt. 0) then do i = 1,m2 do k = 1,m1 @@ -656,7 +679,7 @@ Subroutine latset (m1,m2,m3,ia,iz,ja,jz,ibcon,vnam,ap,uc,vc,dxu,dxm,dyv,dym & endif else -! Southern boundary for LSFLG = 1 or 2 +! Southern boundary for LSFLG = 1 or 2, or ngrid > 1 if (iand(ibcon,4) .gt. 0) then do i = 1,m2 @@ -700,7 +723,7 @@ Subroutine latset (m1,m2,m3,ia,iz,ja,jz,ibcon,vnam,ap,uc,vc,dxu,dxm,dyv,dym & else !radiative BC ap(k,i,lbs) = temp_v2(k) endif - elseif (lsflg .eq. 1) then + elseif (lsflg_thisgrid .eq. 1) then if(setlbcinit==1) then ap(k,i,ja) = ap(k,i,ja)+(ap(k,i,lbs)-ap(k,i,ja))*(dtlt/atau) endif @@ -710,7 +733,7 @@ Subroutine latset (m1,m2,m3,ia,iz,ja,jz,ibcon,vnam,ap,uc,vc,dxu,dxm,dyv,dym & enddo endif -! Northern Boundary for LSFLG = 1 or 2 +! Northern Boundary for LSFLG = 1 or 2, or ngrid > 1 if (iand(ibcon,8) .gt. 0) then do i = 1,m2 @@ -754,7 +777,7 @@ Subroutine latset (m1,m2,m3,ia,iz,ja,jz,ibcon,vnam,ap,uc,vc,dxu,dxm,dyv,dym & else !radiative BC ap(k,i,lbn) = temp_v2(k) endif - elseif (lsflg .eq. 1) then + elseif (lsflg_thisgrid .eq. 1) then if(setlbcinit==1) then ap(k,i,jz) = ap(k,i,jz)+(ap(k,i,lbn)-ap(k,i,jz))*(dtlt/atau) endif diff --git a/src/6.3.02/bc/rbnd_nonscalar.f90 b/src/bc/rbnd_nonscalar.f90 similarity index 96% rename from src/6.3.02/bc/rbnd_nonscalar.f90 rename to src/bc/rbnd_nonscalar.f90 index 1e3ede1..566416a 100644 --- a/src/6.3.02/bc/rbnd_nonscalar.f90 +++ b/src/bc/rbnd_nonscalar.f90 @@ -309,6 +309,10 @@ Subroutine micro_bcond (m1,m2,m3,micro,ibcon) micro%nucicert(k,1,j) = 0. micro%vapliqt(k,1,j) = 0. micro%vapicet(k,1,j) = 0. + micro%evapliqt(k,1,j) = 0. + micro%evapicet(k,1,j) = 0. + micro%freezingt(k,1,j) = 0. + micro%meltingt(k,1,j) = 0. micro%melticet(k,1,j) = 0. micro%rimecldt(k,1,j) = 0. micro%rain2icet(k,1,j) = 0. @@ -329,6 +333,14 @@ Subroutine micro_bcond (m1,m2,m3,micro,ibcon) micro%vapgraut(k,1,j) = 0. micro%vaphailt(k,1,j) = 0. micro%vapdrizt(k,1,j) = 0. + micro%evapcldt(k,1,j) = 0. + micro%evapraint(k,1,j) = 0. + micro%evapprist(k,1,j) = 0. + micro%evapsnowt(k,1,j) = 0. + micro%evapaggrt(k,1,j) = 0. + micro%evapgraut(k,1,j) = 0. + micro%evaphailt(k,1,j) = 0. + micro%evapdrizt(k,1,j) = 0. micro%meltprist(k,1,j) = 0. micro%meltsnowt(k,1,j) = 0. micro%meltaggrt(k,1,j) = 0. @@ -397,6 +409,10 @@ Subroutine micro_bcond (m1,m2,m3,micro,ibcon) micro%nucicert(k,m2,j) = 0. micro%vapliqt(k,m2,j) = 0. micro%vapicet(k,m2,j) = 0. + micro%evapliqt(k,m2,j) = 0. + micro%evapicet(k,m2,j) = 0. + micro%freezingt(k,m2,j) = 0. + micro%meltingt(k,m2,j) = 0. micro%melticet(k,m2,j) = 0. micro%rimecldt(k,m2,j) = 0. micro%rain2icet(k,m2,j) = 0. @@ -417,6 +433,14 @@ Subroutine micro_bcond (m1,m2,m3,micro,ibcon) micro%vapgraut(k,m2,j) = 0. micro%vaphailt(k,m2,j) = 0. micro%vapdrizt(k,m2,j) = 0. + micro%evapcldt(k,m2,j) = 0. + micro%evapraint(k,m2,j) = 0. + micro%evapprist(k,m2,j) = 0. + micro%evapsnowt(k,m2,j) = 0. + micro%evapaggrt(k,m2,j) = 0. + micro%evapgraut(k,m2,j) = 0. + micro%evaphailt(k,m2,j) = 0. + micro%evapdrizt(k,m2,j) = 0. micro%meltprist(k,m2,j) = 0. micro%meltsnowt(k,m2,j) = 0. micro%meltaggrt(k,m2,j) = 0. @@ -485,6 +509,10 @@ Subroutine micro_bcond (m1,m2,m3,micro,ibcon) micro%nucicert(k,i,1) = 0. micro%vapliqt(k,i,1) = 0. micro%vapicet(k,i,1) = 0. + micro%evapliqt(k,i,1) = 0. + micro%evapicet(k,i,1) = 0. + micro%freezingt(k,i,1) = 0. + micro%meltingt(k,i,1) = 0. micro%melticet(k,i,1) = 0. micro%rimecldt(k,i,1) = 0. micro%rain2icet(k,i,1) = 0. @@ -505,6 +533,14 @@ Subroutine micro_bcond (m1,m2,m3,micro,ibcon) micro%vapgraut(k,i,1) = 0. micro%vaphailt(k,i,1) = 0. micro%vapdrizt(k,i,1) = 0. + micro%evapcldt(k,i,1) = 0. + micro%evapraint(k,i,1) = 0. + micro%evapprist(k,i,1) = 0. + micro%evapsnowt(k,i,1) = 0. + micro%evapaggrt(k,i,1) = 0. + micro%evapgraut(k,i,1) = 0. + micro%evaphailt(k,i,1) = 0. + micro%evapdrizt(k,i,1) = 0. micro%meltprist(k,i,1) = 0. micro%meltsnowt(k,i,1) = 0. micro%meltaggrt(k,i,1) = 0. @@ -573,6 +609,10 @@ Subroutine micro_bcond (m1,m2,m3,micro,ibcon) micro%nucicert(k,i,m3) = 0. micro%vapliqt(k,i,m3) = 0. micro%vapicet(k,i,m3) = 0. + micro%evapliqt(k,i,m3) = 0. + micro%evapicet(k,i,m3) = 0. + micro%freezingt(k,i,m3) = 0. + micro%meltingt(k,i,m3) = 0. micro%melticet(k,i,m3) = 0. micro%rimecldt(k,i,m3) = 0. micro%rain2icet(k,i,m3) = 0. @@ -593,6 +633,14 @@ Subroutine micro_bcond (m1,m2,m3,micro,ibcon) micro%vapgraut(k,i,m3) = 0. micro%vaphailt(k,i,m3) = 0. micro%vapdrizt(k,i,m3) = 0. + micro%evapcldt(k,i,m3) = 0. + micro%evapraint(k,i,m3) = 0. + micro%evapprist(k,i,m3) = 0. + micro%evapsnowt(k,i,m3) = 0. + micro%evapaggrt(k,i,m3) = 0. + micro%evapgraut(k,i,m3) = 0. + micro%evaphailt(k,i,m3) = 0. + micro%evapdrizt(k,i,m3) = 0. micro%meltprist(k,i,m3) = 0. micro%meltsnowt(k,i,m3) = 0. micro%meltaggrt(k,i,m3) = 0. diff --git a/src/6.3.02/bc/rbnd_trsetsns.f90 b/src/bc/rbnd_trsetsns.f90 similarity index 100% rename from src/6.3.02/bc/rbnd_trsetsns.f90 rename to src/bc/rbnd_trsetsns.f90 diff --git a/src/6.3.02/block/hdf5_f2c.c b/src/block/hdf5_f2c.c similarity index 100% rename from src/6.3.02/block/hdf5_f2c.c rename to src/block/hdf5_f2c.c diff --git a/src/6.3.02/block/hdf5_utils.f90 b/src/block/hdf5_utils.f90 similarity index 100% rename from src/6.3.02/block/hdf5_utils.f90 rename to src/block/hdf5_utils.f90 diff --git a/src/6.3.02/block/mk_main.f90 b/src/block/mk_main.f90 similarity index 100% rename from src/6.3.02/block/mk_main.f90 rename to src/block/mk_main.f90 diff --git a/src/6.3.02/core/coriolis.f90 b/src/core/coriolis.f90 similarity index 100% rename from src/6.3.02/core/coriolis.f90 rename to src/core/coriolis.f90 diff --git a/src/6.3.02/core/modsched.f90 b/src/core/modsched.f90 similarity index 100% rename from src/6.3.02/core/modsched.f90 rename to src/core/modsched.f90 diff --git a/src/6.3.02/core/newbase.f90 b/src/core/newbase.f90 similarity index 100% rename from src/6.3.02/core/newbase.f90 rename to src/core/newbase.f90 diff --git a/src/6.3.02/core/raco.f90 b/src/core/raco.f90 similarity index 100% rename from src/6.3.02/core/raco.f90 rename to src/core/raco.f90 diff --git a/src/6.3.02/core/radvc.f90 b/src/core/radvc.f90 similarity index 99% rename from src/6.3.02/core/radvc.f90 rename to src/core/radvc.f90 index d04ced5..c82c8d4 100644 --- a/src/6.3.02/core/radvc.f90 +++ b/src/core/radvc.f90 @@ -92,7 +92,7 @@ Subroutine advectc (varn,mzp,mxp,myp,ia,iz,ja,jz,izu,jzv) !imono=1 option should be considered experimental. !May need bug fixing (Saleeby Oct 5, 2020). !pp and pm terms might not have density multiplied correctly. - imono = 0 + imono = 1 do n=1,num_scalar(ngrid) diff --git a/src/6.3.02/core/rammain.f90 b/src/core/rammain.f90 similarity index 100% rename from src/6.3.02/core/rammain.f90 rename to src/core/rammain.f90 diff --git a/src/6.3.02/core/rams_model.f90 b/src/core/rams_model.f90 similarity index 100% rename from src/6.3.02/core/rams_model.f90 rename to src/core/rams_model.f90 diff --git a/src/6.3.02/core/ref_sounding.f90 b/src/core/ref_sounding.f90 similarity index 100% rename from src/6.3.02/core/ref_sounding.f90 rename to src/core/ref_sounding.f90 diff --git a/src/6.3.02/core/rexev.f90 b/src/core/rexev.f90 similarity index 99% rename from src/6.3.02/core/rexev.f90 rename to src/core/rexev.f90 index 9572f80..77445b8 100644 --- a/src/6.3.02/core/rexev.f90 +++ b/src/core/rexev.f90 @@ -410,7 +410,7 @@ Subroutine exthvadv (mzp,mxp,myp,ia,iz,ja,jz,izu,jzv,thvadv) enddo enddo -imono = 0 !flag for monotonic flux limiter in Z only +imono = 1 !flag for monotonic flux limiter in Z only CALL fa_xc (mzp,mxp,myp,ia,iz & ,thetav,srthtv & diff --git a/src/6.3.02/core/rthrm.f90 b/src/core/rthrm.f90 similarity index 100% rename from src/6.3.02/core/rthrm.f90 rename to src/core/rthrm.f90 diff --git a/src/6.3.02/core/rtimh.f90 b/src/core/rtimh.f90 similarity index 100% rename from src/6.3.02/core/rtimh.f90 rename to src/core/rtimh.f90 diff --git a/src/6.3.02/core/rtimi.f90 b/src/core/rtimi.f90 similarity index 100% rename from src/6.3.02/core/rtimi.f90 rename to src/core/rtimi.f90 diff --git a/src/6.3.02/cuparm/conv_coms.f90 b/src/cuparm/conv_coms.f90 similarity index 100% rename from src/6.3.02/cuparm/conv_coms.f90 rename to src/cuparm/conv_coms.f90 diff --git a/src/6.3.02/cuparm/kf_cuparm.f90 b/src/cuparm/kf_cuparm.f90 similarity index 100% rename from src/6.3.02/cuparm/kf_cuparm.f90 rename to src/cuparm/kf_cuparm.f90 diff --git a/src/6.3.02/cuparm/kf_driver.f90 b/src/cuparm/kf_driver.f90 similarity index 100% rename from src/6.3.02/cuparm/kf_driver.f90 rename to src/cuparm/kf_driver.f90 diff --git a/src/6.3.02/cuparm/kf_rconv.f90 b/src/cuparm/kf_rconv.f90 similarity index 100% rename from src/6.3.02/cuparm/kf_rconv.f90 rename to src/cuparm/kf_rconv.f90 diff --git a/src/6.3.02/cuparm/rconv.f90 b/src/cuparm/rconv.f90 similarity index 100% rename from src/6.3.02/cuparm/rconv.f90 rename to src/cuparm/rconv.f90 diff --git a/src/6.3.02/dprep/dgrib1_main.f90 b/src/dprep/dgrib1_main.f90 similarity index 98% rename from src/6.3.02/dprep/dgrib1_main.f90 rename to src/dprep/dgrib1_main.f90 index bf5e956..d4fd724 100644 --- a/src/6.3.02/dprep/dgrib1_main.f90 +++ b/src/dprep/dgrib1_main.f90 @@ -16,7 +16,7 @@ Program griber ,nlev,slev,inproj,miss,startlev,endlev & ,iyyyy,imm,idd,ihh,fyyyy,fmm,fdd,fhh,leapyear & ,nvar3d,nvar2d,nvarsd,iplevs(1000),islevs(1000),datatype & - ,writesoillevs,writesnowlevs + ,writesoillevs,writesnowlevs,mx,plev1(1000),plev2(1000) real :: alat1,alon1,alat2,alon2,alov,aorient,dx,dy,reflat1,reflat2 & ,tinc,amiss,alatscr logical :: llisglobal,matched @@ -416,6 +416,22 @@ Program griber endif print*,'Number of Pressure Levels= ',nlev +!************************************************************************** +!Make sure the pressure levels are in descending order for correct output +!if not ordered properly in grib file - plev1, plev23, and mx added to +!integer variables declarations (Stephen Noble, SRNL) +plev1=iplevs +do i=1,nlev + mx=maxval(plev1) + plev2(i)=mx + do j=1,nlev + if (plev1(j)==mx) then + plev1(j)=-999 + endif + enddo +enddo +iplevs=plev2 + !************************************************************************** !Determine the number of SOIL levels we are going to use. !Only add soil (moisture and/or temperature) if the soil moisture is there. diff --git a/src/6.3.02/dprep/dgrib2_main.f90 b/src/dprep/dgrib2_main.f90 similarity index 98% rename from src/6.3.02/dprep/dgrib2_main.f90 rename to src/dprep/dgrib2_main.f90 index e945bdd..a5f1af8 100644 --- a/src/6.3.02/dprep/dgrib2_main.f90 +++ b/src/dprep/dgrib2_main.f90 @@ -16,7 +16,7 @@ Program griber ,nlev,slev,inproj,miss,startlev,endlev & ,iyyyy,imm,idd,ihh,fyyyy,fmm,fdd,fhh,leapyear & ,nvar3d,nvar2d,nvarsd,iplevs(1000),islevs(1000),datatype & - ,writesoillevs,writesnowlevs + ,writesoillevs,writesnowlevs,mx,plev1(1000),plev2(1000) real :: alat1,alon1,alat2,alon2,alov,aorient,dx,dy,reflat1,reflat2 & ,tinc,amiss,alatscr logical :: llisglobal,matched @@ -416,6 +416,22 @@ Program griber endif print*,'Number of Pressure Levels= ',nlev +!************************************************************************** +!Make sure the pressure levels are in descending order for correct output +!if not ordered properly in grib file - plev1, plev23, and mx added to +!integer variables declarations (Stephen Noble, SRNL) +plev1=iplevs +do i=1,nlev + mx=maxval(plev1) + plev2(i)=mx + do j=1,nlev + if (plev1(j)==mx) then + plev1(j)=-999 + endif + enddo +enddo +iplevs=plev2 + !************************************************************************** !Determine the number of SOIL levels we are going to use. !Only add soil (moisture and/or temperature) if the soil moisture is there. diff --git a/src/6.3.02/fdda/nud_analysis.f90 b/src/fdda/nud_analysis.f90 similarity index 100% rename from src/6.3.02/fdda/nud_analysis.f90 rename to src/fdda/nud_analysis.f90 diff --git a/src/6.3.02/fdda/oda_krig.f90 b/src/fdda/oda_krig.f90 similarity index 100% rename from src/6.3.02/fdda/oda_krig.f90 rename to src/fdda/oda_krig.f90 diff --git a/src/6.3.02/fdda/oda_nudge.f90 b/src/fdda/oda_nudge.f90 similarity index 100% rename from src/6.3.02/fdda/oda_nudge.f90 rename to src/fdda/oda_nudge.f90 diff --git a/src/6.3.02/fdda/oda_proc_obs.f90 b/src/fdda/oda_proc_obs.f90 similarity index 100% rename from src/6.3.02/fdda/oda_proc_obs.f90 rename to src/fdda/oda_proc_obs.f90 diff --git a/src/6.3.02/fdda/oda_read.f90 b/src/fdda/oda_read.f90 similarity index 100% rename from src/6.3.02/fdda/oda_read.f90 rename to src/fdda/oda_read.f90 diff --git a/src/6.3.02/fdda/oda_sta_count.f90 b/src/fdda/oda_sta_count.f90 similarity index 100% rename from src/6.3.02/fdda/oda_sta_count.f90 rename to src/fdda/oda_sta_count.f90 diff --git a/src/6.3.02/fdda/oda_sta_input.f90 b/src/fdda/oda_sta_input.f90 similarity index 100% rename from src/6.3.02/fdda/oda_sta_input.f90 rename to src/fdda/oda_sta_input.f90 diff --git a/src/6.3.02/fdda/varf_read.f90 b/src/fdda/varf_read.f90 similarity index 100% rename from src/6.3.02/fdda/varf_read.f90 rename to src/fdda/varf_read.f90 diff --git a/src/6.3.02/fdda/varf_update.f90 b/src/fdda/varf_update.f90 similarity index 100% rename from src/6.3.02/fdda/varf_update.f90 rename to src/fdda/varf_update.f90 diff --git a/src/6.3.02/gdf/gdf_input.f90 b/src/gdf/gdf_input.f90 similarity index 100% rename from src/6.3.02/gdf/gdf_input.f90 rename to src/gdf/gdf_input.f90 diff --git a/src/6.3.02/gdf/gdf_read_sfc.f90 b/src/gdf/gdf_read_sfc.f90 similarity index 100% rename from src/6.3.02/gdf/gdf_read_sfc.f90 rename to src/gdf/gdf_read_sfc.f90 diff --git a/src/6.3.02/gdf/gdf_read_upa.f90 b/src/gdf/gdf_read_upa.f90 similarity index 100% rename from src/6.3.02/gdf/gdf_read_upa.f90 rename to src/gdf/gdf_read_upa.f90 diff --git a/src/6.3.02/include/revu_sub_names.h b/src/include/revu_sub_names.h similarity index 100% rename from src/6.3.02/include/revu_sub_names.h rename to src/include/revu_sub_names.h diff --git a/src/6.3.02/include/sub_gribnames.h b/src/include/sub_gribnames.h similarity index 100% rename from src/6.3.02/include/sub_gribnames.h rename to src/include/sub_gribnames.h diff --git a/src/6.3.02/include/utils_sub_names.h b/src/include/utils_sub_names.h similarity index 100% rename from src/6.3.02/include/utils_sub_names.h rename to src/include/utils_sub_names.h diff --git a/src/6.3.02/init/data_init.f90 b/src/init/data_init.f90 similarity index 100% rename from src/6.3.02/init/data_init.f90 rename to src/init/data_init.f90 diff --git a/src/6.3.02/init/gridset.f90 b/src/init/gridset.f90 similarity index 100% rename from src/6.3.02/init/gridset.f90 rename to src/init/gridset.f90 diff --git a/src/6.3.02/init/rams_grid.f90 b/src/init/rams_grid.f90 similarity index 100% rename from src/6.3.02/init/rams_grid.f90 rename to src/init/rams_grid.f90 diff --git a/src/6.3.02/init/rdint.f90 b/src/init/rdint.f90 similarity index 97% rename from src/6.3.02/init/rdint.f90 rename to src/init/rdint.f90 index b71579f..2649903 100644 --- a/src/6.3.02/init/rdint.f90 +++ b/src/init/rdint.f90 @@ -159,13 +159,13 @@ Subroutine initlz () ! Reset aerosols on history initialization if((initial==1 .or. initial==2 .or. (initial==3.and.iaerohist==1)) & .and. level<=3) then - if(iaerosol > 0) CALL init_ccn (mzp,mxp,myp & - ,micro_g(ifm)%cccnp (1,1,1) & - ,micro_g(ifm)%cccmp (1,1,1) & + if(iaerosol > 0) CALL init_ccn1 (mzp,mxp,myp & + ,micro_g(ifm)%cn1np (1,1,1) & + ,micro_g(ifm)%cn1mp (1,1,1) & ,basic_g(ifm)%dn0 (1,1,1),ifm) - if(iaerosol > 0) CALL init_gccn (mzp,mxp,myp & - ,micro_g(ifm)%gccnp (1,1,1) & - ,micro_g(ifm)%gccmp (1,1,1) & + if(iaerosol > 0) CALL init_ccn2 (mzp,mxp,myp & + ,micro_g(ifm)%cn2np (1,1,1) & + ,micro_g(ifm)%cn2mp (1,1,1) & ,basic_g(ifm)%dn0 (1,1,1),ifm) if(idust > 0) CALL init_dust (mzp,mxp,myp & ,micro_g(ifm)%md1np (1,1,1) & diff --git a/src/6.3.02/init/rhhi.f90 b/src/init/rhhi.f90 similarity index 100% rename from src/6.3.02/init/rhhi.f90 rename to src/init/rhhi.f90 diff --git a/src/6.3.02/init/rinit.f90 b/src/init/rinit.f90 similarity index 100% rename from src/6.3.02/init/rinit.f90 rename to src/init/rinit.f90 diff --git a/src/6.3.02/io/anal_extra.f90 b/src/io/anal_extra.f90 similarity index 100% rename from src/6.3.02/io/anal_extra.f90 rename to src/io/anal_extra.f90 diff --git a/src/6.3.02/io/anal_write.f90 b/src/io/anal_write.f90 similarity index 100% rename from src/6.3.02/io/anal_write.f90 rename to src/io/anal_write.f90 diff --git a/src/6.3.02/io/history_start.f90 b/src/io/history_start.f90 similarity index 100% rename from src/6.3.02/io/history_start.f90 rename to src/io/history_start.f90 diff --git a/src/6.3.02/io/inithis.f90 b/src/io/inithis.f90 similarity index 100% rename from src/6.3.02/io/inithis.f90 rename to src/io/inithis.f90 diff --git a/src/6.3.02/io/io_params.f90 b/src/io/io_params.f90 similarity index 100% rename from src/6.3.02/io/io_params.f90 rename to src/io/io_params.f90 diff --git a/src/6.3.02/io/opspec.f90 b/src/io/opspec.f90 similarity index 100% rename from src/6.3.02/io/opspec.f90 rename to src/io/opspec.f90 diff --git a/src/6.3.02/io/ranlavg.f90 b/src/io/ranlavg.f90 similarity index 100% rename from src/6.3.02/io/ranlavg.f90 rename to src/io/ranlavg.f90 diff --git a/src/6.3.02/io/rcio.f90 b/src/io/rcio.f90 similarity index 100% rename from src/6.3.02/io/rcio.f90 rename to src/io/rcio.f90 diff --git a/src/6.3.02/io/rname.f90 b/src/io/rname.f90 similarity index 97% rename from src/6.3.02/io/rname.f90 rename to src/io/rname.f90 index 25bafea..b0038ef 100644 --- a/src/6.3.02/io/rname.f90 +++ b/src/io/rname.f90 @@ -25,7 +25,7 @@ Subroutine nvfillm (group,vr,ii,ff,cc,nv) real :: ff integer :: ii,nv integer :: inrflg -integer, parameter ::nvgrid=37,nvstrt=77,nvindat=145,nvsound=10 +integer, parameter ::nvgrid=37,nvstrt=77,nvindat=147,nvsound=10 integer :: igrids(nvgrid),istart(nvstrt),iindat(nvindat),isound(nvsound) character(len=16) :: grids(nvgrid),start(nvstrt),indat(nvindat),sound(nvsound) data igrids/nvgrid*0/,istart/nvstrt*0/,iindat/nvindat*0/,isound/nvsound*0/ @@ -54,7 +54,8 @@ Subroutine nvfillm (group,vr,ii,ff,cc,nv) ,'ISSTFN','IVEGTFN','ISOILFN','NDVIFN','ITOPSFLG','TOPTENH' & ,'TOPTWVL','IZ0FLG','Z0MAX','Z0FACT'/ DATA INDAT/ & - 'ICORFLG','IBND','JBND','CPHAS','LSFLG','NFPT','DISTIM','ISWRTYP' & + 'ICORFLG','IBND','JBND','ISPONGE_PTS','SPONGE_TAU','CPHAS','LSFLG' & + ,'NFPT','DISTIM','ISWRTYP' & ,'ILWRTYP','RADFRQ','LONRAD','NNQPARM','CONFRQ','WCLDBS','IKPP' & ,'NKPPZ','FRQKPP','RELAX_SST','RELAX_OCNT','RELAX_SAL','DMAXKPP' & ,'DSCALEKPP','KPPITERMAX','KPPRNT','UBMN_KPP','NPATCH','NVEGPAT' & @@ -71,8 +72,8 @@ Subroutine nvfillm (group,vr,ii,ff,cc,nv) ,'IGRAUP','IHAIL','CPARM','DPARM','RPARM','PPARM','SPARM','APARM' & ,'GPARM','HPARM','GNU','HUCMFILE','NDTCOLL','IAEROSOL','ISALT' & ,'IDUST','IDUSTLOFT','DUSTFILE','ICCNLEV','IIFN','IIFN_FORMULA' & - ,'IAERORAD','IAERODEP','IAEROPRNT','IAEROHIST','CIN_MAX','CCN_MAX' & - ,'GCCN_MAX','DUST1_MAX','DUST2_MAX','SALTF_MAX','SALTJ_MAX' & + ,'IAERORAD','IAERODEP','IAEROPRNT','IAEROHIST','CIN_MAX','CCN1_MAX' & + ,'CCN2_MAX','DUST1_MAX','DUST2_MAX','SALTF_MAX','SALTJ_MAX' & ,'SALTS_MAX','IAEROLBC','ICO2LBC','BCTAU','IAERO_CHEM' & ,'AERO_EPSILON','AERO_MEDRAD','ITRKEPSILON','ITRKDUST' & ,'ITRKDUSTIFN','SCMTIME','ISCMX','ISCMY','FRACSAT','IABCARB' & @@ -237,6 +238,8 @@ END SUBROUTINE varseti IF(VR.EQ.'ICORFLG') CALL varseti (VR,ICORFLG,NV,1,II,0,1) IF(VR.EQ.'IBND') CALL varseti (VR,IBND,NV,1,II,1,2) IF(VR.EQ.'JBND') CALL varseti (VR,JBND,NV,1,II,1,2) + IF(VR.EQ.'ISPONGE_PTS') CALL varseti (VR,ISPONGE_PTS(NV),NV,MAXGRDS,II,0,100) + IF(VR.EQ.'SPONGE_TAU') CALL varsetf (VR,SPONGE_TAU(NV),NV,MAXGRDS,FF,0.,43200.) IF(VR.EQ.'CPHAS') CALL varsetf (VR,CPHAS,NV,1,FF,.001,1.E8) IF(VR.EQ.'LSFLG') CALL varseti (VR,LSFLG,NV,1,II,0,3) IF(VR.EQ.'NFPT') CALL varseti (VR,NFPT,NV,1,II,0,10000) @@ -360,9 +363,9 @@ END SUBROUTINE varseti IF(VR.EQ.'IAERODEP') CALL varseti (VR,IAERODEP,NV,1,II,0,1) IF(VR.EQ.'IAEROPRNT') CALL varseti (VR,IAEROPRNT,NV,1,II,0,1) IF(VR.EQ.'IAEROHIST') CALL varseti (VR,IAEROHIST,NV,1,II,0,1) - IF(VR.EQ.'CIN_MAX') CALL varsetf (VR,CIN_MAX,NV,1,FF,0.,1.E4) - IF(VR.EQ.'CCN_MAX') CALL varsetf (VR,CCN_MAX,NV,1,FF,0.,1.E4) - IF(VR.EQ.'GCCN_MAX') CALL varsetf (VR,GCCN_MAX,NV,1,FF,0.,1.E4) + IF(VR.EQ.'CIN_MAX') CALL varsetf (VR,CIN_MAX,NV,1,FF,-2.,1.E3) + IF(VR.EQ.'CCN1_MAX') CALL varsetf (VR,CCN1_MAX,NV,1,FF,0.,1.E4) + IF(VR.EQ.'CCN2_MAX') CALL varsetf (VR,CCN2_MAX,NV,1,FF,0.,1.E4) IF(VR.EQ.'DUST1_MAX') CALL varsetf (VR,DUST1_MAX,NV,1,FF,0.,1.E4) IF(VR.EQ.'DUST2_MAX') CALL varsetf (VR,DUST2_MAX,NV,1,FF,0.,1.E4) IF(VR.EQ.'ABC1_MAX') CALL varsetf (VR,ABC1_MAX,NV,1,FF,0.,1.E4) @@ -426,7 +429,7 @@ Subroutine nameout () ,ISSTFLG(NG),IVEGTFLG(NG),NG=1,NGRIDS) WRITE(6,104)(' ',ISOILFLG(NG),NDVIFLG(NG) & ,NNQPARM(NG),IDIFFK(NG),NG=1,NGRIDS) -WRITE(6,105)(' ',IAEROLBC(NG),ICO2LBC(NG) & +WRITE(6,105)(' ',IAEROLBC(NG),ICO2LBC(NG),ISPONGE_PTS(NG) & ,NG=1,NGRIDS) 101 FORMAT(A1,' NNXP=',I4,' NNYP=',I4,' NNZP=',I4 & @@ -438,7 +441,7 @@ Subroutine nameout () 104 FORMAT(A1,'ISOILFLG=',I4,' NDVIFLG=',I4 & ,' NNQPARM=',I4,' IDIFFK=',I4,999(A1,/,I14,3I16)) 105 FORMAT(A1,'IAEROLBC=',I4,' ICO2LBC=',I4 & - ,999(A1,/,I14,1I16)) + ,' ISPONGE_PT=',I4,999(A1,/,I14,2I16)) PRINT*, ' ' @@ -604,8 +607,8 @@ Subroutine nameout () ,'GPARM=',GPARM & ,'HPARM=',HPARM & ,'CIN_MAX=',CIN_MAX & - ,'CCN_MAX=',CCN_MAX & - ,'GCCN_MAX=',GCCN_MAX & + ,'CCN1_MAX=',CCN1_MAX & + ,'CCN2_MAX=',CCN2_MAX & ,'DUST1_MAX=',DUST1_MAX & ,'DUST2_MAX=',DUST2_MAX & ,'ABC1_MAX=',ABC1_MAX & @@ -620,14 +623,14 @@ Subroutine nameout () WRITE(6,301)(' ',TOPTENH(NG),TOPTWVL(NG),CENTLAT(NG),NG=1,NGRIDS) WRITE(6,302)(' ',CENTLON(NG),CSX(NG),CSZ(NG),NG=1,NGRIDS) WRITE(6,303)(' ',XKHKM(NG),ZKHKM(NG),AKMIN(NG),NG=1,NGRIDS) -WRITE(6,304)(' ',BCTAU(NG),NG=1,NGRIDS) +WRITE(6,304)(' ',BCTAU(NG),SPONGE_TAU(NG),NG=1,NGRIDS) 301 FORMAT(A1,'TOPTENH=',E12.5,' TOPTWVL=',E12.5 & ,' CENTLAT=',E12.5,999(A1,/,E21.5,2E28.5)) 302 FORMAT(A1,'CENTLON=',E12.5,' CSX=',E12.5 & ,' CSZ=',E12.5,999(A1,/,E21.5,2E28.5)) 303 FORMAT(A1,' XKHKM=',E12.5,' ZKHKM=',E12.5 & ,' AKMIN=',E12.5,999(A1,/,E21.5,2E28.5)) -304 FORMAT(A1,' BCTAU=',E12.5,999(A1,/,E21.5)) +304 FORMAT(A1,' BCTAU=',E12.5' SPONGE_TAU=',E12.5,999(A1,/,E21.5,E28.5)) PRINT*, ' ' @@ -780,7 +783,7 @@ Subroutine namein (IUNIT,GROUP) NVARN=0 CALL findgr (IUNIT,GROUP) DO 10 NR=1,MAXREC - READ(IUNIT,'(A80)',END=100)LINE + READ(IUNIT,'(A256)',END=100)LINE CALL strip (LINE,LINEW,NCW) NCW=MAX(NCW,1) CALL toknze (LINEW,NCW,TOKENS,NTOK) diff --git a/src/6.3.02/io/rprnt.f90 b/src/io/rprnt.f90 similarity index 100% rename from src/6.3.02/io/rprnt.f90 rename to src/io/rprnt.f90 diff --git a/src/6.3.02/isan/aobj.f90 b/src/isan/aobj.f90 similarity index 100% rename from src/6.3.02/isan/aobj.f90 rename to src/isan/aobj.f90 diff --git a/src/6.3.02/isan/asgen.f90 b/src/isan/asgen.f90 similarity index 100% rename from src/6.3.02/isan/asgen.f90 rename to src/isan/asgen.f90 diff --git a/src/6.3.02/isan/asti.f90 b/src/isan/asti.f90 similarity index 100% rename from src/6.3.02/isan/asti.f90 rename to src/isan/asti.f90 diff --git a/src/6.3.02/isan/asti2.f90 b/src/isan/asti2.f90 similarity index 100% rename from src/6.3.02/isan/asti2.f90 rename to src/isan/asti2.f90 diff --git a/src/6.3.02/isan/astp.f90 b/src/isan/astp.f90 similarity index 100% rename from src/6.3.02/isan/astp.f90 rename to src/isan/astp.f90 diff --git a/src/6.3.02/isan/avarf.f90 b/src/isan/avarf.f90 similarity index 100% rename from src/6.3.02/isan/avarf.f90 rename to src/isan/avarf.f90 diff --git a/src/6.3.02/isan/file_inv.f90 b/src/isan/file_inv.f90 similarity index 100% rename from src/6.3.02/isan/file_inv.f90 rename to src/isan/file_inv.f90 diff --git a/src/6.3.02/isan/isan_coms.f90 b/src/isan/isan_coms.f90 similarity index 100% rename from src/6.3.02/isan/isan_coms.f90 rename to src/isan/isan_coms.f90 diff --git a/src/6.3.02/isan/isan_io.f90 b/src/isan/isan_io.f90 similarity index 100% rename from src/6.3.02/isan/isan_io.f90 rename to src/isan/isan_io.f90 diff --git a/src/6.3.02/isan/isan_name.f90 b/src/isan/isan_name.f90 similarity index 99% rename from src/6.3.02/isan/isan_name.f90 rename to src/isan/isan_name.f90 index 472f372..bc28c07 100644 --- a/src/6.3.02/isan/isan_name.f90 +++ b/src/isan/isan_name.f90 @@ -117,7 +117,7 @@ Subroutine namein_isan (IUNIT,GROUP) NVARN=0 CALL findgr (IUNIT,GROUP) DO 10 NR=1,MAXREC - READ(IUNIT,'(A80)',END=100)LINE + READ(IUNIT,'(A256)',END=100)LINE CALL strip (LINE,LINEW,NCW) NCW=MAX(NCW,1) CALL toknze (LINEW,NCW,TOKENS,NTOK) diff --git a/src/6.3.02/isan/refstate.f90 b/src/isan/refstate.f90 similarity index 100% rename from src/6.3.02/isan/refstate.f90 rename to src/isan/refstate.f90 diff --git a/src/6.3.02/isan/v_interps.f90 b/src/isan/v_interps.f90 similarity index 100% rename from src/6.3.02/isan/v_interps.f90 rename to src/isan/v_interps.f90 diff --git a/src/6.3.02/isan/write_varf.f90 b/src/isan/write_varf.f90 similarity index 100% rename from src/6.3.02/isan/write_varf.f90 rename to src/isan/write_varf.f90 diff --git a/src/6.3.02/kpp/kpp_coeffs.f90 b/src/kpp/kpp_coeffs.f90 similarity index 100% rename from src/6.3.02/kpp/kpp_coeffs.f90 rename to src/kpp/kpp_coeffs.f90 diff --git a/src/6.3.02/kpp/kpp_init.f90 b/src/kpp/kpp_init.f90 similarity index 100% rename from src/6.3.02/kpp/kpp_init.f90 rename to src/kpp/kpp_init.f90 diff --git a/src/6.3.02/kpp/kpp_mix.f90 b/src/kpp/kpp_mix.f90 similarity index 100% rename from src/6.3.02/kpp/kpp_mix.f90 rename to src/kpp/kpp_mix.f90 diff --git a/src/6.3.02/kpp/kpp_ocint.f90 b/src/kpp/kpp_ocint.f90 similarity index 100% rename from src/6.3.02/kpp/kpp_ocint.f90 rename to src/kpp/kpp_ocint.f90 diff --git a/src/6.3.02/kpp/kpp_override.f90 b/src/kpp/kpp_override.f90 similarity index 100% rename from src/6.3.02/kpp/kpp_override.f90 rename to src/kpp/kpp_override.f90 diff --git a/src/6.3.02/kpp/kpp_params.f90 b/src/kpp/kpp_params.f90 similarity index 100% rename from src/6.3.02/kpp/kpp_params.f90 rename to src/kpp/kpp_params.f90 diff --git a/src/6.3.02/kpp/kpp_timestep.f90 b/src/kpp/kpp_timestep.f90 similarity index 100% rename from src/6.3.02/kpp/kpp_timestep.f90 rename to src/kpp/kpp_timestep.f90 diff --git a/src/6.3.02/kpp/kpp_typexfer.f90 b/src/kpp/kpp_typexfer.f90 similarity index 100% rename from src/6.3.02/kpp/kpp_typexfer.f90 rename to src/kpp/kpp_typexfer.f90 diff --git a/src/6.3.02/lib/an_header.f90 b/src/lib/an_header.f90 similarity index 100% rename from src/6.3.02/lib/an_header.f90 rename to src/lib/an_header.f90 diff --git a/src/6.3.02/lib/charutils.f90 b/src/lib/charutils.f90 similarity index 100% rename from src/6.3.02/lib/charutils.f90 rename to src/lib/charutils.f90 diff --git a/src/6.3.02/lib/dateutils.f90 b/src/lib/dateutils.f90 similarity index 100% rename from src/6.3.02/lib/dateutils.f90 rename to src/lib/dateutils.f90 diff --git a/src/6.3.02/lib/griber_grb1.c b/src/lib/griber_grb1.c similarity index 100% rename from src/6.3.02/lib/griber_grb1.c rename to src/lib/griber_grb1.c diff --git a/src/6.3.02/lib/griber_grb2.c b/src/lib/griber_grb2.c similarity index 100% rename from src/6.3.02/lib/griber_grb2.c rename to src/lib/griber_grb2.c diff --git a/src/6.3.02/lib/hdf5_f2c.c b/src/lib/hdf5_f2c.c similarity index 100% rename from src/6.3.02/lib/hdf5_f2c.c rename to src/lib/hdf5_f2c.c diff --git a/src/6.3.02/lib/hdf5_utils.f90 b/src/lib/hdf5_utils.f90 similarity index 100% rename from src/6.3.02/lib/hdf5_utils.f90 rename to src/lib/hdf5_utils.f90 diff --git a/src/6.3.02/lib/interp_lib.f90 b/src/lib/interp_lib.f90 similarity index 100% rename from src/6.3.02/lib/interp_lib.f90 rename to src/lib/interp_lib.f90 diff --git a/src/6.3.02/lib/map_proj.f90 b/src/lib/map_proj.f90 similarity index 100% rename from src/6.3.02/lib/map_proj.f90 rename to src/lib/map_proj.f90 diff --git a/src/6.3.02/lib/numutils.f90 b/src/lib/numutils.f90 similarity index 100% rename from src/6.3.02/lib/numutils.f90 rename to src/lib/numutils.f90 diff --git a/src/6.3.02/lib/parlib.c b/src/lib/parlib.c similarity index 100% rename from src/6.3.02/lib/parlib.c rename to src/lib/parlib.c diff --git a/src/6.3.02/lib/polarst.f90 b/src/lib/polarst.f90 similarity index 100% rename from src/6.3.02/lib/polarst.f90 rename to src/lib/polarst.f90 diff --git a/src/6.3.02/lib/rconstants.f90 b/src/lib/rconstants.f90 similarity index 100% rename from src/6.3.02/lib/rconstants.f90 rename to src/lib/rconstants.f90 diff --git a/src/6.3.02/lib/rget.F90 b/src/lib/rget.F90 similarity index 100% rename from src/6.3.02/lib/rget.F90 rename to src/lib/rget.F90 diff --git a/src/6.3.02/lib/rnamel.f90 b/src/lib/rnamel.f90 similarity index 100% rename from src/6.3.02/lib/rnamel.f90 rename to src/lib/rnamel.f90 diff --git a/src/6.3.02/lib/rsys.F90 b/src/lib/rsys.F90 similarity index 100% rename from src/6.3.02/lib/rsys.F90 rename to src/lib/rsys.F90 diff --git a/src/6.3.02/lib/therm_lib.f90 b/src/lib/therm_lib.f90 similarity index 100% rename from src/6.3.02/lib/therm_lib.f90 rename to src/lib/therm_lib.f90 diff --git a/src/6.3.02/lib/utils_c.c b/src/lib/utils_c.c similarity index 100% rename from src/6.3.02/lib/utils_c.c rename to src/lib/utils_c.c diff --git a/src/6.3.02/lib/utils_f.f90 b/src/lib/utils_f.f90 similarity index 100% rename from src/6.3.02/lib/utils_f.f90 rename to src/lib/utils_f.f90 diff --git a/src/6.3.02/memory/alloc.f90 b/src/memory/alloc.f90 similarity index 100% rename from src/6.3.02/memory/alloc.f90 rename to src/memory/alloc.f90 diff --git a/src/6.3.02/memory/grid_dims.f90 b/src/memory/grid_dims.f90 similarity index 100% rename from src/6.3.02/memory/grid_dims.f90 rename to src/memory/grid_dims.f90 diff --git a/src/6.3.02/memory/grid_struct.f90 b/src/memory/grid_struct.f90 similarity index 100% rename from src/6.3.02/memory/grid_struct.f90 rename to src/memory/grid_struct.f90 diff --git a/src/6.3.02/memory/mem_all.f90 b/src/memory/mem_all.f90 similarity index 100% rename from src/6.3.02/memory/mem_all.f90 rename to src/memory/mem_all.f90 diff --git a/src/6.3.02/memory/mem_basic.f90 b/src/memory/mem_basic.f90 similarity index 100% rename from src/6.3.02/memory/mem_basic.f90 rename to src/memory/mem_basic.f90 diff --git a/src/6.3.02/memory/mem_cuparm.f90 b/src/memory/mem_cuparm.f90 similarity index 100% rename from src/6.3.02/memory/mem_cuparm.f90 rename to src/memory/mem_cuparm.f90 diff --git a/src/6.3.02/memory/mem_grid.f90 b/src/memory/mem_grid.f90 similarity index 99% rename from src/6.3.02/memory/mem_grid.f90 rename to src/memory/mem_grid.f90 index ff18d06..af30da4 100644 --- a/src/6.3.02/memory/mem_grid.f90 +++ b/src/memory/mem_grid.f90 @@ -98,8 +98,10 @@ Module mem_grid !--------------------------------------------------------------------------- !------------------------------------------------------------------------------- integer :: lsflg,ibnd,jbnd,icorflg,nfpt + integer, dimension(maxgrds) :: isponge_pts !------------------------------------------------------------------------------- real :: distim ,cphas + real, dimension(maxgrds) :: sponge_tau !------------------------------------------------------------------------------- Contains diff --git a/src/6.3.02/memory/mem_kpp.f90 b/src/memory/mem_kpp.f90 similarity index 100% rename from src/6.3.02/memory/mem_kpp.f90 rename to src/memory/mem_kpp.f90 diff --git a/src/6.3.02/memory/mem_leaf.f90 b/src/memory/mem_leaf.f90 similarity index 100% rename from src/6.3.02/memory/mem_leaf.f90 rename to src/memory/mem_leaf.f90 diff --git a/src/6.3.02/memory/mem_micro.f90 b/src/memory/mem_micro.f90 similarity index 92% rename from src/6.3.02/memory/mem_micro.f90 rename to src/memory/mem_micro.f90 index 62cbfba..ecd7f97 100644 --- a/src/6.3.02/memory/mem_micro.f90 +++ b/src/memory/mem_micro.f90 @@ -14,7 +14,7 @@ Module mem_micro !Bin precip vars ,pcpvic,pcpvip,pcpvid & !Aerosol categories mass and number - ,cccnp,gccnp,cccmp,gccmp & + ,cn1np,cn2np,cn1mp,cn2mp & ,md1np,md2np,md1mp,md2mp & ,salt_film_np,salt_jet_np,salt_spum_np & ,salt_film_mp,salt_jet_mp,salt_spum_mp & @@ -35,11 +35,14 @@ Module mem_micro ,resol_aero1_mp,resol_aero2_mp & ! MICRO BUDGET PROCESSES (imbudget >=1) ,latheatvap,latheatfrz,nuccldrt,cld2raint,ice2raint,nucicert & - ,vapliqt,vapicet,melticet,rimecldt,rain2icet,aggregatet & + ,vapliqt,vapicet,evapliqt,evapicet,freezingt,meltingt & + ,melticet,rimecldt,rain2icet,aggregatet & ,latheatvapt,latheatfrzt & ! MICRO BUDGET PROCESSES (imbudget >=2) ,inuchomrt,inuccontrt,inucifnrt,inuchazrt,vapcldt,vapraint & ,vapprist,vapsnowt,vapaggrt,vapgraut,vaphailt,vapdrizt & + ,evapcldt,evapraint,evapprist,evapsnowt,evapaggrt,evapgraut & + ,evaphailt,evapdrizt & ,meltprist,meltsnowt,meltaggrt,meltgraut,melthailt & ,rimecldsnowt,rimecldaggrt,rimecldgraut,rimecldhailt & ,rain2prt,rain2snt,rain2agt,rain2grt,rain2hat & @@ -129,10 +132,10 @@ Subroutine alloc_micro (micro,n1,n2,n3,n4) ! Allocate arrays based on options (if necessary) if (level >= 0 .and. level .ne. 4) then if(iaerosol > 0) then - allocate (micro%cccnp(n1,n2,n3)) - allocate (micro%cccmp(n1,n2,n3)) - allocate (micro%gccnp(n1,n2,n3)) - allocate (micro%gccmp(n1,n2,n3)) + allocate (micro%cn1np(n1,n2,n3)) + allocate (micro%cn1mp(n1,n2,n3)) + allocate (micro%cn2np(n1,n2,n3)) + allocate (micro%cn2mp(n1,n2,n3)) endif if(idust > 0) then allocate (micro%md1np(n1,n2,n3)) @@ -290,6 +293,10 @@ Subroutine alloc_micro (micro,n1,n2,n3,n4) allocate (micro%nucicert(n1,n2,n3)) allocate (micro%vapliqt(n1,n2,n3)) allocate (micro%vapicet(n1,n2,n3)) + allocate (micro%evapliqt(n1,n2,n3)) + allocate (micro%evapicet(n1,n2,n3)) + allocate (micro%freezingt(n1,n2,n3)) + allocate (micro%meltingt(n1,n2,n3)) allocate (micro%melticet(n1,n2,n3)) allocate (micro%rimecldt(n1,n2,n3)) allocate (micro%rain2icet(n1,n2,n3)) @@ -310,6 +317,14 @@ Subroutine alloc_micro (micro,n1,n2,n3,n4) allocate (micro%vapgraut(n1,n2,n3)) allocate (micro%vaphailt(n1,n2,n3)) allocate (micro%vapdrizt(n1,n2,n3)) + allocate (micro%evapcldt(n1,n2,n3)) + allocate (micro%evapraint(n1,n2,n3)) + allocate (micro%evapprist(n1,n2,n3)) + allocate (micro%evapsnowt(n1,n2,n3)) + allocate (micro%evapaggrt(n1,n2,n3)) + allocate (micro%evapgraut(n1,n2,n3)) + allocate (micro%evaphailt(n1,n2,n3)) + allocate (micro%evapdrizt(n1,n2,n3)) allocate (micro%meltprist(n1,n2,n3)) allocate (micro%meltsnowt(n1,n2,n3)) allocate (micro%meltaggrt(n1,n2,n3)) @@ -408,6 +423,7 @@ Subroutine alloc_micro (micro,n1,n2,n3,n4) allocate (micro%nuccldct(n1,n2,n3)) allocate (micro%cld2raint(n1,n2,n3)) allocate (micro%vapliqt(n1,n2,n3)) + if(iceprocs==1) then allocate (micro%latheatfrz(n1,n2,n3)) ! allocate (micro%ice2raint(n1,n2,n3)) @@ -493,10 +509,10 @@ Subroutine dealloc_micro (micro) if (allocated(micro%q6)) deallocate (micro%q6) if (allocated(micro%q7)) deallocate (micro%q7) - if (allocated(micro%cccnp)) deallocate (micro%cccnp) - if (allocated(micro%gccnp)) deallocate (micro%gccnp) - if (allocated(micro%cccmp)) deallocate (micro%cccmp) - if (allocated(micro%gccmp)) deallocate (micro%gccmp) + if (allocated(micro%cn1np)) deallocate (micro%cn1np) + if (allocated(micro%cn2np)) deallocate (micro%cn2np) + if (allocated(micro%cn1mp)) deallocate (micro%cn1mp) + if (allocated(micro%cn2mp)) deallocate (micro%cn2mp) if (allocated(micro%md1np)) deallocate (micro%md1np) if (allocated(micro%md2np)) deallocate (micro%md2np) if (allocated(micro%md1mp)) deallocate (micro%md1mp) @@ -599,6 +615,10 @@ Subroutine dealloc_micro (micro) if (allocated(micro%nucicert)) deallocate (micro%nucicert) if (allocated(micro%vapliqt)) deallocate (micro%vapliqt) if (allocated(micro%vapicet)) deallocate (micro%vapicet) + if (allocated(micro%evapliqt)) deallocate (micro%evapliqt) + if (allocated(micro%evapicet)) deallocate (micro%evapicet) + if (allocated(micro%freezingt)) deallocate (micro%freezingt) + if (allocated(micro%meltingt)) deallocate (micro%meltingt) if (allocated(micro%melticet)) deallocate (micro%melticet) if (allocated(micro%rimecldt)) deallocate (micro%rimecldt) if (allocated(micro%rain2icet)) deallocate (micro%rain2icet) @@ -618,6 +638,14 @@ Subroutine dealloc_micro (micro) if (allocated(micro%vapgraut)) deallocate (micro%vapgraut) if (allocated(micro%vaphailt)) deallocate (micro%vaphailt) if (allocated(micro%vapdrizt)) deallocate (micro%vapdrizt) + if (allocated(micro%evapcldt)) deallocate (micro%evapcldt) + if (allocated(micro%evapraint)) deallocate (micro%evapraint) + if (allocated(micro%evapprist)) deallocate (micro%evapprist) + if (allocated(micro%evapsnowt)) deallocate (micro%evapsnowt) + if (allocated(micro%evapaggrt)) deallocate (micro%evapaggrt) + if (allocated(micro%evapgraut)) deallocate (micro%evapgraut) + if (allocated(micro%evaphailt)) deallocate (micro%evaphailt) + if (allocated(micro%evapdrizt)) deallocate (micro%evapdrizt) if (allocated(micro%meltprist)) deallocate (micro%meltprist) if (allocated(micro%meltsnowt)) deallocate (micro%meltsnowt) if (allocated(micro%meltaggrt)) deallocate (micro%meltaggrt) @@ -768,22 +796,22 @@ Subroutine filltab_micro (micro,microm,imean,n1,n2,n3,ng) 'Q7 :3:anal:mpti:mpt1') !Aerosol categories mass and number - if (allocated(micro%cccnp)) & - CALL vtables2 (micro%cccnp(1,1,1),microm%cccnp(1,1,1) & + if (allocated(micro%cn1np)) & + CALL vtables2 (micro%cn1np(1,1,1),microm%cn1np(1,1,1) & ,ng, npts, imean, & - 'CCCNP :3:anal:mpti:mpt1') - if (allocated(micro%gccnp)) & - CALL vtables2 (micro%gccnp(1,1,1),microm%gccnp(1,1,1) & + 'CN1NP :3:anal:mpti:mpt1') + if (allocated(micro%cn2np)) & + CALL vtables2 (micro%cn2np(1,1,1),microm%cn2np(1,1,1) & ,ng, npts, imean, & - 'GCCNP :3:anal:mpti:mpt1') - if (allocated(micro%cccmp)) & - CALL vtables2 (micro%cccmp(1,1,1),microm%cccmp(1,1,1) & + 'CN2NP :3:anal:mpti:mpt1') + if (allocated(micro%cn1mp)) & + CALL vtables2 (micro%cn1mp(1,1,1),microm%cn1mp(1,1,1) & ,ng, npts, imean, & - 'CCCMP :3:anal:mpti:mpt1') - if (allocated(micro%gccmp)) & - CALL vtables2 (micro%gccmp(1,1,1),microm%gccmp(1,1,1) & + 'CN1MP :3:anal:mpti:mpt1') + if (allocated(micro%cn2mp)) & + CALL vtables2 (micro%cn2mp(1,1,1),microm%cn2mp(1,1,1) & ,ng, npts, imean, & - 'GCCMP :3:anal:mpti:mpt1') + 'CN2MP :3:anal:mpti:mpt1') if (allocated(micro%md1np)) & CALL vtables2 (micro%md1np(1,1,1),microm%md1np(1,1,1) & ,ng, npts, imean, & @@ -1082,6 +1110,22 @@ Subroutine filltab_micro (micro,microm,imean,n1,n2,n3,ng) CALL vtables2 (micro%vapicet(1,1,1),microm%vapicet(1,1,1) & ,ng, npts, imean, & 'VAPICET :3:anal:mpti') + if (allocated(micro%evapliqt)) & + CALL vtables2 (micro%evapliqt(1,1,1),microm%evapliqt(1,1,1) & + ,ng, npts, imean, & + 'EVAPLIQT :3:anal:mpti') + if (allocated(micro%evapicet)) & + CALL vtables2 (micro%evapicet(1,1,1),microm%evapicet(1,1,1) & + ,ng, npts, imean, & + 'EVAPICET :3:anal:mpti') + if (allocated(micro%freezingt)) & + CALL vtables2 (micro%freezingt(1,1,1),microm%freezingt(1,1,1) & + ,ng, npts, imean, & + 'FREEZINGT :3:anal:mpti') + if (allocated(micro%meltingt)) & + CALL vtables2 (micro%meltingt(1,1,1),microm%meltingt(1,1,1) & + ,ng, npts, imean, & + 'MELTINGT :3:anal:mpti') if (allocated(micro%melticet)) & CALL vtables2 (micro%melticet(1,1,1),microm%melticet(1,1,1) & ,ng, npts, imean, & @@ -1154,7 +1198,39 @@ Subroutine filltab_micro (micro,microm,imean,n1,n2,n3,ng) if (allocated(micro%vapdrizt)) & CALL vtables2 (micro%vapdrizt(1,1,1),microm%vapdrizt(1,1,1) & ,ng, npts, imean, & - 'VAPDRIZT :3:anal:mpti') + 'VAPDRIZT :3:anal:mpti') + if (allocated(micro%evapcldt)) & + CALL vtables2 (micro%evapcldt(1,1,1),microm%evapcldt(1,1,1) & + ,ng, npts, imean, & + 'EVAPCLDT :3:anal:mpti') + if (allocated(micro%evapraint)) & + CALL vtables2 (micro%evapraint(1,1,1),microm%evapraint(1,1,1) & + ,ng, npts, imean, & + 'EVAPRAINT :3:anal:mpti') + if (allocated(micro%evapprist)) & + CALL vtables2 (micro%evapprist(1,1,1),microm%evapprist(1,1,1) & + ,ng, npts, imean, & + 'EVAPPRIST :3:anal:mpti') + if (allocated(micro%evapsnowt)) & + CALL vtables2 (micro%evapsnowt(1,1,1),microm%evapsnowt(1,1,1) & + ,ng, npts, imean, & + 'EVAPSNOWT :3:anal:mpti') + if (allocated(micro%evapaggrt)) & + CALL vtables2 (micro%evapaggrt(1,1,1),microm%evapaggrt(1,1,1) & + ,ng, npts, imean, & + 'EVAPAGGRT :3:anal:mpti') + if (allocated(micro%evapgraut)) & + CALL vtables2 (micro%evapgraut(1,1,1),microm%evapgraut(1,1,1) & + ,ng, npts, imean, & + 'EVAPGRAUT :3:anal:mpti') + if (allocated(micro%evaphailt)) & + CALL vtables2 (micro%evaphailt(1,1,1),microm%evaphailt(1,1,1) & + ,ng, npts, imean, & + 'EVAPHAILT :3:anal:mpti') + if (allocated(micro%evapdrizt)) & + CALL vtables2 (micro%evapdrizt(1,1,1),microm%evapdrizt(1,1,1) & + ,ng, npts, imean, & + 'EVAPDRIZT :3:anal:mpti') if (allocated(micro%meltprist)) & CALL vtables2 (micro%meltprist(1,1,1),microm%meltprist(1,1,1) & ,ng, npts, imean, & diff --git a/src/6.3.02/memory/mem_mksfc.f90 b/src/memory/mem_mksfc.f90 similarity index 100% rename from src/6.3.02/memory/mem_mksfc.f90 rename to src/memory/mem_mksfc.f90 diff --git a/src/6.3.02/memory/mem_nestb.f90 b/src/memory/mem_nestb.f90 similarity index 100% rename from src/6.3.02/memory/mem_nestb.f90 rename to src/memory/mem_nestb.f90 diff --git a/src/6.3.02/memory/mem_oda.f90 b/src/memory/mem_oda.f90 similarity index 100% rename from src/6.3.02/memory/mem_oda.f90 rename to src/memory/mem_oda.f90 diff --git a/src/6.3.02/memory/mem_radiate.f90 b/src/memory/mem_radiate.f90 similarity index 100% rename from src/6.3.02/memory/mem_radiate.f90 rename to src/memory/mem_radiate.f90 diff --git a/src/6.3.02/memory/mem_scratch.f90 b/src/memory/mem_scratch.f90 similarity index 100% rename from src/6.3.02/memory/mem_scratch.f90 rename to src/memory/mem_scratch.f90 diff --git a/src/6.3.02/memory/mem_sib.f90 b/src/memory/mem_sib.f90 similarity index 100% rename from src/6.3.02/memory/mem_sib.f90 rename to src/memory/mem_sib.f90 diff --git a/src/6.3.02/memory/mem_tend.f90 b/src/memory/mem_tend.f90 similarity index 96% rename from src/6.3.02/memory/mem_tend.f90 rename to src/memory/mem_tend.f90 index 91e0173..0d65d36 100644 --- a/src/6.3.02/memory/mem_tend.f90 +++ b/src/memory/mem_tend.f90 @@ -13,7 +13,7 @@ Module mem_tend ,fncnt, ffcdt, ffict, ffipt, ffidt & ,ffsnt, ffglt, ffhlt, ffint & ,cifnt, tket & - ,cccmt, gccmt, cccnt, gccnt & + ,cn1mt, cn2mt, cn1nt, cn2nt & ,md1nt, md2nt, md1mt, md2mt & ,salt_film_nt,salt_jet_nt,salt_spum_nt & ,salt_film_mt,salt_jet_mt,salt_spum_mt & @@ -109,10 +109,10 @@ Subroutine alloc_tend (numz,numx,numy,ngrs) if (allocated(turb_g(1)%tkep)) allocate (tend%tket(ntpts)) - if (allocated(micro_g(1)%cccnp)) allocate (tend%cccnt(ntpts)) - if (allocated(micro_g(1)%gccnp)) allocate (tend%gccnt(ntpts)) - if (allocated(micro_g(1)%cccmp)) allocate (tend%cccmt(ntpts)) - if (allocated(micro_g(1)%gccmp)) allocate (tend%gccmt(ntpts)) + if (allocated(micro_g(1)%cn1np)) allocate (tend%cn1nt(ntpts)) + if (allocated(micro_g(1)%cn2np)) allocate (tend%cn2nt(ntpts)) + if (allocated(micro_g(1)%cn1mp)) allocate (tend%cn1mt(ntpts)) + if (allocated(micro_g(1)%cn2mp)) allocate (tend%cn2mt(ntpts)) if (allocated(micro_g(1)%md1np)) allocate (tend%md1nt(ntpts)) if (allocated(micro_g(1)%md2np)) allocate (tend%md2nt(ntpts)) if (allocated(micro_g(1)%md1mp)) allocate (tend%md1mt(ntpts)) @@ -238,10 +238,10 @@ Subroutine dealloc_tend (ngrs) if (allocated(tend%tket)) deallocate (tend%tket) - if (allocated(tend%cccnt))deallocate (tend%cccnt) - if (allocated(tend%gccnt))deallocate (tend%gccnt) - if (allocated(tend%cccmt)) deallocate (tend%cccmt) - if (allocated(tend%gccmt)) deallocate (tend%gccmt) + if (allocated(tend%cn1nt))deallocate (tend%cn1nt) + if (allocated(tend%cn2nt))deallocate (tend%cn2nt) + if (allocated(tend%cn1mt)) deallocate (tend%cn1mt) + if (allocated(tend%cn2mt)) deallocate (tend%cn2mt) if (allocated(tend%md1nt)) deallocate (tend%md1nt) if (allocated(tend%md2nt)) deallocate (tend%md2nt) if (allocated(tend%md1mt)) deallocate (tend%md1mt) @@ -389,14 +389,14 @@ Subroutine filltab_tend (basic,micro,turb,sib,tracer,ng) if( allocated(tend%tket)) & CALL vtables_scalar (turb%tkep(1,1,1),tend%tket(1),ng,'TKEP') - if (allocated(tend%cccnt)) & - CALL vtables_scalar (micro%cccnp(1,1,1),tend%cccnt(1),ng,'CCCNP') - if (allocated(tend%gccnt)) & - CALL vtables_scalar (micro%gccnp(1,1,1),tend%gccnt(1),ng,'GCCNP') - if (allocated(tend%cccmt)) & - CALL vtables_scalar (micro%cccmp(1,1,1),tend%cccmt(1),ng,'CCCMP') - if (allocated(tend%gccmt)) & - CALL vtables_scalar (micro%gccmp(1,1,1),tend%gccmt(1),ng,'GCCMP') + if (allocated(tend%cn1nt)) & + CALL vtables_scalar (micro%cn1np(1,1,1),tend%cn1nt(1),ng,'CN1NP') + if (allocated(tend%cn2nt)) & + CALL vtables_scalar (micro%cn2np(1,1,1),tend%cn2nt(1),ng,'CN2NP') + if (allocated(tend%cn1mt)) & + CALL vtables_scalar (micro%cn1mp(1,1,1),tend%cn1mt(1),ng,'CN1MP') + if (allocated(tend%cn2mt)) & + CALL vtables_scalar (micro%cn2mp(1,1,1),tend%cn2mt(1),ng,'CN2MP') if (allocated(tend%md1nt)) & CALL vtables_scalar (micro%md1np(1,1,1),tend%md1nt(1),ng,'MD1NP') if (allocated(tend%md2nt)) & diff --git a/src/6.3.02/memory/mem_tracer.f90 b/src/memory/mem_tracer.f90 similarity index 100% rename from src/6.3.02/memory/mem_tracer.f90 rename to src/memory/mem_tracer.f90 diff --git a/src/6.3.02/memory/mem_turb.f90 b/src/memory/mem_turb.f90 similarity index 100% rename from src/6.3.02/memory/mem_turb.f90 rename to src/memory/mem_turb.f90 diff --git a/src/6.3.02/memory/mem_varinit.f90 b/src/memory/mem_varinit.f90 similarity index 100% rename from src/6.3.02/memory/mem_varinit.f90 rename to src/memory/mem_varinit.f90 diff --git a/src/6.3.02/memory/var_tables.f90 b/src/memory/var_tables.f90 similarity index 100% rename from src/6.3.02/memory/var_tables.f90 rename to src/memory/var_tables.f90 diff --git a/src/6.3.02/memory/vtab_fill.f90 b/src/memory/vtab_fill.f90 similarity index 100% rename from src/6.3.02/memory/vtab_fill.f90 rename to src/memory/vtab_fill.f90 diff --git a/src/6.3.02/micro/aero_deposit.f90 b/src/micro/aero_deposit.f90 similarity index 99% rename from src/6.3.02/micro/aero_deposit.f90 rename to src/micro/aero_deposit.f90 index 2787abf..b078b00 100644 --- a/src/6.3.02/micro/aero_deposit.f90 +++ b/src/micro/aero_deposit.f90 @@ -91,8 +91,8 @@ Subroutine deposition_driver (i,j,m1,xztop,rtgt & rundep=0 !Set up profile of aerosol properties if they exist - if((acat==1 .and. iaerosol>0) .or. & ! CCN - (acat==2 .and. iaerosol>0) .or. & ! GCCN + if((acat==1 .and. iaerosol>0) .or. & ! CCN mode 1 + (acat==2 .and. iaerosol>0) .or. & ! CCN mode 2 (acat==3 .and. idust>0) .or. & ! Small dust mode (acat==4 .and. idust>0) .or. & ! Large dust mode (acat==5 .and. isalt>0) .or. & ! Salt film mode @@ -525,7 +525,8 @@ Subroutine cal_dwet (T,rh,ddry,dwet,vhoff,epsilonsol,rhodry,rhowet) !Equation r = A * rd ** B requires radius in microns !r100 growth equation computes in meters and needs converstion !to microns before applying to "ddry" which is in microns -!Then return radius in microns +!Then return radius in microns. ddry and dwet are actually radii +!and not diameter. implicit none @@ -598,7 +599,7 @@ Subroutine cal_dwet (T,rh,ddry,dwet,vhoff,epsilonsol,rhodry,rhowet) dwet = min(10.,dwet) !If particle swells, compute density of particle + water -volumeratio = ddry**3 / dwet**3 +volumeratio = min(1.00, ddry**3 / dwet**3) rhowet = rhodry * volumeratio + 1000. * (1.-volumeratio) if(rhowet<1000.0 .or. rhowet>2659.0 .or.rhodry<1000.0 .or. rhodry>2659.0) then diff --git a/src/6.3.02/micro/aero_include.f90 b/src/micro/aero_include.f90 similarity index 100% rename from src/6.3.02/micro/aero_include.f90 rename to src/micro/aero_include.f90 diff --git a/src/6.3.02/micro/aero_sources.f90 b/src/micro/aero_sources.f90 similarity index 100% rename from src/6.3.02/micro/aero_sources.f90 rename to src/micro/aero_sources.f90 diff --git a/src/6.3.02/micro/mic_adj.f90 b/src/micro/mic_adj.f90 similarity index 97% rename from src/6.3.02/micro/mic_adj.f90 rename to src/micro/mic_adj.f90 index e6a86ec..8604dbc 100644 --- a/src/6.3.02/micro/mic_adj.f90 +++ b/src/micro/mic_adj.f90 @@ -141,7 +141,7 @@ Subroutine adj1 (m1,m2,m3,rtp,micro,ngr) rxloss=0 !Zero out hydrometeor fields if they are below a min threshold for 2-moment - if(jnmb(lcat)>=5 .and. (rx(k,lcat) < rxmin .or. cx(k,lcat) <= 0.0)) then + if(jnmb(lcat)>=5 .and. (rx(k,lcat) < rxmin .or. cx(k,lcat) < cxmin)) then zerocheck=1 cxloss = cx(k,lcat) rxloss = rx(k,lcat) @@ -355,12 +355,12 @@ Subroutine adj1 (m1,m2,m3,rtp,micro,ngr) endif endif if(iaerosol>0)then - if(micro%cccnp(k,i,j) > maxaero) then - print*,"Too many CCN:",micro%cccnp(k,i,j) + if(micro%cn1np(k,i,j) > maxaero) then + print*,"Too many CCN1:",micro%cn1np(k,i,j) toomany=1 endif - if(micro%gccnp(k,i,j) > maxaero) then - print*,"Too many GCCN:",micro%gccnp(k,i,j) + if(micro%cn2np(k,i,j) > maxaero) then + print*,"Too many CCN2:",micro%cn2np(k,i,j) toomany=1 endif endif @@ -419,13 +419,13 @@ Subroutine adj1 (m1,m2,m3,rtp,micro,ngr) !SET SMALL VALUES TO ZERO if(iaerosol>0) then - if(micro%cccnp(k,i,j)0) then diff --git a/src/6.3.02/micro/mic_aero.f90 b/src/micro/mic_aero.f90 similarity index 92% rename from src/6.3.02/micro/mic_aero.f90 rename to src/micro/mic_aero.f90 index 5cbf2d5..66872ce 100644 --- a/src/6.3.02/micro/mic_aero.f90 +++ b/src/micro/mic_aero.f90 @@ -57,8 +57,8 @@ Subroutine aerosols () do i = ia,iz CALL aero_copy (1,mzp & - ,micro_g(ngrid)%cccnp(1,i,j),micro_g(ngrid)%cccmp(1,i,j) & - ,micro_g(ngrid)%gccnp(1,i,j),micro_g(ngrid)%gccmp(1,i,j) & + ,micro_g(ngrid)%cn1np(1,i,j),micro_g(ngrid)%cn1mp(1,i,j) & + ,micro_g(ngrid)%cn2np(1,i,j),micro_g(ngrid)%cn2mp(1,i,j) & ,micro_g(ngrid)%md1np(1,i,j),micro_g(ngrid)%md1mp(1,i,j) & ,micro_g(ngrid)%md2np(1,i,j),micro_g(ngrid)%md2mp(1,i,j) & ,micro_g(ngrid)%salt_film_np(1,i,j),micro_g(ngrid)%salt_film_mp(1,i,j) & @@ -84,8 +84,8 @@ Subroutine aerosols () ) CALL aero_copy (2,mzp & - ,micro_g(ngrid)%cccnp(1,i,j),micro_g(ngrid)%cccmp(1,i,j) & - ,micro_g(ngrid)%gccnp(1,i,j),micro_g(ngrid)%gccmp(1,i,j) & + ,micro_g(ngrid)%cn1np(1,i,j),micro_g(ngrid)%cn1mp(1,i,j) & + ,micro_g(ngrid)%cn2np(1,i,j),micro_g(ngrid)%cn2mp(1,i,j) & ,micro_g(ngrid)%md1np(1,i,j),micro_g(ngrid)%md1mp(1,i,j) & ,micro_g(ngrid)%md2np(1,i,j),micro_g(ngrid)%md2mp(1,i,j) & ,micro_g(ngrid)%salt_film_np(1,i,j),micro_g(ngrid)%salt_film_mp(1,i,j) & @@ -157,7 +157,7 @@ Subroutine aerosol_init () END SUBROUTINE aerosol_init !############################################################################## -Subroutine aero_copy (aflag,m1,cccnp,cccmp,gccnp,gccmp,md1np,md1mp & +Subroutine aero_copy (aflag,m1,cn1np,cn1mp,cn2np,cn2mp,md1np,md1mp & ,md2np,md2mp,salt_film_np,salt_film_mp,salt_jet_np & ,salt_jet_mp,salt_spum_np,salt_spum_mp & ,abc1np,abc1mp,abc2np,abc2mp) @@ -170,7 +170,7 @@ Subroutine aero_copy (aflag,m1,cccnp,cccmp,gccnp,gccmp,md1np,md1mp & implicit none integer :: m1,k,aflag -real, dimension(m1) :: cccnp,cccmp,gccnp,gccmp,md1np,md1mp & +real, dimension(m1) :: cn1np,cn1mp,cn2np,cn2mp,md1np,md1mp & ,md2np,md2mp,salt_film_np,salt_film_mp,salt_jet_np & ,salt_jet_mp,salt_spum_np,salt_spum_mp & ,abc1np,abc1mp,abc2np,abc2mp @@ -185,10 +185,10 @@ Subroutine aero_copy (aflag,m1,cccnp,cccmp,gccnp,gccmp,md1np,md1mp & !Fill scratch arrays for aerosol modes for level=1,2 do k = 1,m1-1 if (iaerosol > 0) then - aerocon(k,1) = cccnp(k) - aeromas(k,1) = cccmp(k) - aerocon(k,2) = gccnp(k) - aeromas(k,2) = gccmp(k) + aerocon(k,1) = cn1np(k) + aeromas(k,1) = cn1mp(k) + aerocon(k,2) = cn2np(k) + aeromas(k,2) = cn2mp(k) endif if (idust > 0) then aerocon(k,3) = md1np(k) @@ -216,10 +216,10 @@ Subroutine aero_copy (aflag,m1,cccnp,cccmp,gccnp,gccmp,md1np,md1mp & !Copy back scratch arrays to aerosol modes for level=1,2 do k = 1,m1-1 if (iaerosol > 0) then - cccnp(k) = aerocon(k,1) - cccmp(k) = aeromas(k,1) - gccnp(k) = aerocon(k,2) - gccmp(k) = aeromas(k,2) + cn1np(k) = aerocon(k,1) + cn1mp(k) = aeromas(k,1) + cn2np(k) = aerocon(k,2) + cn2mp(k) = aeromas(k,2) endif if (idust > 0) then md1np(k) = aerocon(k,3) diff --git a/src/6.3.02/micro/mic_chknan.f90 b/src/micro/mic_chknan.f90 similarity index 94% rename from src/6.3.02/micro/mic_chknan.f90 rename to src/micro/mic_chknan.f90 index aac82ee..1a29a31 100644 --- a/src/6.3.02/micro/mic_chknan.f90 +++ b/src/micro/mic_chknan.f90 @@ -73,22 +73,22 @@ Subroutine checkmicro (string) isnanr(micro_g(ngrid)%salt_jet_mp(k,i,j)) .or. & isnanr(micro_g(ngrid)%salt_spum_mp(k,i,j)) ) prtflg=1 endif - !CHECK CCN AND GCCN + !CHECK CCN Modes if(iaerosol > 0)then - if(isnanr(micro_g(ngrid)%cccnp(k,i,j)) .or. & - isnanr(micro_g(ngrid)%cccmp(k,i,j)) .or. & - isnanr(micro_g(ngrid)%gccnp(k,i,j)) .or. & - isnanr(micro_g(ngrid)%gccmp(k,i,j)) ) prtflg=1 - tempvar = valugp(mzp,mxp,myp,k,i,j,tend%cccnt(1)) + if(isnanr(micro_g(ngrid)%cn1np(k,i,j)) .or. & + isnanr(micro_g(ngrid)%cn1mp(k,i,j)) .or. & + isnanr(micro_g(ngrid)%cn2np(k,i,j)) .or. & + isnanr(micro_g(ngrid)%cn2mp(k,i,j)) ) prtflg=1 + tempvar = valugp(mzp,mxp,myp,k,i,j,tend%cn1nt(1)) if(isnanr(tempvar)) prtflg=1 if(tempvar>1.e30) prtflg=1 - tempvar = valugp(mzp,mxp,myp,k,i,j,tend%cccmt(1)) + tempvar = valugp(mzp,mxp,myp,k,i,j,tend%cn1mt(1)) if(isnanr(tempvar)) prtflg=1 if(tempvar>1.e30) prtflg=1 - tempvar = valugp(mzp,mxp,myp,k,i,j,tend%gccnt(1)) + tempvar = valugp(mzp,mxp,myp,k,i,j,tend%cn2nt(1)) if(isnanr(tempvar)) prtflg=1 if(tempvar>1.e30) prtflg=1 - tempvar = valugp(mzp,mxp,myp,k,i,j,tend%gccmt(1)) + tempvar = valugp(mzp,mxp,myp,k,i,j,tend%cn2mt(1)) if(isnanr(tempvar)) prtflg=1 if(tempvar>1.e30) prtflg=1 endif @@ -348,7 +348,7 @@ Subroutine checkmicro (string) if(prtflg==1)then print*,'Checked After: ',string - print*,'NAN Check (ngrid,k,j,i)',ngrid,k,j+mj0(ngrid),i+mi0(ngrid) + print*,'NAN Check (ngrid,k,i,j)',ngrid,k,i+mi0(ngrid),j+mj0(ngrid) print*,'wp: ',basic_g(ngrid)%wp(k,i,j) print*,'wc: ',basic_g(ngrid)%wc(k,i,j) @@ -376,14 +376,14 @@ Subroutine checkmicro (string) print*,'cifnp-tend: ',valugp(mzp,mxp,myp,k,i,j,tend%cifnt(1)) endif if(iaerosol > 0)then - print*,'cccnp: ',micro_g(ngrid)%cccnp(k,i,j) - print*,'cccnp-tend: ',valugp(mzp,mxp,myp,k,i,j,tend%cccnt(1)) - print*,'cccmp: ',micro_g(ngrid)%cccmp(k,i,j) - print*,'cccmp-tend: ',valugp(mzp,mxp,myp,k,i,j,tend%cccmt(1)) - print*,'gccnp: ',micro_g(ngrid)%gccnp(k,i,j) - print*,'gccnp-tend: ',valugp(mzp,mxp,myp,k,i,j,tend%gccnt(1)) - print*,'gccmp: ',micro_g(ngrid)%gccmp(k,i,j) - print*,'gccmp-tend: ',valugp(mzp,mxp,myp,k,i,j,tend%gccmt(1)) + print*,'cn1np: ',micro_g(ngrid)%cn1np(k,i,j) + print*,'cn1np-tend: ',valugp(mzp,mxp,myp,k,i,j,tend%cn1nt(1)) + print*,'cn1mp: ',micro_g(ngrid)%cn1mp(k,i,j) + print*,'cn1mp-tend: ',valugp(mzp,mxp,myp,k,i,j,tend%cn1mt(1)) + print*,'cn2np: ',micro_g(ngrid)%cn2np(k,i,j) + print*,'cn2np-tend: ',valugp(mzp,mxp,myp,k,i,j,tend%cn2nt(1)) + print*,'cn2mp: ',micro_g(ngrid)%cn2mp(k,i,j) + print*,'cn2mp-tend: ',valugp(mzp,mxp,myp,k,i,j,tend%cn2mt(1)) endif if(idust > 0)then print*,'md1np: ',micro_g(ngrid)%md1np(k,i,j) diff --git a/src/6.3.02/micro/mic_coll.f90 b/src/micro/mic_coll.f90 similarity index 95% rename from src/6.3.02/micro/mic_coll.f90 rename to src/micro/mic_coll.f90 index 2134c4a..81ea013 100644 --- a/src/6.3.02/micro/mic_coll.f90 +++ b/src/micro/mic_coll.f90 @@ -564,6 +564,15 @@ Subroutine effxy (m1,k1,k2) integer :: m1,k,ncall7 integer, dimension(11) :: k1,k2 data ncall7/0/ + +integer :: etmp +real :: wt1,wt2,tagg +real, dimension(12) :: temps,efftemp +! Celcius temperature +data temps / 0., -5., -10., -14., -15., -16., -20., -25., -30., -35., -40., -50./ +! Aggregation efficiency +data efftemp /0.20, 0.15, 0.20, 0.60, 0.65, 0.60, 0.10, 0.08, 0.06, 0.04, 0.025, 0.020/ + save ! 1 = rp,rs,ra,rg,rh @@ -604,32 +613,54 @@ Subroutine effxy (m1,k1,k2) ! 4 = pp,ps,pa if (jnmb(5) .ge. 1) then do k = k1(3),k2(3) - if (abs(tx(k,3)+14.) .le. 2.) then - eff(k,4) = 1.4 - else - eff(k,4) = min(0.2,10. ** (0.035 * tx(k,3) - 0.7)) + tagg = tx(k,3) + if (tagg <= -50.0) then + tagg = -50.0 + elseif (tagg >= 0.0) then + tagg = 0.0 endif + do etmp=1,11 + if ( (tagg <= temps(etmp)) .and. (tagg >= temps(etmp+1)) )then + wt1=abs( (tagg-temps(etmp)) / (temps(etmp)-temps(etmp+1)) ) + wt2=1.0-wt1 + eff(k,4) = wt2*efftemp(etmp) + wt1*efftemp(etmp+1) + endif + enddo enddo ! 5 = ss,sa do k = k1(4),k2(4) - if (abs(tx(k,4)+14.) .le. 2.) then - eff(k,5) = 1.4 - else - eff(k,5) = min(0.2,10. ** (0.035 * tx(k,4) - 0.7)) + tagg = tx(k,4) + if (tagg <= -50.0) then + tagg = -50.0 + elseif (tagg >= 0.0) then + tagg = 0.0 endif + do etmp=1,11 + if ( (tagg <= temps(etmp)) .and. (tagg >= temps(etmp+1)) )then + wt1=abs( (tagg-temps(etmp)) / (temps(etmp)-temps(etmp+1)) ) + wt2=1.0-wt1 + eff(k,5) = wt2*efftemp(etmp) + wt1*efftemp(etmp+1) + endif + enddo enddo ! 6 = aa do k = k1(5),k2(5) if (rx(k,5) .ge. rxmin) then - if (abs(tx(k,5)+14.) .le. 2.) then - eff(k,6) = 1.4 - elseif (tx(k,5) .ge. -1.) then - eff(k,6) = 1. - else - eff(k,6) = min(0.2,10. ** (0.035 * tx(k,5) - 0.7)) + tagg = tx(k,5) + if (tagg <= -50.0) then + tagg = -50.0 + elseif (tagg >= 0.0) then + tagg = 0.0 endif + do etmp=1,11 + if ( (tagg <= temps(etmp)) .and. (tagg >= temps(etmp+1)) )then + wt1=abs( (tagg-temps(etmp)) / (temps(etmp)-temps(etmp+1)) ) + wt2=1.0-wt1 + eff(k,6) = wt2*efftemp(etmp) + wt1*efftemp(etmp+1) + endif + enddo endif enddo endif @@ -640,7 +671,19 @@ Subroutine effxy (m1,k1,k2) if (qr(k,6) .gt. 0.) then eff(k,7) = 1.0 else - eff(k,7) = min(0.2,10. ** (0.035 * tx(k,6) - 0.7)) + tagg = tx(k,6) + if (tagg <= -50.0) then + tagg = -50.0 + elseif (tagg >= 0.0) then + tagg = 0.0 + endif + do etmp=1,11 + if ( (tagg <= temps(etmp)) .and. (tagg >= temps(etmp+1)) )then + wt1=abs( (tagg-temps(etmp)) / (temps(etmp)-temps(etmp+1)) ) + wt2=1.0-wt1 + eff(k,7) = wt2*efftemp(etmp) + wt1*efftemp(etmp+1) + endif + enddo endif enddo endif @@ -652,7 +695,19 @@ Subroutine effxy (m1,k1,k2) if (qr(k,7) .gt. 0.) then eff(k,8) = 1.0 else - eff(k,8) = min(0.2,10. ** (0.035 * tx(k,7) - 0.7)) + tagg = tx(k,7) + if (tagg <= -50.0) then + tagg = -50.0 + elseif (tagg >= 0.0) then + tagg = 0.0 + endif + do etmp=1,11 + if ( (tagg <= temps(etmp)) .and. (tagg >= temps(etmp+1)) )then + wt1=abs( (tagg-temps(etmp)) / (temps(etmp)-temps(etmp+1)) ) + wt2=1.0-wt1 + eff(k,8) = wt2*efftemp(etmp) + wt1*efftemp(etmp+1) + endif + enddo endif endif enddo diff --git a/src/6.3.02/micro/mic_driv.f90 b/src/micro/mic_driv.f90 similarity index 92% rename from src/6.3.02/micro/mic_driv.f90 rename to src/micro/mic_driv.f90 index 433cb15..a16ce45 100644 --- a/src/6.3.02/micro/mic_driv.f90 +++ b/src/micro/mic_driv.f90 @@ -250,6 +250,14 @@ Subroutine mcphys (m1,k1,k2,k3,i,j,ngr,maxnzp & data dpcp0 /.001,.001,.010,.010,.010,.003,.001,.001/ save +!Output some data for diagnostic purposes +!if(i==4)then +! do k=2,38 +! print*,'ice_start',k,(theta(k) * (pi0(k)+pp(k)) / 1004.) - 273.16 & +! ,rx(k,3)+rx(k,4),(cx(k,3)+cx(k,4))*dn0(k)/1000. +! enddo +!endif + ! Compute pressure, temperature, and moisture for vapor diffusion CALL thrmstr (m1,k1,k2,thp(1),theta(1),rtp(1),rv(1) & ,pp(1),pi0(1) & @@ -419,6 +427,12 @@ Subroutine mcphys (m1,k1,k2,k3,i,j,ngr,maxnzp & ! Make hydrometeor transfers due to collision-coalescence CALL colxfers (m1,k1,k2,scrmic1,scrmic2) +! Pristine ice to snow transfer done after collision-coalescence to +! avoid any mass/number adjustments that impact cloud-ice number +if (jnmb(4) .ge. 1) then + CALL psxfer (k1(3),k2(3),k1(4),k2(4),i,j) +endif + ! Calcs r,q,c for each category considering melting processes ! in the order of pristine,cloud,drizzle,snow,agg,graupel,hail,rain ! though nothing done for cloud or drizzle in (x02) routine @@ -472,6 +486,14 @@ Subroutine mcphys (m1,k1,k2,k3,i,j,ngr,maxnzp & ,dn0(1),dtlt,i,j) endif +!Output some data for diagnostic purposes +!if(i==4)then +! do k=2,38 +! print*,'ice_nuc',k,(theta(k) * (pi0(k)+pp(k)) / 1004.) - 273.16 & +! ,rx(k,3)+rx(k,4),(cx(k,3)+cx(k,4))*dn0(k)/1000. +! enddo +!endif + ! Finds bottom and top later of pristine ice if (jnmb(3) .ge. 1) then k1(3) = min(k1(3),k1pnuc) @@ -484,6 +506,13 @@ Subroutine mcphys (m1,k1,k2,k3,i,j,ngr,maxnzp & if (jnmb(1) .ge. 3) CALL enemb (m1,k1,k2,1,dn0(1)) if (jnmb(8) .ge. 3) CALL enemb (m1,k1,k2,8,dn0(1)) +!if(i==4)then +! do k=2,38 +! print*,'ice_presed',k,(theta(k) * (pi0(k)+pp(k)) / 1004.) - 273.16 & +! ,rx(k,3)+rx(k,4),(cx(k,3)+cx(k,4))*dn0(k)/1000. +! enddo +!endif + ! Update latent heating budgets after ice nucleation CALL calc_lhr_icenuc (k1,k2) @@ -536,6 +565,14 @@ Subroutine mcphys (m1,k1,k2,k3,i,j,ngr,maxnzp & ,ustar(1),prough(1),imonthx & ) +!Output some data for diagnostic purposes +!if(i==4)then +! do k=2,38 +! print*,'ice_last',k,(theta(k) * (pi0(k)+pp(k)) / 1004.) - 273.16 & +! ,rx(k,3)+rx(k,4),(cx(k,3)+cx(k,4))*dn0(k)/1000. +! enddo +!endif + return END SUBROUTINE mcphys @@ -566,10 +603,10 @@ Subroutine copyback (m1,k2,k3,i,j,micro) !Copyback AEROSOLS if (iaerosol > 0) then - CALL ae1kmic (2,m1-1,micro%cccnp(1,i,j),aerocon(1,1)) - CALL ae1kmic (2,m1-1,micro%cccmp(1,i,j),aeromas(1,1)) - CALL ae1kmic (2,m1-1,micro%gccnp(1,i,j),aerocon(1,2)) - CALL ae1kmic (2,m1-1,micro%gccmp(1,i,j),aeromas(1,2)) + CALL ae1kmic (2,m1-1,micro%cn1np(1,i,j),aerocon(1,1)) + CALL ae1kmic (2,m1-1,micro%cn1mp(1,i,j),aeromas(1,1)) + CALL ae1kmic (2,m1-1,micro%cn2np(1,i,j),aerocon(1,2)) + CALL ae1kmic (2,m1-1,micro%cn2mp(1,i,j),aeromas(1,2)) endif if (idust > 0) then CALL ae1kmic (2,m1-1,micro%md1np(1,i,j),aerocon(1,3)) @@ -749,6 +786,10 @@ Subroutine copyback (m1,k2,k3,i,j,micro) CALL ae1kmic (1,m1,micro%nucicert(1,i,j),xnucicert(1)) CALL ae1kmic (1,m1,micro%vapliqt(1,i,j),xvapliqt(1)) CALL ae1kmic (1,m1,micro%vapicet(1,i,j),xvapicet(1)) + CALL ae1kmic (1,m1,micro%evapliqt(1,i,j),xevapliqt(1)) + CALL ae1kmic (1,m1,micro%evapicet(1,i,j),xevapicet(1)) + CALL ae1kmic (1,m1,micro%freezingt(1,i,j),xfreezingt(1)) + CALL ae1kmic (1,m1,micro%meltingt(1,i,j),xmeltingt(1)) CALL ae1kmic (1,m1,micro%melticet(1,i,j),xmelticet(1)) CALL ae1kmic (1,m1,micro%rimecldt(1,i,j),xrimecldt(1)) CALL ae1kmic (1,m1,micro%rain2icet(1,i,j),xrain2icet(1)) @@ -769,6 +810,14 @@ Subroutine copyback (m1,k2,k3,i,j,micro) CALL ae1kmic (1,m1,micro%vapgraut(1,i,j),xvapgraut(1)) CALL ae1kmic (1,m1,micro%vaphailt(1,i,j),xvaphailt(1)) CALL ae1kmic (1,m1,micro%vapdrizt(1,i,j),xvapdrizt(1)) + CALL ae1kmic (1,m1,micro%evapcldt(1,i,j),xevapcldt(1)) + CALL ae1kmic (1,m1,micro%evapraint(1,i,j),xevapraint(1)) + CALL ae1kmic (1,m1,micro%evapprist(1,i,j),xevapprist(1)) + CALL ae1kmic (1,m1,micro%evapsnowt(1,i,j),xevapsnowt(1)) + CALL ae1kmic (1,m1,micro%evapaggrt(1,i,j),xevapaggrt(1)) + CALL ae1kmic (1,m1,micro%evapgraut(1,i,j),xevapgraut(1)) + CALL ae1kmic (1,m1,micro%evaphailt(1,i,j),xevaphailt(1)) + CALL ae1kmic (1,m1,micro%evapdrizt(1,i,j),xevapdrizt(1)) CALL ae1kmic (1,m1,micro%meltprist(1,i,j),xmeltprist(1)) CALL ae1kmic (1,m1,micro%meltsnowt(1,i,j),xmeltsnowt(1)) CALL ae1kmic (1,m1,micro%meltaggrt(1,i,j),xmeltaggrt(1)) @@ -804,6 +853,10 @@ Subroutine copyback (m1,k2,k3,i,j,micro) micro%nucicert(1,i,j) = micro%nucicert(2,i,j) micro%vapliqt(1,i,j) = micro%vapliqt(2,i,j) micro%vapicet(1,i,j) = micro%vapicet(2,i,j) + micro%evapliqt(1,i,j) = micro%evapliqt(2,i,j) + micro%evapicet(1,i,j) = micro%evapicet(2,i,j) + micro%freezingt(1,i,j) = micro%freezingt(2,i,j) + micro%meltingt(1,i,j) = micro%meltingt(2,i,j) micro%melticet(1,i,j) = micro%melticet(2,i,j) micro%rimecldt(1,i,j) = micro%rimecldt(2,i,j) micro%rain2icet(1,i,j) = micro%rain2icet(2,i,j) @@ -824,6 +877,14 @@ Subroutine copyback (m1,k2,k3,i,j,micro) micro%vapgraut(1,i,j) = micro%vapgraut(2,i,j) micro%vaphailt(1,i,j) = micro%vaphailt(2,i,j) micro%vapdrizt(1,i,j) = micro%vapdrizt(2,i,j) + micro%evapcldt(1,i,j) = micro%evapcldt(2,i,j) + micro%evapraint(1,i,j) = micro%evapraint(2,i,j) + micro%evapprist(1,i,j) = micro%evapprist(2,i,j) + micro%evapsnowt(1,i,j) = micro%evapsnowt(2,i,j) + micro%evapaggrt(1,i,j) = micro%evapaggrt(2,i,j) + micro%evapgraut(1,i,j) = micro%evapgraut(2,i,j) + micro%evaphailt(1,i,j) = micro%evaphailt(2,i,j) + micro%evapdrizt(1,i,j) = micro%evapdrizt(2,i,j) micro%meltprist(1,i,j) = micro%meltprist(2,i,j) micro%meltsnowt(1,i,j) = micro%meltsnowt(2,i,j) micro%meltaggrt(1,i,j) = micro%meltaggrt(2,i,j) @@ -870,7 +931,7 @@ Subroutine calc_lhr_vap (k1,k2) integer :: lcat,k integer, dimension(11) :: k1,k2 -real :: temp,fracliq1,fracliq2,latheat +real :: temp,fracliq1,fracliq2,latheat,rxchange if(imbudget>=1)then @@ -921,14 +982,22 @@ Subroutine calc_lhr_vap (k1,k2) ! Now calculate melting if (lhrtheta) then - latheat = (alli/pitot(k)) * (rx(k,lcat) & - *(1.-fracliq2)-rx(k,lcat)*(1.-fracliq1)) + latheat = (alli/pitot(k)) * & + (rx(k,lcat)*(1.-fracliq2)-rx(k,lcat)*(1.-fracliq1)) else - latheat = alli * cpi * (rx(k,lcat) & - *(1.-fracliq2)-rx(k,lcat)*(1.-fracliq1)) + latheat = alli * cpi * & + (rx(k,lcat)*(1.-fracliq2)-rx(k,lcat)*(1.-fracliq1)) endif xlatheatfrz(k) = xlatheatfrz(k) + latheat xlatheatfrzt(k) = xlatheatfrzt(k) + latheat + + ! Compute total freezing or melting and enter as positive values + rxchange = (rx(k,lcat)*(1.-fracliq2)-rx(k,lcat)*(1.-fracliq1)) + if (rxchange >= 0.0) then + xfreezingt(k) = xfreezingt(k) + rxchange + else + xmeltingt(k) = xmeltingt(k) - rxchange + endif endif enddo @@ -1000,6 +1069,12 @@ Subroutine calc_lhr_collmelt (m1) xlatheatfrz(k) = xlatheatfrz(k) + alli * cpi * (rice2(k)-rice1(k)) xlatheatfrzt(k) = xlatheatfrzt(k) + alli * cpi * (rice2(k)-rice1(k)) endif + ! Compute total freezing or melting and enter as positive values + if (rice2(k)-rice1(k) >= 0.0) then + xfreezingt(k) = xfreezingt(k) + (rice2(k)-rice1(k)) + else + xmeltingt(k) = xmeltingt(k) - (rice2(k)-rice1(k)) + endif enddo endif diff --git a/src/6.3.02/micro/mic_gamma.f90 b/src/micro/mic_gamma.f90 similarity index 100% rename from src/6.3.02/micro/mic_gamma.f90 rename to src/micro/mic_gamma.f90 diff --git a/src/6.3.02/micro/mic_init.f90 b/src/micro/mic_init.f90 similarity index 81% rename from src/6.3.02/micro/mic_init.f90 rename to src/micro/mic_init.f90 index 18169cf..a74eb6c 100644 --- a/src/6.3.02/micro/mic_init.f90 +++ b/src/micro/mic_init.f90 @@ -151,9 +151,17 @@ Subroutine init_ifn (n1,n2,n3,cifnp,dn0,ifm) implicit none integer :: n1,n2,n3,i,j,k,ifm +real :: e_a,e_b,e_t,e_k,e_c real, dimension(n1,n2,n3) :: cifnp,dn0 real :: cin_maxt +!CREATE YOUR OWN CUSTOM POTENTIAL IFN/INP PROFILE BELOW. OUR SORT OF +!DEFAULT IS THE EXPONENTIALLY DECREASING PROFILE, BUT THIS IS BY ALL +!MEANS NOT A DEFINITIVE PROFILE, JUST A NECESSARY PLACEHOLDER SO THAT +!SOME HETEROGENEOUS ICE NUCLEATION CAN OCCUR IF IIFN==1or2. IIFN==3 +!USES ONE OF THE DEMOTT FORMULAS AND IS BASED ON LARGE AEROSOLS DETERMINED +!FROM THE CLOUD DROPLET NUCLEATING AEROSOL DISTRIBUTIONS. + ! Initialize IFN if(iaeroprnt==1 .and. print_msg) then print*,'Start Initializing Ice Nuclei concentration' @@ -167,18 +175,65 @@ Subroutine init_ifn (n1,n2,n3,cifnp,dn0,ifm) cin_maxt = cin_max * 1.e6 !Set up Vertical profile - if(k<=2) cifnp(k,i,j)=cin_maxt - ! Exponential decrease that scales with pressure decrease - if(k>2) cifnp(k,i,j)=cin_maxt*exp(-zt(k)/7000.) - !Output initial sample profile - if(iaeroprnt==1 .and. i==1 .and. j==1 .and. print_msg) then - if(k==1) print*,' Ice Nuclei - init (k,zt,ifn/kg,ifn/L) on Grid:',ifm + !*************************************************************************** + !Exponential decrease that scales with pressure decrease. + if (cin_max >= 0.0) then + if(k<=2) cifnp(k,i,j)=cin_maxt + if(k >2) cifnp(k,i,j)=cin_maxt*exp(-zt(k)/7000.) + !Output initial sample profile + if(iaeroprnt==1 .and. i==1 .and. j==1 .and. print_msg) then + if(k==1) print*,' Ice Nuclei - init (k,zt,ifn/mg,ifn/L) on Grid:',ifm print'(a9,i5,f11.1,2f17.7)',' IFN-init' & - ,k,zt(k),cifnp(k,i,j),cifnp(k,i,j)/1.e3*dn0(k,i,j) + ,k,zt(k),cifnp(k,i,j)/1.e6,cifnp(k,i,j)/1.e3*dn0(k,i,j) + endif + !*************************************************************************** + !Use SPICULE INP profile if cin_maxt ~ -1.0 + !Profile from aircraft obs during the SPICULE field campaign. + !To mimic the SPICULE profile in magnitude, need to set the following parameters. + !and use IIFN=2 for DeMott scheme, and IFN_FORMULA=2 for DeMott(2015) dust formula. + !Perhaps using this profile is more realistic given that is has basis + !in reality from observations of the central-western continental U.S. + elseif (cin_max > -1.01 .and. cin_max < -0.99) then + e_t = 0.10 ! Controls the shape of the profile + e_a = 2.50 ! approximately cin_maxt + e_k = 3.80 + e_b = 5.80 ! Level where you want profile to start decreasing + e_c = 1.32 ! Necessary so you do not get negative numbers (changes with "a") + cifnp(k,i,j)=(-1.0*(e_a/2.0)*(erf(((zt(k)/1000)-e_b)/sqrt(4.0*e_k*e_t)))+e_c) + !NOTE THAT THIS CURVE FIT TO DATA IS BASED ON #/CM3 UNITS, SO CONVERT BELOW + cifnp(k,i,j) = cifnp(k,i,j) * 1.e6 / dn0(k,i,j) ! convert #/cm3 to #/kg + !Output initial sample profile + if(iaeroprnt==1 .and. i==1 .and. j==1 .and. print_msg) then + if(k==1) print*,' Ice Nuclei - init (k,zt,inp/cm3,inp/mg,inp/L) on Grid:',ifm + print'(a9,i5,f11.1,3f12.3)',' IFN-init',k,zt(k) & + ,cifnp(k,i,j)/1.e6*dn0(k,i,j),cifnp(k,i,j)/1.e6,cifnp(k,i,j)/1.e3*dn0(k,i,j) + endif + !*************************************************************************** + !Use MC3E INP profile if cin_maxt ~ 2.0 + !Profile from aircraft obs during the MC3E field project. (Marinescu et al. 2016) + !To mimic the MC3E profile in magnitude, need to set the following parameters. + !and use IIFN=2 for DeMott scheme, and IFN_FORMULA=1 for DeMott(2010) general formula. + !Perhaps using this profile is more realistic given that is has basis + !in reality from observations in the southern great plains of the continental U.S. + elseif (cin_max > -2.01 .and. cin_max < -1.99) then + e_t = 0.35 ! Controls the shape of the profile + e_a = 3.28 ! approximately cin_maxt + e_k = 3.00 + e_b = 2.27 ! Level where you want profile to start decreasing + e_c = 1.96 ! Necessary so you do not get negative numbers (changes with "a") + cifnp(k,i,j)=(-1.0*(e_a/2.0)*(erf(((zt(k)/1000)-e_b)/sqrt(4.0*e_k*e_t)))+e_c) + !NOTE THAT THIS CURVE FIT TO DATA IS BASED ON #/MG UNITS, SO CONVERT BELOW + cifnp(k,i,j) = cifnp(k,i,j) * 1.e6 ! convert #/mg to #/kg + !Output initial sample profile + if(iaeroprnt==1 .and. i==1 .and. j==1 .and. print_msg) then + if(k==1) print*,' Ice Nuclei - init (k,zt,inp/cm3,inp/mg,inp/L) on Grid:',ifm + print'(a9,i5,f11.1,3f12.3)',' IFN-init',k,zt(k) & + ,cifnp(k,i,j)/1.e6*dn0(k,i,j),cifnp(k,i,j)/1.e6,cifnp(k,i,j)/1.e3*dn0(k,i,j) + endif + !*************************************************************************** endif - enddo enddo enddo @@ -189,7 +244,7 @@ Subroutine init_ifn (n1,n2,n3,cifnp,dn0,ifm) END SUBROUTINE init_ifn !############################################################################## -Subroutine init_ccn (n1,n2,n3,cccnp,cccmp,dn0,ifm) +Subroutine init_ccn1 (n1,n2,n3,cn1np,cn1mp,dn0,ifm) use micphys use rconstants @@ -198,34 +253,34 @@ Subroutine init_ccn (n1,n2,n3,cccnp,cccmp,dn0,ifm) implicit none integer :: n1,n2,n3,i,j,k,ifm -real, dimension(n1,n2,n3) :: cccnp,cccmp,dn0 -real :: ccn_maxt +real, dimension(n1,n2,n3) :: cn1np,cn1mp,dn0 +real :: ccn1_maxt -! Initialize CCN -if(iaeroprnt==1 .and. print_msg) print*,'Start Initializing CCN concentration' +! Initialize CCN mode 1 +if(iaeroprnt==1 .and. print_msg) print*,'Start Initializing CCN mode 1 concen' !Convert RAMSIN #/mg to #/kg - ccn_maxt = ccn_max * 1.e6 + ccn1_maxt = ccn1_max * 1.e6 do j = 1,n3 do i = 1,n2 do k = 1,n1 !Set up Vertical profile - if(k<=2) cccnp(k,i,j)=ccn_maxt + if(k<=2) cn1np(k,i,j)=ccn1_maxt !Exponential decrease that scales with pressure decrease - if(k>2) cccnp(k,i,j)=ccn_maxt*exp(-zt(k)/7000.) + if(k>2) cn1np(k,i,j)=ccn1_maxt*exp(-zt(k)/7000.) !Output initial sample profile if(iaeroprnt==1 .and. i==1 .and. j==1 .and. print_msg) then - if(k==1) print*,' CCN-init (k,zt,ccn/mg,ccn/cc) on Grid:',ifm - print'(a9,i5,f11.1,2f17.7)',' CCN-init' & - ,k,zt(k),cccnp(k,i,j)/1.e6,cccnp(k,i,j)/1.e6*dn0(k,i,j) + if(k==1) print*,' CCN-1-init (k,zt,ccn1/mg,ccn1/cc) on Grid:',ifm + print'(a11,i5,f11.1,2f17.7)',' CCN-1-init' & + ,k,zt(k),cn1np(k,i,j)/1.e6,cn1np(k,i,j)/1.e6*dn0(k,i,j) endif - !Set up Field of CCN mass mixing ratio (kg/kg) - cccmp(k,i,j) = ((aero_medrad(1)*aero_rg2rm(1))**3.) & - *cccnp(k,i,j)/(0.23873/aero_rhosol(1)) + !Set up Field of CCN-mode-1 mass mixing ratio (kg/kg) + cn1mp(k,i,j) = ((aero_medrad(1)*aero_rg2rm(1))**3.) & + *cn1np(k,i,j)/(0.23873/aero_rhosol(1)) enddo enddo @@ -234,10 +289,10 @@ Subroutine init_ccn (n1,n2,n3,cccnp,cccmp,dn0,ifm) if(iaeroprnt==1 .and. print_msg) print*,' ' return -END SUBROUTINE init_ccn +END SUBROUTINE init_ccn1 !############################################################################## -Subroutine init_gccn (n1,n2,n3,gccnp,gccmp,dn0,ifm) +Subroutine init_ccn2 (n1,n2,n3,cn2np,cn2mp,dn0,ifm) use micphys use rconstants @@ -246,34 +301,34 @@ Subroutine init_gccn (n1,n2,n3,gccnp,gccmp,dn0,ifm) implicit none integer :: n1,n2,n3,i,j,k,ifm -real, dimension(n1,n2,n3) :: gccnp,gccmp,dn0 -real :: gccn_maxt +real, dimension(n1,n2,n3) :: cn2np,cn2mp,dn0 +real :: ccn2_maxt -! Initialize Giant-CCN -if(iaeroprnt==1 .and. print_msg) print*,'Start Initializing GCCN concentration' +! Initialize CCN mode 2 +if(iaeroprnt==1 .and. print_msg) print*,'Start Initializing CCN mode 2 concen' !Convert RAMSIN #/mg to #/kg - gccn_maxt = gccn_max * 1.e6 + ccn2_maxt = ccn2_max * 1.e6 do j = 1,n3 do i = 1,n2 do k = 1,n1 !Set up Vertical profile - if(k<=2) gccnp(k,i,j)=gccn_maxt + if(k<=2) cn2np(k,i,j)=ccn2_maxt ! Exponential decrease that scales with pressure decrease - if(k>2) gccnp(k,i,j)=gccn_maxt*exp(-zt(k)/7000.) + if(k>2) cn2np(k,i,j)=ccn2_maxt*exp(-zt(k)/7000.) !Output initial sample profile if(iaeroprnt==1 .and. i==1 .and. j==1 .and. print_msg) then - if(k==1) print*,' GCCN-init (k,zt,gccn/mg,gccn/cc) on Grid:',ifm - print'(a10,i5,f11.1,2f17.7)',' GCCN-init' & - ,k,zt(k),gccnp(k,i,j)/1.e6,gccnp(k,i,j)/1.e6*dn0(k,i,j) + if(k==1) print*,' CCN-2-init (k,zt,ccn2/mg,ccn2/cc) on Grid:',ifm + print'(a11,i5,f11.1,2f17.7)',' CCN-2-init' & + ,k,zt(k),cn2np(k,i,j)/1.e6,cn2np(k,i,j)/1.e6*dn0(k,i,j) endif - !Set up Field of GCCN mass mixing ratio (kg/kg) - gccmp(k,i,j) = ((aero_medrad(2)*aero_rg2rm(2))**3.) & - *gccnp(k,i,j)/(0.23873/aero_rhosol(2)) + !Set up Field of CCN-mode-2 mass mixing ratio (kg/kg) + cn2mp(k,i,j) = ((aero_medrad(2)*aero_rg2rm(2))**3.) & + *cn2np(k,i,j)/(0.23873/aero_rhosol(2)) enddo enddo @@ -282,7 +337,7 @@ Subroutine init_gccn (n1,n2,n3,gccnp,gccmp,dn0,ifm) if(iaeroprnt==1 .and. print_msg) print*,' ' return -END SUBROUTINE init_gccn +END SUBROUTINE init_ccn2 !############################################################################## Subroutine init_dust (n1,n2,n3,md1np,md2np,md1mp,md2mp,dn0,ifm) @@ -510,13 +565,13 @@ Subroutine init_tracer (n1,n2,n3,tracerp,dn0,ifm,nsc) integer :: n1,n2,n3,i,j,k,ifm,nsc,ii,jj real, dimension(n1,n2,n3) :: tracerp,dn0 -real :: ccn_maxt +real :: ccn1_maxt ! Initialize Tracers if(print_msg) print*,'Start Initializing Tracers, Grid:',ifm,' Tracer:',nsc !Convert RAMSIN #/mg to #/kg - ccn_maxt = ccn_max * 1.e6 + ccn1_maxt = ccn1_max * 1.e6 do j = 1,n3 do i = 1,n2 @@ -528,8 +583,8 @@ Subroutine init_tracer (n1,n2,n3,tracerp,dn0,ifm,nsc) !Set up Vertical profile, Exponential decrease that scales with pressure if(nsc==1) then - if(k<=2) tracerp(k,i,j)=ccn_maxt - if(k>2) tracerp(k,i,j)=ccn_maxt*exp(-zt(k)/7000.) + if(k<=2) tracerp(k,i,j)=ccn1_maxt + if(k>2) tracerp(k,i,j)=ccn1_maxt*exp(-zt(k)/7000.) endif !Set up Field of CCN mass mixing ratio (kg/kg) if(nsc==2) then @@ -720,8 +775,11 @@ Subroutine micinit () print*,'' endif +! 125 micron max diameter ice crystal size for participating +! in Hallet-Mossop 2ndary ice splintering process. dps = 125.e-6 dps2 = dps ** 2 + rictmin = 1.0001 rictmax = 0.9999 * float(nembc) diff --git a/src/6.3.02/micro/mic_misc.f90 b/src/micro/mic_misc.f90 similarity index 97% rename from src/6.3.02/micro/mic_misc.f90 rename to src/micro/mic_misc.f90 index 0d6d104..b2877bf 100644 --- a/src/6.3.02/micro/mic_misc.f90 +++ b/src/micro/mic_misc.f90 @@ -160,10 +160,10 @@ Subroutine range_check (m1,k1,k2,k3,i,j,frq,ngr,dtlt,time,micro) cifnx(k) = micro%cifnp(k,i,j) endif if (iaerosol > 0) then - aerocon(k,1) = micro%cccnp(k,i,j) - aeromas(k,1) = micro%cccmp(k,i,j) - aerocon(k,2) = micro%gccnp(k,i,j) - aeromas(k,2) = micro%gccmp(k,i,j) + aerocon(k,1) = micro%cn1np(k,i,j) + aeromas(k,1) = micro%cn1mp(k,i,j) + aerocon(k,2) = micro%cn2np(k,i,j) + aeromas(k,2) = micro%cn2mp(k,i,j) endif if (idust > 0) then aerocon(k,3) = micro%md1np(k,i,j) @@ -423,6 +423,10 @@ Subroutine range_check (m1,k1,k2,k3,i,j,frq,ngr,dtlt,time,micro) xnucicert(k) = micro%nucicert(k,i,j) xvapliqt(k) = micro%vapliqt(k,i,j) xvapicet(k) = micro%vapicet(k,i,j) + xevapliqt(k) = micro%evapliqt(k,i,j) + xevapicet(k) = micro%evapicet(k,i,j) + xfreezingt(k) = micro%freezingt(k,i,j) + xmeltingt(k) = micro%meltingt(k,i,j) xmelticet(k) = micro%melticet(k,i,j) xrimecldt(k) = micro%rimecldt(k,i,j) xaggregatet(k) = micro%aggregatet(k,i,j) @@ -445,6 +449,14 @@ Subroutine range_check (m1,k1,k2,k3,i,j,frq,ngr,dtlt,time,micro) xvapgraut(k) = micro%vapgraut(k,i,j) xvaphailt(k) = micro%vaphailt(k,i,j) xvapdrizt(k) = micro%vapdrizt(k,i,j) + xevapcldt(k) = micro%evapcldt(k,i,j) + xevapraint(k) = micro%evapraint(k,i,j) + xevapprist(k) = micro%evapprist(k,i,j) + xevapsnowt(k) = micro%evapsnowt(k,i,j) + xevapaggrt(k) = micro%evapaggrt(k,i,j) + xevapgraut(k) = micro%evapgraut(k,i,j) + xevaphailt(k) = micro%evaphailt(k,i,j) + xevapdrizt(k) = micro%evapdrizt(k,i,j) xmeltprist(k) = micro%meltprist(k,i,j) xmeltsnowt(k) = micro%meltsnowt(k,i,j) xmeltaggrt(k) = micro%meltaggrt(k,i,j) @@ -494,6 +506,10 @@ Subroutine range_check (m1,k1,k2,k3,i,j,frq,ngr,dtlt,time,micro) xnucicert(k) = 0. xvapliqt(k) = 0. xvapicet(k) = 0. + xevapliqt(k) = 0. + xevapicet(k) = 0. + xfreezingt(k) = 0. + xmeltingt(k) = 0. xmelticet(k) = 0. xrimecldt(k) = 0. xaggregatet(k) = 0. @@ -516,6 +532,14 @@ Subroutine range_check (m1,k1,k2,k3,i,j,frq,ngr,dtlt,time,micro) xvapgraut(k) = 0. xvaphailt(k) = 0. xvapdrizt(k) = 0. + xevapcldt(k) = 0. + xevapraint(k) = 0. + xevapprist(k) = 0. + xevapsnowt(k) = 0. + xevapaggrt(k) = 0. + xevapgraut(k) = 0. + xevaphailt(k) = 0. + xevapdrizt(k) = 0. xmeltprist(k) = 0. xmeltsnowt(k) = 0. xmeltaggrt(k) = 0. diff --git a/src/6.3.02/micro/mic_nuc.f90 b/src/micro/mic_nuc.f90 similarity index 94% rename from src/6.3.02/micro/mic_nuc.f90 rename to src/micro/mic_nuc.f90 index 01202f2..e030fb7 100644 --- a/src/6.3.02/micro/mic_nuc.f90 +++ b/src/micro/mic_nuc.f90 @@ -13,7 +13,7 @@ Subroutine cldnuc (m1,k1cnuc,k2cnuc,k1dnuc,k2dnuc,rv,wp,i,j,dn0) real :: tairc_nuc,w_nuc,rg_nuc,tab,sfcareatotal real :: rjw,wtw1,wtw2,rjconcen,wtcon1,wtcon2,jrg1,jrg2,eps1,eps2 real :: total_cld_nucc,total_drz_nucc,total_cld_nucr,total_drz_nucr -real, dimension(9) :: concen_tab +real, dimension(aerocat) :: concen_tab !Re-set cloud layer before nucleation k1cnuc = 2 @@ -50,7 +50,7 @@ Subroutine cldnuc (m1,k1cnuc,k2cnuc,k1dnuc,k2dnuc,rv,wp,i,j,dn0) enddo !************************************************************************* -!Saleeby(6/3/02) Prognosing number concentration of cloud and drizzle **** +!Saleeby(6/3/2002) Prognosing number concentration of cloud and drizzle **** !************************************************************************* elseif (jnmb(1) >= 5) then do k = 2,m1-1 @@ -68,15 +68,15 @@ Subroutine cldnuc (m1,k1cnuc,k2cnuc,k1dnuc,k2dnuc,rv,wp,i,j,dn0) !Set aside ice nuclei for DeMott scheme and recomute aerosol stats if(iifn==3) CALL prenuc_ifn (m1,k,dn0,rv) -!**********LOOP OVER CCN, GCCN, 2 DUST MODES, 3 SALT MODES *************** +!**********LOOP OVER 2 CCN MODES, 2 DUST MODES, 3 SALT MODES *************** !Use the acat loop for turning on aerosol nucleation do acat=1,aerocat concen_tab(acat) = 0.0 concen_nuc = 0.0 - if((acat==1) .or. & ! CCN - (acat==2) .or. & ! GCCN + if((acat==1) .or. & ! CCN-1 + (acat==2) .or. & ! CCN-2 (acat==3 .and. idust>0) .or. & ! Small dust mode (acat==4 .and. idust>0) .or. & ! Large dust mode (acat==5 .and. isalt>0) .or. & ! Salt film mode @@ -181,6 +181,15 @@ Subroutine cldnuc (m1,k1cnuc,k2cnuc,k1dnuc,k2dnuc,rv,wp,i,j,dn0) endif concen_tab(acat) = concen_nuc * tab * epstemp + !Saleeby(2023-06-06) + !Override nucleation if median radius (rg) less than minimum lookup + !table size. In the past we simply forced rg up to the minimum and + !continued activation of aerosols with rg < 10nm. Perhaps we need to + !limit this activation. So, no activation if rg < 10nm. In this respect, + !some aerosols may be carried around without nucleating. They can still + !be radiatively important and undergo depositin. + if (rg < 0.01e-6) concen_tab(acat) = 0.0 + endif !if concen_nuc > mincon endif !if acat aerosol type is valid enddo !looping over aerocat @@ -190,8 +199,8 @@ Subroutine cldnuc (m1,k1cnuc,k2cnuc,k1dnuc,k2dnuc,rv,wp,i,j,dn0) do acat=1,aerocat aero_ratio(acat) = 0.0 ! Aerosol fraction aero_vap(acat) = 0.0 ! Total surface area of aerosol category - if((acat==1) .or. & ! CCN - (acat==2) .or. & ! GCCN + if((acat==1) .or. & ! CCN-1 + (acat==2) .or. & ! CCN-2 (acat==3 .and. idust>0) .or. & ! Small dust mode (acat==4 .and. idust>0) .or. & ! Large dust mode (acat==5 .and. isalt>0) .or. & ! Salt film mode @@ -220,8 +229,8 @@ Subroutine cldnuc (m1,k1cnuc,k2cnuc,k1dnuc,k2dnuc,rv,wp,i,j,dn0) total_drz_nucr=0.0 do acat=1,aerocat ctc = 0 - if((acat==1) .or. & ! CCN - (acat==2) .or. & ! GCCN + if((acat==1) .or. & ! CCN-1 + (acat==2) .or. & ! CCN-2 (acat==3 .and. idust>0) .or. & ! Small dust mode (acat==4 .and. idust>0) .or. & ! Large dust mode (acat==5 .and. isalt>0) .or. & ! Salt film mode @@ -256,6 +265,11 @@ Subroutine cldnuc (m1,k1cnuc,k2cnuc,k1dnuc,k2dnuc,rv,wp,i,j,dn0) !Vapor allocated to a given aerosol species vaprccn = 0.5*excessrv*cldrat !Sum of all nucleation <= 1/2 excessrv + !Saleeby(2023-06-01): Replacing line above to try and limit new nucleation. + !Anecdotal evidence suggests that we nucleate too many aerosols, so we are + !seeing if this will switch more to growth of existing droplets over making + !more new ones. + !vaprccn = 0.25*excessrv*cldrat !Sum of all nucleation <= 1/4 excessrv !Determine if nucleated droplets go to cloud or drizzle drop=1 @@ -266,8 +280,9 @@ Subroutine cldnuc (m1,k1cnuc,k2cnuc,k1dnuc,k2dnuc,rv,wp,i,j,dn0) if(concen_tab(acat) > vaprccn / emb0(drop)) concen_tab(acat) = vaprccn / emb0(drop) if(concen_tab(acat) < vaprccn / emb1(drop)) vaprccn = concen_tab(acat) * emb1(drop) -!Nucleate to 2-micron diameter droplets whose mass is emb0 -!if(concen_tab(acat) * emb0(drop) <= vaprccn) vaprccn=concen_tab(acat) * emb0(drop) + !Saleeby(2023-05-30) + !Nucleate to minimum drop diameter (cloud or drizzle) droplets whose mass is emb0 + if(concen_tab(acat) * emb0(drop) <= vaprccn) vaprccn=concen_tab(acat) * emb0(drop) !Accumulated nucleated particles if not removing them if(iccnlev==0) then @@ -370,7 +385,7 @@ Subroutine cldnuc (m1,k1cnuc,k2cnuc,k1dnuc,k2dnuc,rv,wp,i,j,dn0) ccncon(ic) = ccncon(ic) + ccncon(ic-1) ccnmas(ic) = ccnmas(ic) + ccnmas(ic-1) endif - !Track immersion freezing droplets that contain large CCN, GCCN, or DUST + !Track immersion freezing droplets that contain large CCN1, CCN2, or DUST ! Do not track immersion freezing for salt species (acat=5,6,7) if(iifn==3.and.(acat==1.or.acat==2.or.acat==3.or.acat==4.or.acat==8.or.acat==9 & .or.acat==aerocat-1.or.acat==aerocat) & @@ -762,12 +777,12 @@ Subroutine icenuc (m1,kc1,kc2,kd1,kd2,k1pnuc,k2pnuc,ngr,rv,dn0,dtlt,i,j) !Input aerosols in #/cm3 and outputs #/L activated if(iifn_formula==1) then !Original Demott(2010) formula - nifn(k) = 0.0000594 * (-tairc(k))**3.33 & - * (tot_in)**(0.0264*(-tairc(k))+0.0033) + nifn(k) = 0.0000594 * ( -max(-35.0,tairc(k)) )**3.33 & + * (tot_in)**(0.0264*( -max(-35.0,tairc(k)) )+0.0033) elseif(iifn_formula==2) then !Modified Demott(2010) for dust-dominated cases !Paul suggested an additional factor of 3 multiplier - nifn(k) = 3.0 * 0.0008 * 10 ** (-0.2*(tairc(k)+9.7)) * tot_in ** 1.25 + nifn(k) = 3.0 * 0.0008 * 10 ** (-0.2*(max(-35.0,tairc(k))+9.7)) * tot_in ** 1.25 endif !Adjust units and such @@ -797,15 +812,15 @@ Subroutine icenuc (m1,kc1,kc2,kd1,kd2,k1pnuc,k2pnuc,ngr,rv,dn0,dtlt,i,j) vapnuc=0.0 if(jnmb(1)>=5)then if(iccnlev==0) then - vapnuc = max(0.,haznuc + diagni - cx(k,3)) + vapnuc = max(0.,haznuc + diagni - cx(k,3) - cx(k,4)) elseif(iccnlev>=1 .and. iifn==3) then vapnuc = max(0.,haznuc + diagni) elseif(iccnlev>=1 .and. iifn<=2) then vapnuc = max(0.,haznuc) - vapnuc = vapnuc + max(0.,diagni - cx(k,3)) + vapnuc = vapnuc + max(0.,diagni - cx(k,3) - cx(k,4)) endif else - vapnuc = max(0.,haznuc + diagni - cx(k,3)) + vapnuc = max(0.,haznuc + diagni - cx(k,3) - cx(k,4)) endif !Modify haze nucleation and IN nucleation if not enough vapor available @@ -821,7 +836,7 @@ Subroutine icenuc (m1,kc1,kc2,kd1,kd2,k1pnuc,k2pnuc,ngr,rv,dn0,dtlt,i,j) !(Saleeby10-17-2011) Determine haze nucleation and IN nucleation !DeMott(2010) formula already applied for ICLOUD >= 5 !Allow large DeMott (diagni) particles to preferentially nucleate - !over the haze particles (cccnp) for IIFN==3. Perhaps should include + !over the haze particles (cn1np) for IIFN==3. Perhaps should include !all aerosols into potential haze nucleation? if((haznuc.gt.0.0 .or. diagni.gt.0.0) .and. jnmb(3).ge.5) then @@ -894,12 +909,12 @@ Subroutine icenuc (m1,kc1,kc2,kd1,kd2,k1pnuc,k2pnuc,ngr,rv,dn0,dtlt,i,j) !Input aerosols in #/cm3 and outputs #/L activated if(iifn_formula==1) then !Original Demott(2010) formula - ifntemp = 0.0000594 * (-tairc(k))**3.33 & - * (tot_in)**(0.0264*(-tairc(k))+0.0033) + ifntemp = 0.0000594 * ( -max(-35.0,tairc(k)) )**3.33 & + * (tot_in)**(0.0264*( -max(-35.0,tairc(k)) )+0.0033) elseif(iifn_formula==2) then !Modified Demott(2010) for dust-dominated cases !Paul suggested an additional factor of 3 multiplier - ifntemp = 3.0 * 0.0008 * 10 ** (-0.2*(tairc(k)+9.7)) * tot_in ** 1.25 + ifntemp = 3.0 * 0.0008 * 10 ** (-0.2*(max(-35.0,tairc(k))+9.7)) * tot_in ** 1.25 endif !Adjust units and such diff --git a/src/6.3.02/micro/mic_nucpre.f90 b/src/micro/mic_nucpre.f90 similarity index 92% rename from src/6.3.02/micro/mic_nucpre.f90 rename to src/micro/mic_nucpre.f90 index c79240b..7a56c2f 100644 --- a/src/6.3.02/micro/mic_nucpre.f90 +++ b/src/micro/mic_nucpre.f90 @@ -14,8 +14,8 @@ Subroutine prenuc_ccn (k,i,j) !Set default values to override if aerosol type exists aero_rg(acat) = aero_medrad(acat) ! Default median radius - if((acat==1) .or. & ! CCN - (acat==2) .or. & ! GCCN + if((acat==1) .or. & ! CCN-1 + (acat==2) .or. & ! CCN-2 (acat==3 .and. idust>0) .or. & ! Small dust mode (acat==4 .and. idust>0) .or. & ! Large dust mode (acat==5 .and. isalt>0) .or. & ! Salt film mode @@ -36,7 +36,9 @@ Subroutine prenuc_ccn (k,i,j) aero_rg(acat)=((0.23873/rhosol*aeromas(k,acat)/aerocon(k,acat)) & **(1./3.))/aero_rg2rm(acat) - if(aero_rg(acat) < 0.01e-6) aero_rg(acat) = 0.01e-6 + !Saleeby(2023-06-06):Do not limit minimum rg (median radius) + !if(aero_rg(acat) < 0.01e-6) aero_rg(acat) = 0.01e-6 + if(aero_rg(acat) > 6.50e-6) aero_rg(acat) = 6.50e-6 aeromas(k,acat) = ((aero_rg(acat)*aero_rg2rm(acat))**3.) & @@ -75,16 +77,15 @@ Subroutine prenuc_ifn (m1,k,dn0,rv) tot_in = 0.0 total_in(k) = 0.0 - !Loop over CCN, GCCN, SMALL DUST, LARGE DUST, REGEN 1&2 (1,2,3,4,8,9) - !Not looping over salt species since these cannot act is ice nuclei + !Not looping over salt species since these are not allowed to act as ice nuclei do acat=1,aerocat in_thresh = 1 totifnn(k,acat) = 0.0 totifnm(k,acat) = 0.0 - if((acat==1) .or. & ! CCN - (acat==2) .or. & ! GCCN + if((acat==1) .or. & ! CCN-1 + (acat==2) .or. & ! CCN-2 (acat==3 .and. idust>0) .or. & ! Small dust mode (acat==4 .and. idust>0) .or. & ! Large dust mode (acat==8 .and. iabcarb>0) .or. & ! Absorbing carbon 1 mode @@ -183,7 +184,7 @@ Subroutine prenuc_ifn (m1,k,dn0,rv) !DeMott IN activation based on total number of all aerosol !greater than 0.5 micron diameter. nifn(k) = 0.0 - if(tairc(k) .lt. 0.0 .and. total_in(k) .gt. mincon) then + if(tairc(k) < 0.0 .and. total_in(k) > mincon) then !For DeMott Eqn, the aerosol number to put into the eqn needs to be !the remaining of unprocessed aerosols > 0.5 microns + the remaining !aerosols > 0.5 microns contained in droplets + @@ -202,12 +203,12 @@ Subroutine prenuc_ifn (m1,k,dn0,rv) !Input aerosols in #/cm3 and outputs #/L activated if(iifn_formula==1) then !Original Demott(2010) formula - nifn(k) = 0.0000594 * (-tairc(k))**3.33 & - * (tot_in)**(0.0264*(-tairc(k))+0.0033) + nifn(k) = 0.0000594 * ( -max(-35.0,tairc(k)) )**3.33 & + * (tot_in)**(0.0264*( -max(-35.0,tairc(k)) )+0.0033) elseif(iifn_formula==2) then !Modified Demott(2010) for dust-dominated cases !Paul suggested an additional factor of 3 multiplier - nifn(k) = 3.0 * 0.0008 * 10 ** (-0.2*(tairc(k)+9.7)) * tot_in ** 1.25 + nifn(k) = 3.0 * 0.0008 * 10 ** (-0.2*(max(-35.0,tairc(k))+9.7)) * tot_in ** 1.25 endif !Adjust units and such @@ -254,8 +255,8 @@ Subroutine prenuc_ifn (m1,k,dn0,rv) totifnn(k,acat) = totifnn(k,acat) * ifnfrac totifnm(k,acat) = totifnm(k,acat) * ifnfrac if(iccnlev>=1 .and. ifnfrac>0.0) then - if((acat==1) .or. & ! CCN - (acat==2) .or. & ! GCCN + if((acat==1) .or. & ! CCN-1 + (acat==2) .or. & ! CCN-2 (acat==3 .and. idust>0) .or. & ! Small dust mode (acat==4 .and. idust>0) .or. & ! Large dust mode (acat==8 .and. iabcarb>0) .or. & ! Absorbing carbon 1 mode @@ -296,7 +297,10 @@ Subroutine prenuc_ifn (m1,k,dn0,rv) rhosol=aero_rhosol(acat) aero_rg(acat)=((0.23873/rhosol*aeromas(k,acat)/aerocon(k,acat)) & **(1./3.))/aero_rg2rm(acat) - if(aero_rg(acat) < 0.01e-6) aero_rg(acat) = 0.01e-6 + + !Saleeby(2023-06-06):Do not limit minimum rg (median radius) + !if(aero_rg(acat) < 0.01e-6) aero_rg(acat) = 0.01e-6 + if(aero_rg(acat) > 6.50e-6) aero_rg(acat) = 6.50e-6 aeromas(k,acat) = ((aero_rg(acat)*aero_rg2rm(acat))**3.) & *aerocon(k,acat)/(0.23873/rhosol) diff --git a/src/6.3.02/micro/mic_nuctab.f90 b/src/micro/mic_nuctab.f90 similarity index 99% rename from src/6.3.02/micro/mic_nuctab.f90 rename to src/micro/mic_nuctab.f90 index 44cbe21..3b7e6ae 100644 --- a/src/6.3.02/micro/mic_nuctab.f90 +++ b/src/micro/mic_nuctab.f90 @@ -13,12 +13,12 @@ Subroutine aero_nuc_tab_nh42so4 (rrv,rrvlsair,eps1,eps2,wtw1,wtw2,wtcon1,wtcon2 real :: mult1,mult2,nucss1,nucss2,nucss,rrv,rrvlsair !Saleeby (6/3/02) -!The following tables are percent of prescibed CCN to activate. +!The following tables are percent of prescibed aerosols to activate. !Table dimensions are: ! (median radius,updraft,concentration,temperature,solubility). -!Large aerosols or GCCN number are prescibed by the user and these +!Large aerosols (rg>0.96microns) are prescibed by the user and these !automatically nucleate and they have no lookup tables. -!Small aerosols or CCN with median radius from 0.01 - 0.96 microns +!Small aerosols with median radius from 0.01 - 0.96 microns !are user prescribed in concentration from 1 - 10,000 /mg. !Median radius is in centimeters as is the parcel model. @@ -7193,12 +7193,12 @@ Subroutine aero_nuc_tab_nacl (rrv,rrvlsair,eps1,eps2,wtw1,wtw2,wtcon1,wtcon2 & real :: mult1,mult2,nucss1,nucss2,nucss,rrv,rrvlsair !Saleeby (6/3/02) -!The following tables are percent of prescibed CCN to activate. +!The following tables are percent of prescibed aerosols to activate. !Table dimensions are: ! (median radius,updraft,concentration,temperature,solubility). -!Large aerosols or GCCN number are prescibed by the user and these +!Large aerosols are prescibed by the user and these !automatically nucleate and they have no lookup tables. -!Small aerosols or CCN with median radius from 0.01 - 0.96 microns +!Small aerosols with median radius from 0.01 - 0.96 microns !are user prescribed in concentration from 1 - 10,000 /mg. !Median radius is in centimeters as is the parcel model. diff --git a/src/6.3.02/micro/mic_tabs.f90 b/src/micro/mic_tabs.f90 similarity index 100% rename from src/6.3.02/micro/mic_tabs.f90 rename to src/micro/mic_tabs.f90 diff --git a/src/6.3.02/micro/mic_vap.f90 b/src/micro/mic_vap.f90 similarity index 93% rename from src/6.3.02/micro/mic_vap.f90 rename to src/micro/mic_vap.f90 index 4412ebe..829954c 100644 --- a/src/6.3.02/micro/mic_vap.f90 +++ b/src/micro/mic_vap.f90 @@ -339,14 +339,22 @@ Subroutine vapflux (m1,lcat,k1,k2,rv,i,j) endif endif - !Vapor deposition and evaporation budgets for all species + !Vapor deposition and evaporation budgets for all species. + !Deposition, condensation, evaporation, sublimation are all given positive + ! values as process rates. if(imbudget >= 1) then - if(lcat.eq.1 .or. lcat.eq.2 .or. lcat.eq.8) & - xvapliqt(k) = xvapliqt(k) + vap(k,lcat)*budget_scalet - if(lcat.ge.3 .and. lcat.le.7) & - xvapicet(k) = xvapicet(k) + vap(k,lcat)*budget_scalet + if(lcat.eq.1 .or. lcat.eq.2 .or. lcat.eq.8) then + if(vap(k,lcat) > 0.00) xvapliqt(k) = xvapliqt(k) + vap(k,lcat)*budget_scalet + if(vap(k,lcat) < 0.00) xevapliqt(k) = xevapliqt(k) - vap(k,lcat)*budget_scalet + endif + if(lcat.ge.3 .and. lcat.le.7) then + if(vap(k,lcat) > 0.00) xvapicet(k) = xvapicet(k) + vap(k,lcat)*budget_scalet + if(vap(k,lcat) < 0.00) xevapicet(k) = xevapicet(k) - vap(k,lcat)*budget_scalet + endif endif + if(imbudget >= 2) then + if(vap(k,lcat) > 0.00) then if(lcat==1) xvapcldt(k) = xvapcldt(k) + vap(k,lcat)*budget_scalet if(lcat==2) xvapraint(k) = xvapraint(k) + vap(k,lcat)*budget_scalet if(lcat==3) xvapprist(k) = xvapprist(k) + vap(k,lcat)*budget_scalet @@ -355,6 +363,17 @@ Subroutine vapflux (m1,lcat,k1,k2,rv,i,j) if(lcat==6) xvapgraut(k) = xvapgraut(k) + vap(k,lcat)*budget_scalet if(lcat==7) xvaphailt(k) = xvaphailt(k) + vap(k,lcat)*budget_scalet if(lcat==8) xvapdrizt(k) = xvapdrizt(k) + vap(k,lcat)*budget_scalet + endif + if(vap(k,lcat) < 0.00) then + if(lcat==1) xevapcldt(k) = xevapcldt(k) - vap(k,lcat)*budget_scalet + if(lcat==2) xevapraint(k) = xevapraint(k) - vap(k,lcat)*budget_scalet + if(lcat==3) xevapprist(k) = xevapprist(k) - vap(k,lcat)*budget_scalet + if(lcat==4) xevapsnowt(k) = xevapsnowt(k) - vap(k,lcat)*budget_scalet + if(lcat==5) xevapaggrt(k) = xevapaggrt(k) - vap(k,lcat)*budget_scalet + if(lcat==6) xevapgraut(k) = xevapgraut(k) - vap(k,lcat)*budget_scalet + if(lcat==7) xevaphailt(k) = xevaphailt(k) - vap(k,lcat)*budget_scalet + if(lcat==8) xevapdrizt(k) = xevapdrizt(k) - vap(k,lcat)*budget_scalet + endif endif 229 continue diff --git a/src/6.3.02/micro/micphys.f90 b/src/micro/micphys.f90 similarity index 95% rename from src/6.3.02/micro/micphys.f90 rename to src/micro/micphys.f90 index 98c9718..c7accd8 100644 --- a/src/6.3.02/micro/micphys.f90 +++ b/src/micro/micphys.f90 @@ -19,7 +19,7 @@ Module micphys ,nembc=20 real, parameter :: dtc=1.,ddnc=2.e-6 ,dthz=1.,drhhz=.02 real, parameter :: budget_scalet=1. -real, parameter :: rxmin=1.e-9,cxmin=1.e-3 +real, parameter :: rxmin=1.e-16,cxmin=1.e-5 !IDIFFPERTS !0=normal scalar diffusion @@ -104,13 +104,16 @@ Module micphys !******Variables Needed for COMPUTING BUDGETS ****************************** !For imbudget>=1 real, dimension(nzpmax) :: xlatheatvap,xlatheatfrz,xnuccldrt,xcld2raint & -,xice2raint,xnucicert,xvapliqt,xvapicet,xmelticet,xrimecldt,xaggregatet & +,xice2raint,xnucicert,xvapliqt,xvapicet,xevapliqt,xevapicet & +,xmelticet,xrimecldt,xaggregatet,xfreezingt,xmeltingt & ,xrain2icet,xlatheatvapt,xlatheatfrzt !For imbudget>=2 real, dimension(nzpmax) :: xinuchomrt,xinuccontrt,xinucifnrt,xinuchazrt & ,xvapcldt,xvapraint,xvapprist,xvapsnowt,xvapaggrt,xvapgraut,xvaphailt & -,xvapdrizt,xmeltprist,xmeltsnowt,xmeltaggrt,xmeltgraut,xmelthailt & +,xvapdrizt,xevapcldt,xevapraint,xevapprist,xevapsnowt,xevapaggrt & +,xevapgraut,xevaphailt,xevapdrizt & +,xmeltprist,xmeltsnowt,xmeltaggrt,xmeltgraut,xmelthailt & ,xrimecldsnowt,xrimecldaggrt,xrimecldgraut,xrimecldhailt,xrain2prt & ,xrain2snt,xrain2agt,xrain2grt,xrain2hat,xaggrselfprist & ,xaggrselfsnowt,xaggrprissnowt @@ -128,7 +131,7 @@ Module micphys !******Variables Needed for CCN nucleation and restore ********************* integer :: iccnlev,ic,rgb -real :: cin_max,ccn_max,gccn_max,dust1_max,dust2_max,saltf_max,saltj_max & +real :: cin_max,ccn1_max,ccn2_max,dust1_max,dust2_max,saltf_max,saltj_max & ,salts_max,enxferratio,rxferratio,ccnmass,ccnnum,rxtemp,cxtemp,fracmass & ,cxloss,concen_nuc,aeromass,rg,rhosol,cldrat,epsil,ant,rcm,rmlar,rmsma & ,power,scnmass,dcnmass,dinmass,abc1_max,abc2_max @@ -163,8 +166,8 @@ Module micphys !Make sure you change both if you alter number of species !Each category can have the soluble component be either !Ammonium sulfate (NH4-2SO4) or Sodium chloride (NaCl) -! 1 = Sub-micron CCN -! 2 = Super-micron GCCN +! 1 = CCN mode 1 +! 2 = CCN mode 2 ! 3 = Small mode mineral dust (soluble coating) ! 4 = Large mode mineral dust (soluble coating) ! 5 = Film mode sea salt @@ -194,8 +197,8 @@ Module micphys !tables with parcel model runs using a new sigma. The median radii bins !in nucleation and pre_nucleation routines (rg, rmsma, rmlar) are also !specifically set for sigma=1.8. These would need to be updated as well. -data aero_sigma / 1.80 & !CCN - ,1.80 & !GCCN +data aero_sigma / 1.80 & !CCN mode 1 + ,1.80 & !CCN mode 2 ,1.80 & !small mineral dust ,1.80 & !large mineral dust ,1.80 & !salt film mode @@ -208,8 +211,8 @@ Module micphys !Set the relationship between median radius and mean mass radius !based on aerosol distribution spectral width !exp(1.5 * (alog(sigma))**2) -data aero_rg2rm / 1.6791 & !CCN - ,1.6791 & !GCCN +data aero_rg2rm / 1.6791 & !CCN mode 1 + ,1.6791 & !CCN mode 2 ,1.6791 & !small mineral dust ,1.6791 & !large mineral dust ,1.6791 & !salt film mode diff --git a/src/6.3.02/micro/write_scm.f90 b/src/micro/write_scm.f90 similarity index 92% rename from src/6.3.02/micro/write_scm.f90 rename to src/micro/write_scm.f90 index 459e6bf..4dc720f 100644 --- a/src/6.3.02/micro/write_scm.f90 +++ b/src/micro/write_scm.f90 @@ -145,10 +145,10 @@ Subroutine readwrite_scm (wf,fln) endif if(iaerosol > 0) then - CALL iofil ('cccnp.txt',micro_g(ng)%cccnp(:,i,j),m1,wf,fln) - CALL iofil ('cccmp.txt',micro_g(ng)%cccmp(:,i,j),m1,wf,fln) - CALL iofil ('gccnp.txt',micro_g(ng)%gccnp(:,i,j),m1,wf,fln) - CALL iofil ('gccmp.txt',micro_g(ng)%gccmp(:,i,j),m1,wf,fln) + CALL iofil ('cn1np.txt',micro_g(ng)%cn1np(:,i,j),m1,wf,fln) + CALL iofil ('cn1mp.txt',micro_g(ng)%cn1mp(:,i,j),m1,wf,fln) + CALL iofil ('cn2np.txt',micro_g(ng)%cn2np(:,i,j),m1,wf,fln) + CALL iofil ('cn2mp.txt',micro_g(ng)%cn2mp(:,i,j),m1,wf,fln) endif if(idust > 0) then @@ -295,7 +295,7 @@ Subroutine readwrite_scm (wf,fln) if(jnmb(8)>=5) CALL iofil ('immerdp.txt',micro_g(ng)%immerdp(:,i,j),m1,wf,fln) if(jnmb(2)>=5) CALL iofil ('immerrp.txt',micro_g(ng)%immerrp(:,i,j),m1,wf,fln) endif - if(imbudget>=1) then !14 + if(imbudget>=1) then !18 CALL iofil ('latheatvap.txt' ,micro_g(ng)%latheatvap (:,i,j),m1,wf,fln) CALL iofil ('latheatfrz.txt' ,micro_g(ng)%latheatfrz (:,i,j),m1,wf,fln) CALL iofil ('nuccldrt.txt' ,micro_g(ng)%nuccldrt (:,i,j),m1,wf,fln) @@ -304,6 +304,10 @@ Subroutine readwrite_scm (wf,fln) CALL iofil ('nucicert.txt' ,micro_g(ng)%nucicert (:,i,j),m1,wf,fln) CALL iofil ('vapliqt.txt' ,micro_g(ng)%vapliqt (:,i,j),m1,wf,fln) CALL iofil ('vapicet.txt' ,micro_g(ng)%vapicet (:,i,j),m1,wf,fln) + CALL iofil ('evapliqt.txt' ,micro_g(ng)%evapliqt (:,i,j),m1,wf,fln) + CALL iofil ('evapicet.txt' ,micro_g(ng)%evapicet (:,i,j),m1,wf,fln) + CALL iofil ('freezingt.txt' ,micro_g(ng)%freezingt (:,i,j),m1,wf,fln) + CALL iofil ('meltingt.txt' ,micro_g(ng)%meltingt (:,i,j),m1,wf,fln) CALL iofil ('melticet.txt' ,micro_g(ng)%melticet (:,i,j),m1,wf,fln) CALL iofil ('rimecldt.txt' ,micro_g(ng)%rimecldt (:,i,j),m1,wf,fln) CALL iofil ('rain2icet.txt' ,micro_g(ng)%rain2icet (:,i,j),m1,wf,fln) @@ -311,7 +315,7 @@ Subroutine readwrite_scm (wf,fln) CALL iofil ('latheatvapt.txt',micro_g(ng)%latheatvapt(:,i,j),m1,wf,fln) CALL iofil ('latheatfrzt.txt',micro_g(ng)%latheatfrzt(:,i,j),m1,wf,fln) endif - if(imbudget>=2) then !29 + if(imbudget>=2) then !37 CALL iofil ('inuchomrt.txt' ,micro_g(ng)%inuchomrt (:,i,j),m1,wf,fln) CALL iofil ('inuccontrt.txt' ,micro_g(ng)%inuccontrt (:,i,j),m1,wf,fln) CALL iofil ('inucifnrt.txt' ,micro_g(ng)%inucifnrt (:,i,j),m1,wf,fln) @@ -324,6 +328,14 @@ Subroutine readwrite_scm (wf,fln) CALL iofil ('vapgraut.txt' ,micro_g(ng)%vapgraut (:,i,j),m1,wf,fln) CALL iofil ('vaphailt.txt' ,micro_g(ng)%vaphailt (:,i,j),m1,wf,fln) CALL iofil ('vapdrizt.txt' ,micro_g(ng)%vapdrizt (:,i,j),m1,wf,fln) + CALL iofil ('evapcldt.txt' ,micro_g(ng)%evapcldt (:,i,j),m1,wf,fln) + CALL iofil ('evapraint.txt' ,micro_g(ng)%evapraint (:,i,j),m1,wf,fln) + CALL iofil ('evapprist.txt' ,micro_g(ng)%evapprist (:,i,j),m1,wf,fln) + CALL iofil ('evapsnowt.txt' ,micro_g(ng)%evapsnowt (:,i,j),m1,wf,fln) + CALL iofil ('evapaggrt.txt' ,micro_g(ng)%evapaggrt (:,i,j),m1,wf,fln) + CALL iofil ('evapgraut.txt' ,micro_g(ng)%evapgraut (:,i,j),m1,wf,fln) + CALL iofil ('evaphailt.txt' ,micro_g(ng)%evaphailt (:,i,j),m1,wf,fln) + CALL iofil ('evapdrizt.txt' ,micro_g(ng)%evapdrizt (:,i,j),m1,wf,fln) CALL iofil ('meltprist.txt' ,micro_g(ng)%meltprist (:,i,j),m1,wf,fln) CALL iofil ('meltsnowt.txt' ,micro_g(ng)%meltsnowt (:,i,j),m1,wf,fln) CALL iofil ('meltaggrt.txt' ,micro_g(ng)%meltaggrt (:,i,j),m1,wf,fln) diff --git a/src/6.3.02/micro_bin/micro_prm.f90 b/src/micro_bin/micro_prm.f90 similarity index 100% rename from src/6.3.02/micro_bin/micro_prm.f90 rename to src/micro_bin/micro_prm.f90 diff --git a/src/6.3.02/micro_bin/microphysics.f90 b/src/micro_bin/microphysics.f90 similarity index 99% rename from src/6.3.02/micro_bin/microphysics.f90 rename to src/micro_bin/microphysics.f90 index 284df0f..868f6d1 100644 --- a/src/6.3.02/micro_bin/microphysics.f90 +++ b/src/micro_bin/microphysics.f90 @@ -44,7 +44,7 @@ Subroutine micro_proc () use mem_micro use rconstants use micro_prm -use micphys, only: imbudget,ipris,igraup,ihail,ccn_max +use micphys, only: imbudget,ipris,igraup,ihail,ccn1_max IMPLICIT NONE @@ -77,7 +77,7 @@ Subroutine micro_proc () integer itimestep, kr, ikl do kr=1,nkr - fccn0(kr) =FCCNR0(KR)*1000.*xccn(kr)*ccn_max + fccn0(kr) =FCCNR0(KR)*1000.*xccn(kr)*ccn1_max enddo @@ -455,7 +455,7 @@ Subroutine micro_init (bininit) use micro_prm use mem_micro use mem_grid -use micphys, only:ccn_max,cin_max,iaero_chem,aero_medrad,iifn +use micphys, only:ccn1_max,cin_max,iaero_chem,aero_medrad,iifn use module_hujisbm IMPLICIT NONE @@ -547,23 +547,23 @@ Subroutine micro_init (bininit) ! Initialize arrays for the initial run. Do not run this for history restart. if(bininit==1) then -!Factor of 1000 is to convert to CGS units. ccn_max is #/mg +!Factor of 1000 is to convert to CGS units. ccn1_max is #/mg DO k=1,mzp DO i=1,mxp DO j=1,myp DO KR=1,NKR IF (k<=2) THEN - micro_g(ngrid)%fncn(k,i,j,KR)=FCCNR0(KR)*1000.*xccn(kr)*ccn_max + micro_g(ngrid)%fncn(k,i,j,KR)=FCCNR0(KR)*1000.*xccn(kr)*ccn1_max ELSE micro_g(ngrid)%fncn(k,i,j,KR)=FCCNR0(KR)*1000.*xccn(kr)* & - ccn_max*exp(-zt(k)/7000.) + ccn1_max*exp(-zt(k)/7000.) ENDIF ENDDO ENDDO END DO END DO if (iceprocs == 1 .and. iifn == 2) then - fracin = cin_max/ccn_max + fracin = cin_max/ccn1_max micro_g(ngrid)%ffin=micro_g(ngrid)%fncn*fracin endif endif diff --git a/src/6.3.02/micro_bin/module_hujisbm.f90 b/src/micro_bin/module_hujisbm.f90 similarity index 100% rename from src/6.3.02/micro_bin/module_hujisbm.f90 rename to src/micro_bin/module_hujisbm.f90 diff --git a/src/6.3.02/mksfc/geodat.f90 b/src/mksfc/geodat.f90 similarity index 100% rename from src/6.3.02/mksfc/geodat.f90 rename to src/mksfc/geodat.f90 diff --git a/src/6.3.02/mksfc/landuse_input.f90 b/src/mksfc/landuse_input.f90 similarity index 100% rename from src/6.3.02/mksfc/landuse_input.f90 rename to src/mksfc/landuse_input.f90 diff --git a/src/6.3.02/mksfc/mksfc_driver.f90 b/src/mksfc/mksfc_driver.f90 similarity index 100% rename from src/6.3.02/mksfc/mksfc_driver.f90 rename to src/mksfc/mksfc_driver.f90 diff --git a/src/6.3.02/mksfc/mksfc_ndvi.f90 b/src/mksfc/mksfc_ndvi.f90 similarity index 99% rename from src/6.3.02/mksfc/mksfc_ndvi.f90 rename to src/mksfc/mksfc_ndvi.f90 index cb65ca9..25a9230 100644 --- a/src/6.3.02/mksfc/mksfc_ndvi.f90 +++ b/src/mksfc/mksfc_ndvi.f90 @@ -58,7 +58,7 @@ Subroutine ndvi_read_dataheader (ifm) ! read prefix list and times do itime = 1,nvndvif(ifm) - read(25,'(A80)') line + read(25,'(A256)') line CALL char_strip_var (line,flnm,line2) read (line2,*) iyearvn(itime,ifm),imonthvn(itime,ifm) & ,idatevn(itime,ifm),ihourvn(itime,ifm) diff --git a/src/6.3.02/mksfc/mksfc_sfc.f90 b/src/mksfc/mksfc_sfc.f90 similarity index 100% rename from src/6.3.02/mksfc/mksfc_sfc.f90 rename to src/mksfc/mksfc_sfc.f90 diff --git a/src/6.3.02/mksfc/mksfc_sst.f90 b/src/mksfc/mksfc_sst.f90 similarity index 99% rename from src/6.3.02/mksfc/mksfc_sst.f90 rename to src/mksfc/mksfc_sst.f90 index 2b1076b..7e4a035 100644 --- a/src/6.3.02/mksfc/mksfc_sst.f90 +++ b/src/mksfc/mksfc_sst.f90 @@ -63,7 +63,7 @@ Subroutine sst_read_dataheader (ifm) nvsstf(ifm)=0 do itime = 1,nsst - read(25,'(A80)') line + read(25,'(A256)') line CALL char_strip_var (line,flnm,line2) read (line2,*) issty,isstm,isstd,issth diff --git a/src/6.3.02/mksfc/mksfc_top.f90 b/src/mksfc/mksfc_top.f90 similarity index 100% rename from src/6.3.02/mksfc/mksfc_top.f90 rename to src/mksfc/mksfc_top.f90 diff --git a/src/6.3.02/mksfc/ndvi_read.f90 b/src/mksfc/ndvi_read.f90 similarity index 100% rename from src/6.3.02/mksfc/ndvi_read.f90 rename to src/mksfc/ndvi_read.f90 diff --git a/src/6.3.02/mksfc/nest_geosst.f90 b/src/mksfc/nest_geosst.f90 similarity index 100% rename from src/6.3.02/mksfc/nest_geosst.f90 rename to src/mksfc/nest_geosst.f90 diff --git a/src/6.3.02/mksfc/sst_read.f90 b/src/mksfc/sst_read.f90 similarity index 100% rename from src/6.3.02/mksfc/sst_read.f90 rename to src/mksfc/sst_read.f90 diff --git a/src/6.3.02/mpi/mpass_cyclic.f90 b/src/mpi/mpass_cyclic.f90 similarity index 100% rename from src/6.3.02/mpi/mpass_cyclic.f90 rename to src/mpi/mpass_cyclic.f90 diff --git a/src/6.3.02/mpi/mpass_dtl.f90 b/src/mpi/mpass_dtl.f90 similarity index 100% rename from src/6.3.02/mpi/mpass_dtl.f90 rename to src/mpi/mpass_dtl.f90 diff --git a/src/6.3.02/mpi/mpass_init.f90 b/src/mpi/mpass_init.f90 similarity index 99% rename from src/6.3.02/mpi/mpass_init.f90 rename to src/mpi/mpass_init.f90 index 56e779c..3b35609 100644 --- a/src/6.3.02/mpi/mpass_init.f90 +++ b/src/mpi/mpass_init.f90 @@ -32,7 +32,7 @@ Subroutine broadcast_config () nwords = 219 * 1 & !single values + 1 * 8 & !micro (8-hydromet types for gnu) + 3 * aerocat & !micro (number aerosol species) - + 42 * maxgrds & !grid-dependent (max grids) + + 44 * maxgrds & !grid-dependent (max grids) + 3 * nzpmax & !max vertical levels + 3 * nzgmax & !max soil levels + 1 * maxisn & !max isentropic levels @@ -190,6 +190,8 @@ Subroutine broadcast_config () CALL par_put_int (ICORFLG,1) CALL par_put_int (IBND,1) CALL par_put_int (JBND,1) + CALL par_put_int (ISPONGE_PTS,MAXGRDS) + CALL par_put_float (SPONGE_TAU,MAXGRDS) CALL par_put_float (CPHAS,1) CALL par_put_int (LSFLG,1) CALL par_put_int (NFPT,1) @@ -313,8 +315,8 @@ Subroutine broadcast_config () CALL par_put_int (IAEROPRNT,1) CALL par_put_int (IAEROHIST,1) CALL par_put_float (CIN_MAX,1) - CALL par_put_float (CCN_MAX,1) - CALL par_put_float (GCCN_MAX,1) + CALL par_put_float (CCN1_MAX,1) + CALL par_put_float (CCN2_MAX,1) CALL par_put_float (DUST1_MAX,1) CALL par_put_float (DUST2_MAX,1) CALL par_put_float (SALTF_MAX,1) @@ -522,6 +524,8 @@ Subroutine broadcast_config () CALL par_get_int (ICORFLG,1) CALL par_get_int (IBND,1) CALL par_get_int (JBND,1) + CALL par_get_int (ISPONGE_PTS,MAXGRDS) + CALL par_get_float (SPONGE_TAU,MAXGRDS) CALL par_get_float (CPHAS,1) CALL par_get_int (LSFLG,1) CALL par_get_int (NFPT,1) @@ -645,8 +649,8 @@ Subroutine broadcast_config () CALL par_get_int (IAEROPRNT,1) CALL par_get_int (IAEROHIST,1) CALL par_get_float (CIN_MAX,1) - CALL par_get_float (CCN_MAX,1) - CALL par_get_float (GCCN_MAX,1) + CALL par_get_float (CCN1_MAX,1) + CALL par_get_float (CCN2_MAX,1) CALL par_get_float (DUST1_MAX,1) CALL par_get_float (DUST2_MAX,1) CALL par_get_float (SALTF_MAX,1) diff --git a/src/6.3.02/mpi/mpass_lbc.f90 b/src/mpi/mpass_lbc.f90 similarity index 100% rename from src/6.3.02/mpi/mpass_lbc.f90 rename to src/mpi/mpass_lbc.f90 diff --git a/src/6.3.02/mpi/mpass_nest.f90 b/src/mpi/mpass_nest.f90 similarity index 100% rename from src/6.3.02/mpi/mpass_nest.f90 rename to src/mpi/mpass_nest.f90 diff --git a/src/6.3.02/mpi/node_mod.f90 b/src/mpi/node_mod.f90 similarity index 100% rename from src/6.3.02/mpi/node_mod.f90 rename to src/mpi/node_mod.f90 diff --git a/src/6.3.02/mpi/par_decomp.f90 b/src/mpi/par_decomp.f90 similarity index 100% rename from src/6.3.02/mpi/par_decomp.f90 rename to src/mpi/par_decomp.f90 diff --git a/src/6.3.02/mpi/para_init.f90 b/src/mpi/para_init.f90 similarity index 100% rename from src/6.3.02/mpi/para_init.f90 rename to src/mpi/para_init.f90 diff --git a/src/6.3.02/mpi/rnode.f90 b/src/mpi/rnode.f90 similarity index 100% rename from src/6.3.02/mpi/rnode.f90 rename to src/mpi/rnode.f90 diff --git a/src/6.3.02/nesting/nest_drivers.f90 b/src/nesting/nest_drivers.f90 similarity index 98% rename from src/6.3.02/nesting/nest_drivers.f90 rename to src/nesting/nest_drivers.f90 index 98c3e76..9556eb1 100644 --- a/src/6.3.02/nesting/nest_drivers.f90 +++ b/src/nesting/nest_drivers.f90 @@ -21,32 +21,32 @@ Subroutine nstbdriv () ! print*, jdim,ibcon,ia,iz,ja,jz -CALL nstbtnd (mzp,mxp,myp,ia,iz,ja,jz,ibcon & +CALL nstbtnd (mzp,mxp,myp,ia,iz,ja,jz,ibcon,ngrid & ,basic_g(ngrid)%up(1,1,1),tend%ut(1) & ,nbounds(ngrid)%bux(1,1,1),nbounds(ngrid)%buy(1,1,1) & ,nbounds(ngrid)%buz(1,1,1) & ,'u',tymeinvv,nstbot,nsttop,jdim) -CALL nstbtnd (mzp,mxp,myp,ia,iz,ja,jz,ibcon & +CALL nstbtnd (mzp,mxp,myp,ia,iz,ja,jz,ibcon,ngrid & ,basic_g(ngrid)%vp(1,1,1),tend%vt(1) & ,nbounds(ngrid)%bvx(1,1,1),nbounds(ngrid)%bvy(1,1,1) & ,nbounds(ngrid)%bvz(1,1,1) & ,'v',tymeinvv,nstbot,nsttop,jdim) -CALL nstbtnd (mzp,mxp,myp,ia,iz,ja,jz,ibcon & +CALL nstbtnd (mzp,mxp,myp,ia,iz,ja,jz,ibcon,ngrid & ,basic_g(ngrid)%wp(1,1,1),tend%wt(1) & ,nbounds(ngrid)%bwx(1,1,1),nbounds(ngrid)%bwy(1,1,1) & ,nbounds(ngrid)%bwz(1,1,1) & ,'w',tymeinvv,nstbot,nsttop,jdim) -CALL nstbtnd (mzp,mxp,myp,ia,iz,ja,jz,ibcon & +CALL nstbtnd (mzp,mxp,myp,ia,iz,ja,jz,ibcon,ngrid & ,basic_g(ngrid)%pp(1,1,1),tend%pt(1) & ,nbounds(ngrid)%bpx(1,1,1),nbounds(ngrid)%bpy(1,1,1) & ,nbounds(ngrid)%bpz(1,1,1) & ,'p',tymeinvv,nstbot,nsttop,jdim) do n = 1,num_scalar(ngrid) - CALL nstbtnd (mzp,mxp,myp,ia,iz,ja,jz,ibcon & + CALL nstbtnd (mzp,mxp,myp,ia,iz,ja,jz,ibcon,ngrid & ,scalar_tab(n,ngrid)%var_p,scalar_tab(n,ngrid)%var_t & ,nbounds(ngrid)%bsx(1,1,1,n),nbounds(ngrid)%bsy(1,1,1,n) & ,nbounds(ngrid)%bsz(1,1,1,n) & diff --git a/src/6.3.02/nesting/nest_feed.f90 b/src/nesting/nest_feed.f90 similarity index 100% rename from src/6.3.02/nesting/nest_feed.f90 rename to src/nesting/nest_feed.f90 diff --git a/src/6.3.02/nesting/nest_intrp.f90 b/src/nesting/nest_intrp.f90 similarity index 77% rename from src/6.3.02/nesting/nest_intrp.f90 rename to src/nesting/nest_intrp.f90 index 1211e49..3285f70 100644 --- a/src/6.3.02/nesting/nest_intrp.f90 +++ b/src/nesting/nest_intrp.f90 @@ -1,11 +1,14 @@ !############################################################################## -Subroutine nstbtnd (m1,m2,m3,ia,iz,ja,jz,ibcon & +Subroutine nstbtnd (m1,m2,m3,ia,iz,ja,jz,ibcon,ngrid & ,scp,sct,bx,by,bz,vnam,tymeinv,nstbot,nsttop,jdim) +use node_mod, only: mi0, mj0 +use mem_grid, only: nnxp, nnyp, isponge_pts, sponge_tau + implicit none -integer :: m1,m2,m3,ia,iz,ja,jz,ibcon,nstbot,nsttop,jdim,i,j,k & - ,nzfm,nxfm,nyfm,incia,inciz,incja,incjz +integer :: m1,m2,m3,ia,iz,ja,jz,ibcon,ngrid,nstbot,nsttop,jdim & + ,i,j,k,nzfm,nxfm,nyfm,incia,inciz,incja,incjz real :: tymeinv real, dimension(m1,m2,m3) :: scp,sct real, dimension(m1,m3,2) :: bx @@ -13,6 +16,54 @@ Subroutine nstbtnd (m1,m2,m3,ia,iz,ja,jz,ibcon & real, dimension(m2,m3,2) :: bz character(len=*) :: vnam +! locally defined variables for sponge code +integer :: npts_sponge & ! user-defined number of points in the sponge zone + ! ** IMPORTANT ** code not implemented to have this + ! nudging zone distance be greater than the size of + ! the parallelized subdomain. Addressing this would + ! require MPI message passing code modifications. + ,nxpf,nypf ! total grid points on entire domain for this variable +real :: tau_sponge & ! user-defined sponge zone time scale in seconds + ,itau_spg & ! inverse sponge zone time scale + ,numer,wgttot ! for calculating weights +! 2D weights for distance from the boundary edge +real, dimension(m2,m3) :: wgtW,wgtE,wgtS,wgtN + +! ** NOTE ** Would probably be best practice to have b arrays contain more information +! through width of sponge zone, instead of nudging entire sponge zone to one boundary +! value. This becomes even more important if sponge zone width is increased beyond +! 5-10 points! However, also note that b arrays only have non-zero values for sub-domains +! containing a boundary. +! ** NOTE ** move tau_sponge and npts_sponge to namelist, make them grid-dependent + + +! set up sponge zone time scale and calculate inverse nudging timescale +tau_sponge = sponge_tau(ngrid) !30. ! s +!tau_sponge = 60. ! s ! PJM change for testing +!tau_sponge = 10. ! s ! PJM change for testing +itau_spg = 1./tau_sponge +! set up number of points in the sponge zone. Can vary for different grids +! Here, use 5 points on grid2 and 8 points on grid3 +npts_sponge = isponge_pts(ngrid) !5 +!if (ngrid .eq. 3) npts_sponge = 8 +! check that subdomain lengths are not smaller than the sponge zone width +! these are conservative estimates since they use ia/ja and iz/jz +if ( iand(ibcon,1) .ne. 0 .or. iand(ibcon,2) .ne. 0 ) then ! W or E boundary + if ( (iz-ia+1) .lt. npts_sponge ) then + stop 'In subroutine nstbtnd: subdomain x-dimension length is smaller than sponge zone' + endif +endif +if (jdim .eq. 1) then + if ( iand(ibcon,4) .ne. 0 .or. iand(ibcon,8) .ne. 0) then ! S or N boundary + if ( (jz-ja+1) .lt. npts_sponge ) then + stop 'In subroutine nstbtnd: subdomain y-dimension length is smaller than sponge zone' + endif + endif +endif + + +! set up subdomain end-grid indices: reduced by one for winds in their respective directions +! (nxfm, nyfm are no longer used with addition of sponge code) nzfm = m1 nxfm = iz + 1 nyfm = jz + 1 @@ -20,16 +71,110 @@ Subroutine nstbtnd (m1,m2,m3,ia,iz,ja,jz,ibcon & if (vnam .eq. 'u') nxfm =nxfm - 1 if (vnam .eq. 'v') nyfm =nyfm - 1 if (jdim .eq. 0) nyfm = 1 - +! Do the same for total number of points on the entire grid in x and y, for sponge zone +! weight calculations +nxpf = nnxp(ngrid) +nypf = nnyp(ngrid) +if (vnam .eq. 'u') nxpf =nxpf - 1 +if (vnam .eq. 'v') nypf =nypf - 1 +if (jdim .eq. 0) nypf = 1 + +! set up counter increments to properly account for subdomain bounds on grid edges incia = 0 inciz = 0 -if (iand(ibcon,1) .ne. 0) incia = 1 -if (iand(ibcon,2) .ne. 0 .and. vnam .ne. 'u') inciz = 1 +if (iand(ibcon,1) .ne. 0) incia = 1 ! W boundary +if (iand(ibcon,2) .ne. 0 .and. vnam .ne. 'u') inciz = 1 ! E boundary, non-normal wind incja = 0 incjz = 0 -if (iand(ibcon,4) .ne. 0) incja = jdim -if (iand(ibcon,8) .ne. 0 .and. vnam .ne. 'v') incjz = jdim - +if (iand(ibcon,4) .ne. 0) incja = jdim ! S boundary +if (iand(ibcon,8) .ne. 0 .and. vnam .ne. 'v') incjz = jdim ! N boundary, non-normal wind + + +! Set up weight array properly accounting for corners. +! Make four different weights arrays, one each for N,S,E,W, and check +! if their sum is > 1. If so, normalize each weight so they add up to 1. +! For a linear weight and 4-point nudging zone, this will look like +! the following example for the NW corner: + +! NW corner, Contributions from W nudging: +! .50 .43 .33 .20 0.0 0.0 +! .57 .50 .40 .25 0.0 0.0 +! .63 .60 .50 .25 0.0 0.0 +! .80 .75 .50 .25 0.0 0.0 +! 1.0 .75 .50 .25 0.0 0.0 +! 1.0 .75 .50 .25 0.0 0.0 + +! NW corner, Contributions from N nudging: +! .50 .57 .63 .80 1.0 1.0 +! .43 .50 .60 .75 .75 .75 +! .33 .40 .50 .50 .50 .50 +! .20 .25 .25 .25 .25 .25 +! 0.0 0.0 0.0 0.0 0.0 0.0 +! 0.0 0.0 0.0 0.0 0.0 0.0 + +! Total nudging weight: +! 1.0 1.0 1.0 1.0 1.0 1.0 +! 1.0 1.0 1.0 1.0 .75 .75 +! 1.0 1.0 1.0 .75 .50 .50 +! 1.0 1.0 .75 .25 .25 .25 +! 1.0 .75 .50 .25 0.0 0.0 +! 1.0 .75 .50 .25 0.0 0.0 + +! Cannot model weights after varfile nudging code because we don't +! have underlying structure in b's, only the boundary values. +! However, let's set this up with grid-wide indexing in case +! b's are given more underlying structure in the future. + +!set up 2D weights array - first initialize to zeros +numer=0. +wgttot=0. +do j = 1,m3 + do i = 1,m2 + wgtW(i,j) = 0. + wgtE(i,j) = 0. + wgtS(i,j) = 0. + wgtN(i,j) = 0. + enddo +enddo +! Set up quadratic weight functions +do j = 1,m3 + do i = 1,m2 + ! W boundary weight + numer = max( 0., float( npts_sponge + 1-(i+mi0(ngrid)) ) ) + wgtW(i,j) = numer*numer/float(npts_sponge*npts_sponge) + ! E boundary weight - nxpf is the total x-grid length (1-less for u) + numer = max( 0., float( npts_sponge + i+mi0(ngrid)-nxpf ) ) + wgtE(i,j) = numer*numer/float(npts_sponge*npts_sponge) + if (jdim .eq. 1) then + ! S boundary weight + numer = max( 0., float( npts_sponge + 1-(j+mj0(ngrid)) ) ) + wgtS(i,j) = numer*numer/float(npts_sponge*npts_sponge) + ! N boundary weight - nypf is the total y-grid length (1-less for v) + numer = max( 0., float( npts_sponge + j+mj0(ngrid)-nypf ) ) + wgtN(i,j) = numer*numer/float(npts_sponge*npts_sponge) + endif + ! take care of corners + wgttot = wgtW(i,j)+wgtE(i,j)+wgtS(i,j)+wgtN(i,j) + if ( wgttot .gt. 1. ) then + wgtW(i,j) = wgtW(i,j) / wgttot + wgtE(i,j) = wgtE(i,j) / wgttot + wgtS(i,j) = wgtS(i,j) / wgttot + wgtN(i,j) = wgtN(i,j) / wgttot + endif + enddo +enddo +! debugging +!if( ngrid.eq.2 .and. vnam.eq.'w') then +! if( (mi0(ngrid).eq.0) .and. (mj0(ngrid).eq.0) ) then +! print'(2a,i1,a,2i4,a)',vnam,', grid',ngrid,', (i0,j0) = (',mi0(ngrid),mj0(ngrid),'),wgtW = ' +! do j=m3,1,-1 +! write(*,'(a,a,i02,999(2x,f4.2))') vnam,'j',j+mj0(ngrid),wgtW(:,j) +! enddo +! endif +!endif + + +! bottom boundary if (nstbot .eq. 0) then do j = ja,jz do i = ia,iz @@ -37,6 +182,7 @@ Subroutine nstbtnd (m1,m2,m3,ia,iz,ja,jz,ibcon & enddo enddo endif +! top boundary if (nsttop .eq. 0) then do j = ja,jz do i = ia,iz @@ -45,34 +191,72 @@ Subroutine nstbtnd (m1,m2,m3,ia,iz,ja,jz,ibcon & enddo endif -if (iand(ibcon,1) .ne. 0) then - do j = ja-incja,jz+incjz - do k = 1,m1 - sct(k,1,j) = (bx(k,j,1) - scp(k,1,j)) * tymeinv +! west boundary +if (iand(ibcon,1) .ne. 0) then ! this subdomain is on the boundary + do j = ja-incja,jz+incjz ! loop through all j points along this subdomain boundary + do k = 1,m1 ! loop through all vertical levels in this j column + ! set tendency based on the difference between the west border value + ! interpolated from the parent nest (bx(k,j,1)) and the value itself (scp) + do i = ia-incia,iz+inciz + sct(k,i,j) = sct(k,i,j) & + + wgtW(i,j) * (bx(k,j,1) - scp(k,i,j)) * itau_spg + enddo + ! below is the old code which sets only the boundary value to bx. tymeinv is a + ! fractional timestep based on which integration this is relative to the parent grid. + !sct(k,1,j) = (bx(k,j,1) - scp(k,1,j)) * tymeinv enddo enddo endif -if (iand(ibcon,2) .ne. 0) then - do j = ja-incja,jz+incjz - do k = 1,m1 - sct(k,nxfm,j) = (bx(k,j,2) - scp(k,nxfm,j)) * tymeinv +! east boundary +if (iand(ibcon,2) .ne. 0) then ! this subdomain is on the boundary + do j = ja-incja,jz+incjz ! loop through all j points along this subdomain boundary + do k = 1,m1 ! loop through all vertical levels in this j column + ! set tendency based on the difference between the east border value + ! interpolated from the parent nest (bx(k,j,2)) and the value itself (scp) + do i = ia-incia,iz+inciz + sct(k,i,j) = sct(k,i,j) & + + wgtE(i,j) * (bx(k,j,2) - scp(k,i,j)) * itau_spg + ! TEMPORARY - print some stuff + !if(ngrid.eq.3 .and. vnam.eq.'u' .and. (k.eq.30) ) then + ! print*, 'E boundary,gr3,u,k(30): i,j, wgtE, bx(30,j,2), scp, sct' + ! print*, i,j, wgtE(i,j), bx(k,j,2), scp(k,i,j), sct(k,i,j) + !endif + enddo + ! below is the old code which sets only the boundary value to bx + !sct(k,nxfm,j) = (bx(k,j,2) - scp(k,nxfm,j)) * tymeinv enddo enddo endif if (jdim .eq. 1) then - if (iand(ibcon,4) .ne. 0) then - do i = ia-incia,iz+inciz - do k = 1,m1 - sct(k,i,1) = (by(k,i,1) - scp(k,i,1)) * tymeinv + ! south boundary + if (iand(ibcon,4) .ne. 0) then ! this subdomain is on the boundary + do i = ia-incia,iz+inciz ! loop through all i points along this subdomain boundary + do k = 1,m1 ! loop through all vertical levels in this i column + ! set tendency based on the difference between the south border value + ! interpolated from the parent nest (by(k,j,1)) and the value itself (scp) + do j = ja-incja,jz+incjz + sct(k,i,j) = sct(k,i,j) & + + wgtS(i,j) * (by(k,i,1) - scp(k,i,j)) * itau_spg + enddo + ! below is the old code which sets only the boundary value to by + !sct(k,i,1) = (by(k,i,1) - scp(k,i,1)) * tymeinv enddo enddo endif - if (iand(ibcon,8) .ne. 0) then - do i = ia-incia,iz+inciz - do k = 1,m1 - sct(k,i,nyfm) = (by(k,i,2) - scp(k,i,nyfm)) * tymeinv + ! north boundary + if (iand(ibcon,8) .ne. 0) then ! this subdomain is on the boundary + do i = ia-incia,iz+inciz ! loop through all i points along this subdomain boundary + do k = 1,m1 ! loop through all vertical levels in this i column + ! set tendency based on the difference between the north border value + ! interpolated from the parent nest (by(k,j,2)) and the value itself (scp) + do j = ja-incja,jz+incjz + sct(k,i,j) = sct(k,i,j) & + + wgtN(i,j) * (by(k,i,2) - scp(k,i,j)) * itau_spg + enddo + ! below is the old code which sets only the boundary value to by + !sct(k,i,nyfm) = (by(k,i,2) - scp(k,i,nyfm)) * tymeinv enddo enddo endif @@ -88,31 +272,31 @@ Subroutine cofnest () implicit none -integer :: nf,nc,nrat,if,jf,kf,kc +integer :: nf,nc,nrat,ibetter,jf,kf,kc real :: alpha,et,ev real, dimension(:), allocatable :: vctr1, vctr2, vctr3 do nf = 2,ngrids nc = nxtnest(nf) - allocate(vctr1(nnzp(nc))) - allocate(vctr2(nnzp(nc))) - allocate(vctr3(nnzp(nc))) + allocate(vctr1(nnzp(nf))) + allocate(vctr2(nnzp(nf))) + allocate(vctr3(nnzp(nf))) if (nc .eq. 0) go to 50 nrat = nstratx(nf) alpha = ((1. / float(nrat)) ** 2 - 1.) / 24. - do if = 1,nnxp(nf) - et = -.5 + float(2 * mod(if+nrat-2,nrat) + 1) / (2.0 * float(nrat)) - ev = -.5 + float(mod(if+nrat-2,nrat) + 1) / float(nrat) - - ei1(if,nf) = et * (et - 1.) / 2. + alpha - ei2(if,nf) = (1. - et * et) - 2. * alpha - ei3(if,nf) = et * (et + 1.) / 2. + alpha - ei4(if,nf) = (ev * ev - 0.25) * (1.5 - ev) / 6.0 - ei5(if,nf) = (0.5 - ev) * (2.25 - ev * ev) * 0.5 - ei6(if,nf) = (0.5 + ev) * (2.25 - ev * ev) * 0.5 - ei7(if,nf) = (ev * ev - 0.25) * (1.5 + ev) / 6.0 + do ibetter = 1,nnxp(nf) + et = -.5 + float(2 * mod(ibetter+nrat-2,nrat) + 1) / (2.0 * float(nrat)) + ev = -.5 + float(mod(ibetter+nrat-2,nrat) + 1) / float(nrat) + + ei1(ibetter,nf) = et * (et - 1.) / 2. + alpha + ei2(ibetter,nf) = (1. - et * et) - 2. * alpha + ei3(ibetter,nf) = et * (et + 1.) / 2. + alpha + ei4(ibetter,nf) = (ev * ev - 0.25) * (1.5 - ev) / 6.0 + ei5(ibetter,nf) = (0.5 - ev) * (2.25 - ev * ev) * 0.5 + ei6(ibetter,nf) = (0.5 + ev) * (2.25 - ev * ev) * 0.5 + ei7(ibetter,nf) = (ev * ev - 0.25) * (1.5 + ev) / 6.0 enddo if (jdim .eq. 1) then diff --git a/src/6.3.02/radiate/rad_aero.f90 b/src/radiate/rad_aero.f90 similarity index 99% rename from src/6.3.02/radiate/rad_aero.f90 rename to src/radiate/rad_aero.f90 index e1cc26b..1d26bd9 100644 --- a/src/6.3.02/radiate/rad_aero.f90 +++ b/src/radiate/rad_aero.f90 @@ -55,8 +55,8 @@ Subroutine aerorad (i,j,mb,nb,nrad,m1,dzl,relh,tp,omgp,gp,dn0,aodt) enddo if(iaerosol>0) then - aerotype(1) = 1 ! CCN - aerotype(2) = 1 ! GCCN + aerotype(1) = 1 ! CCN-mode-1 + aerotype(2) = 1 ! CCN-mode-2 endif if(idust>0) then aerotype(3) = 3 ! Small dust mode diff --git a/src/6.3.02/radiate/rad_ccmp.f90 b/src/radiate/rad_ccmp.f90 similarity index 100% rename from src/6.3.02/radiate/rad_ccmp.f90 rename to src/radiate/rad_ccmp.f90 diff --git a/src/6.3.02/radiate/rad_driv.f90 b/src/radiate/rad_driv.f90 similarity index 99% rename from src/6.3.02/radiate/rad_driv.f90 rename to src/radiate/rad_driv.f90 index c4b95d1..41227b3 100644 --- a/src/6.3.02/radiate/rad_driv.f90 +++ b/src/radiate/rad_driv.f90 @@ -162,10 +162,10 @@ Subroutine radiate (mzp,mxp,myp,ia,iz,ja,jz) ,radiate_g(ngrid)%swdn (1,1,1) & ,radiate_g(ngrid)%lwup (1,1,1) & ,radiate_g(ngrid)%lwdn (1,1,1) & - ,micro_g(ngrid)%cccnp (1,1,1) & - ,micro_g(ngrid)%cccmp (1,1,1) & - ,micro_g(ngrid)%gccnp (1,1,1) & - ,micro_g(ngrid)%gccmp (1,1,1) & + ,micro_g(ngrid)%cn1np (1,1,1) & + ,micro_g(ngrid)%cn1mp (1,1,1) & + ,micro_g(ngrid)%cn2np (1,1,1) & + ,micro_g(ngrid)%cn2mp (1,1,1) & ,micro_g(ngrid)%md1np (1,1,1) & ,micro_g(ngrid)%md1mp (1,1,1) & ,micro_g(ngrid)%md2np (1,1,1) & @@ -463,7 +463,7 @@ Subroutine radcomp3 (m1,m2,m3,ia,iz,ja,jz & ,glat,rtgt,topt,albedt,cosz,rlongup,rshort,rlong,aodt & ,rv,dn0,fthrd,pi0,pp,theta,rcp & ,bext,swup,swdn,lwup,lwdn & - ,cccnp,cccmp,gccnp,gccmp,md1np,md1mp,md2np,md2mp & + ,cn1np,cn1mp,cn2np,cn2mp,md1np,md1mp,md2np,md2mp & ,salt_film_np,salt_film_mp,salt_jet_np,salt_jet_mp & ,salt_spum_np,salt_spum_mp,abc1np,abc1mp,abc2np,abc2mp) @@ -483,7 +483,7 @@ Subroutine radcomp3 (m1,m2,m3,ia,iz,ja,jz & real, dimension(m2,m3) :: glat,rtgt,topt,cosz,albedt,rlongup,rshort,rlong,aodt real, dimension(m1,m2,m3) :: dn0,rv,fthrd,pi0,pp,theta,rcp real, dimension(m1,m2,m3) :: bext,swup,swdn,lwup,lwdn -real, dimension(m1,m2,m3) :: cccnp,cccmp,gccnp,gccmp,md1np,md1mp,md2np,md2mp & +real, dimension(m1,m2,m3) :: cn1np,cn1mp,cn2np,cn2mp,md1np,md1mp,md2np,md2mp & ,salt_film_np,salt_film_mp,salt_jet_np,salt_jet_mp,salt_spum_np,salt_spum_mp & ,abc1np,abc1mp,abc2np,abc2mp real, external :: gammln @@ -537,8 +537,8 @@ Subroutine radcomp3 (m1,m2,m3,ia,iz,ja,jz & ! Call the sub-driver if(iaerorad==1 .and. level .ne. 4)then CALL aero_copy (1,m1 & - ,cccnp(1,i,j),cccmp(1,i,j) & - ,gccnp(1,i,j),gccmp(1,i,j) & + ,cn1np(1,i,j),cn1mp(1,i,j) & + ,cn2np(1,i,j),cn2mp(1,i,j) & ,md1np(1,i,j),md1mp(1,i,j) & ,md2np(1,i,j),md2mp(1,i,j) & ,salt_film_np(1,i,j),salt_film_mp(1,i,j) & diff --git a/src/6.3.02/radiate/rad_mclat.f90 b/src/radiate/rad_mclat.f90 similarity index 100% rename from src/6.3.02/radiate/rad_mclat.f90 rename to src/radiate/rad_mclat.f90 diff --git a/src/6.3.02/radiate/rad_stable.f90 b/src/radiate/rad_stable.f90 similarity index 100% rename from src/6.3.02/radiate/rad_stable.f90 rename to src/radiate/rad_stable.f90 diff --git a/src/6.3.02/radiate/rrad2.f90 b/src/radiate/rrad2.f90 similarity index 100% rename from src/6.3.02/radiate/rrad2.f90 rename to src/radiate/rrad2.f90 diff --git a/src/6.3.02/radiate/rrad3.f90 b/src/radiate/rrad3.f90 similarity index 100% rename from src/6.3.02/radiate/rrad3.f90 rename to src/radiate/rrad3.f90 diff --git a/src/6.3.02/revu/RAMS_hdf5.f90 b/src/revu/RAMS_hdf5.f90 similarity index 100% rename from src/6.3.02/revu/RAMS_hdf5.f90 rename to src/revu/RAMS_hdf5.f90 diff --git a/src/6.3.02/revu/getvar.f90 b/src/revu/getvar.f90 similarity index 100% rename from src/6.3.02/revu/getvar.f90 rename to src/revu/getvar.f90 diff --git a/src/6.3.02/revu/hvlib.f90 b/src/revu/hvlib.f90 similarity index 99% rename from src/6.3.02/revu/hvlib.f90 rename to src/revu/hvlib.f90 index 84189e4..1685eed 100644 --- a/src/6.3.02/revu/hvlib.f90 +++ b/src/revu/hvlib.f90 @@ -1932,17 +1932,17 @@ Subroutine rams_varlib (cvar,n1,n2,n3,ngrd,a,b,flnm,cdname,cdunits) cdname='ice-nuclei-concentration;' cdunits='#/cm3;' -elseif(cvar(1:lv).eq.'ccn_concen_mg') then +elseif(cvar(1:lv).eq.'ccn1_concen_mg') then ivar_type=3 - ierr=rams_getvar('CCCNP',idim_type,ngrd,a,flnm) + ierr=rams_getvar('CN1NP',idim_type,ngrd,a,flnm) CALL rams_comp_mults (n1,n2,n3,a,1.e-6) CALL rams_comp_noneg (n1,n2,n3,a) - cdname='ccn-concentration;' + cdname='ccn-mode-1-concentration;' cdunits='#/mg;' -elseif(cvar(1:lv).eq.'ccn_concen_cm3') then +elseif(cvar(1:lv).eq.'ccn1_concen_cm3') then ivar_type=3 - ierr=rams_getvar('CCCNP',idim_type,ngrd,a,flnm) + ierr=rams_getvar('CN1NP',idim_type,ngrd,a,flnm) ierr=rams_getvar('TOPT',idim_type,ngrd,e,flnm) if(ierr.eq.0) then CALL rams_comp_dn0 (n1,n2,n3,b,c,d,e,ngrd) @@ -1950,20 +1950,20 @@ Subroutine rams_varlib (cvar,n1,n2,n3,ngrd,a,b,flnm,cdname,cdunits) CALL rams_comp_mults (n1,n2,n3,a,1.e-6) CALL rams_comp_noneg (n1,n2,n3,a) endif - cdname='ccn-concentration;' + cdname='ccn-mode-1-concentration;' cdunits='#/cm3;' -elseif(cvar(1:lv).eq.'gccn_concen_mg') then +elseif(cvar(1:lv).eq.'ccn2_concen_mg') then ivar_type=3 - ierr=rams_getvar('GCCNP',idim_type,ngrd,a,flnm) + ierr=rams_getvar('CN2NP',idim_type,ngrd,a,flnm) CALL rams_comp_mults (n1,n2,n3,a,1.e-6) CALL rams_comp_noneg (n1,n2,n3,a) - cdname='gccn-concentration;' + cdname='ccn-mode-2-concentration;' cdunits='#/mg;' -elseif(cvar(1:lv).eq.'gccn_concen_cm3') then +elseif(cvar(1:lv).eq.'ccn2_concen_cm3') then ivar_type=3 - ierr=rams_getvar('GCCNP',idim_type,ngrd,a,flnm) + ierr=rams_getvar('CN2NP',idim_type,ngrd,a,flnm) ierr=rams_getvar('TOPT',idim_type,ngrd,e,flnm) if(ierr.eq.0) then CALL rams_comp_dn0 (n1,n2,n3,b,c,d,e,ngrd) @@ -1971,7 +1971,7 @@ Subroutine rams_varlib (cvar,n1,n2,n3,ngrd,a,b,flnm,cdname,cdunits) CALL rams_comp_mults (n1,n2,n3,a,1.e-6) CALL rams_comp_noneg (n1,n2,n3,a) endif - cdname='gccn-concentration;' + cdname='ccn-mode-2-concentration;' cdunits='#/cm3;' elseif(cvar(1:lv).eq.'dust1_concen') then @@ -2091,9 +2091,9 @@ Subroutine rams_varlib (cvar,n1,n2,n3,ngrd,a,b,flnm,cdname,cdunits) cdname='regenerated-aero2-concentration;' cdunits='#/cm3;' -elseif(cvar(1:lv).eq.'ccn_mass') then +elseif(cvar(1:lv).eq.'ccn1_mass') then ivar_type=3 - ierr=rams_getvar('CCCMP',idim_type,ngrd,a,flnm) + ierr=rams_getvar('CN1MP',idim_type,ngrd,a,flnm) ierr=rams_getvar('TOPT',idim_type,ngrd,e,flnm) if(ierr.eq.0) then CALL rams_comp_dn0 (n1,n2,n3,b,c,d,e,ngrd) @@ -2101,12 +2101,12 @@ Subroutine rams_varlib (cvar,n1,n2,n3,ngrd,a,b,flnm,cdname,cdunits) CALL rams_comp_mults (n1,n2,n3,a,1.e9) CALL rams_comp_noneg (n1,n2,n3,a) endif - cdname='ccn-mass;' + cdname='ccn-mode-1-mass;' cdunits='micro-grams/m3;' -elseif(cvar(1:lv).eq.'gccn_mass') then +elseif(cvar(1:lv).eq.'ccn2_mass') then ivar_type=3 - ierr=rams_getvar('GCCMP',idim_type,ngrd,a,flnm) + ierr=rams_getvar('CN2MP',idim_type,ngrd,a,flnm) ierr=rams_getvar('TOPT',idim_type,ngrd,e,flnm) if(ierr.eq.0) then CALL rams_comp_dn0 (n1,n2,n3,b,c,d,e,ngrd) @@ -2114,7 +2114,7 @@ Subroutine rams_varlib (cvar,n1,n2,n3,ngrd,a,b,flnm,cdname,cdunits) CALL rams_comp_mults (n1,n2,n3,a,1.e9) CALL rams_comp_noneg (n1,n2,n3,a) endif - cdname='gccn-mass;' + cdname='ccn-mode-2-mass;' cdunits='micro-grams/m3;' elseif(cvar(1:lv).eq.'dust1_mass') then @@ -2310,24 +2310,24 @@ Subroutine rams_varlib (cvar,n1,n2,n3,ngrd,a,b,flnm,cdname,cdunits) cdname='regen2-solubility-fraction;' cdunits='fraction;' -elseif(cvar(1:lv).eq.'ccn_medrad') then +elseif(cvar(1:lv).eq.'ccn1_medrad') then ivar_type=3 - ierr=rams_getvar('CCCMP',idim_type,ngrd,a,flnm) - ierr=rams_getvar('CCCNP',idim_type,ngrd,c,flnm) + ierr=rams_getvar('CN1MP',idim_type,ngrd,a,flnm) + ierr=rams_getvar('CN2NP',idim_type,ngrd,c,flnm) CALL rams_comp_aeromedrad (n1,n2,n3,a,c,1769.) !1769 kg/m3 is solute density CALL rams_comp_mults (n1,n2,n3,a,1.e6) CALL rams_comp_noneg (n1,n2,n3,a) - cdname='ccn-median-radius;' + cdname='ccn1-median-radius;' cdunits='microns;' -elseif(cvar(1:lv).eq.'gccn_medrad') then +elseif(cvar(1:lv).eq.'ccn2_medrad') then ivar_type=3 - ierr=rams_getvar('GCCMP',idim_type,ngrd,a,flnm) - ierr=rams_getvar('GCCNP',idim_type,ngrd,c,flnm) + ierr=rams_getvar('CN2MP',idim_type,ngrd,a,flnm) + ierr=rams_getvar('CN2NP',idim_type,ngrd,c,flnm) CALL rams_comp_aeromedrad (n1,n2,n3,a,c,1769.) !1769 kg/m3 is solute density CALL rams_comp_mults (n1,n2,n3,a,1.e6) CALL rams_comp_noneg (n1,n2,n3,a) - cdname='gccn-median-radius;' + cdname='ccn2-median-radius;' cdunits='microns;' elseif(cvar(1:lv).eq.'dust1_medrad') then diff --git a/src/6.3.02/revu/iplt.f90 b/src/revu/iplt.f90 similarity index 100% rename from src/6.3.02/revu/iplt.f90 rename to src/revu/iplt.f90 diff --git a/src/6.3.02/revu/rainit.f90 b/src/revu/rainit.f90 similarity index 100% rename from src/6.3.02/revu/rainit.f90 rename to src/revu/rainit.f90 diff --git a/src/6.3.02/revu/rbat.f90 b/src/revu/rbat.f90 similarity index 100% rename from src/6.3.02/revu/rbat.f90 rename to src/revu/rbat.f90 diff --git a/src/6.3.02/revu/rcommons.f90 b/src/revu/rcommons.f90 similarity index 100% rename from src/6.3.02/revu/rcommons.f90 rename to src/revu/rcommons.f90 diff --git a/src/6.3.02/revu/rcomp.f90 b/src/revu/rcomp.f90 similarity index 100% rename from src/6.3.02/revu/rcomp.f90 rename to src/revu/rcomp.f90 diff --git a/src/6.3.02/revu/revu_main.f90 b/src/revu/revu_main.f90 similarity index 100% rename from src/6.3.02/revu/revu_main.f90 rename to src/revu/revu_main.f90 diff --git a/src/6.3.02/revu/revu_utils.f90 b/src/revu/revu_utils.f90 similarity index 100% rename from src/6.3.02/revu/revu_utils.f90 rename to src/revu/revu_utils.f90 diff --git a/src/6.3.02/revu/revugrads.f90 b/src/revu/revugrads.f90 similarity index 100% rename from src/6.3.02/revu/revugrads.f90 rename to src/revu/revugrads.f90 diff --git a/src/6.3.02/revu/rhdf5_f2c.c b/src/revu/rhdf5_f2c.c similarity index 100% rename from src/6.3.02/revu/rhdf5_f2c.c rename to src/revu/rhdf5_f2c.c diff --git a/src/6.3.02/revu/rhdf5_utils.f90 b/src/revu/rhdf5_utils.f90 similarity index 100% rename from src/6.3.02/revu/rhdf5_utils.f90 rename to src/revu/rhdf5_utils.f90 diff --git a/src/6.3.02/revu/textout.f90 b/src/revu/textout.f90 similarity index 98% rename from src/6.3.02/revu/textout.f90 rename to src/revu/textout.f90 index b6ea032..dbe11d7 100644 --- a/src/6.3.02/revu/textout.f90 +++ b/src/revu/textout.f90 @@ -438,10 +438,10 @@ Subroutine rams_text (a,iztrans,ivtype,nngd,n1,n2,n3,fcstsec & !3D AEROSOLS NUMBER, MASS, SIZE, SOLUBILITY - 37 variables if(len_trim(cvar).eq.13.and.cvar(1:13).eq.'ifn_concen_mg') ngem='IFNM' if(len_trim(cvar).eq.14.and.cvar(1:14).eq.'ifn_concen_cm3') ngem='IFNC' -if(len_trim(cvar).eq.13.and.cvar(1:13).eq.'ccn_concen_mg') ngem='CCNM' -if(len_trim(cvar).eq.14.and.cvar(1:14).eq.'ccn_concen_cm3') ngem='CCNC' -if(len_trim(cvar).eq.14.and.cvar(1:14).eq.'gccn_concen_mg') ngem='GCNM' -if(len_trim(cvar).eq.15.and.cvar(1:15).eq.'gccn_concen_cm3') ngem='GCNC' +if(len_trim(cvar).eq.13.and.cvar(1:14).eq.'ccn1_concen_mg') ngem='C1NM' +if(len_trim(cvar).eq.14.and.cvar(1:15).eq.'ccn1_concen_cm3') ngem='C1NC' +if(len_trim(cvar).eq.14.and.cvar(1:14).eq.'ccn2_concen_mg') ngem='C2NM' +if(len_trim(cvar).eq.15.and.cvar(1:15).eq.'ccn2_concen_cm3') ngem='C2NC' if(len_trim(cvar).eq.12.and.cvar(1:12).eq.'dust1_concen') ngem='D1CN' if(len_trim(cvar).eq.12.and.cvar(1:12).eq.'dust2_concen') ngem='D2CN' if(len_trim(cvar).eq.16.and.cvar(1:16).eq.'salt_film_concen') ngem='SFCN' @@ -449,8 +449,8 @@ Subroutine rams_text (a,iztrans,ivtype,nngd,n1,n2,n3,fcstsec & if(len_trim(cvar).eq.17.and.cvar(1:17).eq.'salt_spume_concen') ngem='SSCN' if(len_trim(cvar).eq.18.and.cvar(1:18).eq.'regen_aero1_concen') ngem='R1CN' if(len_trim(cvar).eq.18.and.cvar(1:18).eq.'regen_aero2_concen') ngem='R2CN' -if(len_trim(cvar).eq.8 .and.cvar(1:8) .eq.'ccn_mass') ngem='CCCM' -if(len_trim(cvar).eq.9 .and.cvar(1:9) .eq.'gccn_mass') ngem='GCCM' +if(len_trim(cvar).eq.8 .and.cvar(1:9) .eq.'ccn1_mass') ngem='C1CM' +if(len_trim(cvar).eq.9 .and.cvar(1:9) .eq.'ccn2_mass') ngem='C2CM' if(len_trim(cvar).eq.10.and.cvar(1:10).eq.'dust1_mass') ngem='D1CM' if(len_trim(cvar).eq.13.and.cvar(1:13).eq.'dust1_massd10') ngem='D1CM' if(len_trim(cvar).eq.10.and.cvar(1:10).eq.'dust2_mass') ngem='D2CM' @@ -464,8 +464,8 @@ Subroutine rams_text (a,iztrans,ivtype,nngd,n1,n2,n3,fcstsec & if(len_trim(cvar).eq.16.and.cvar(1:16).eq.'resol_aero2_mass') ngem='R2SM' if(len_trim(cvar).eq.14.and.cvar(1:14).eq.'regen1_epsilon') ngem='R1EP' if(len_trim(cvar).eq.14.and.cvar(1:14).eq.'regen2_epsilon') ngem='R2EP' -if(len_trim(cvar).eq.10.and.cvar(1:10).eq.'ccn_medrad') ngem='CCCR' -if(len_trim(cvar).eq.11.and.cvar(1:11).eq.'gccn_medrad') ngem='GCCR' +if(len_trim(cvar).eq.10.and.cvar(1:11).eq.'ccn1_medrad') ngem='C1CR' +if(len_trim(cvar).eq.11.and.cvar(1:11).eq.'ccn2_medrad') ngem='C2CR' if(len_trim(cvar).eq.12.and.cvar(1:12).eq.'dust1_medrad') ngem='D1CR' if(len_trim(cvar).eq.12.and.cvar(1:12).eq.'dust2_medrad') ngem='D2CR' if(len_trim(cvar).eq.16.and.cvar(1:16).eq.'salt_film_medrad') ngem='SFCR' diff --git a/src/6.3.02/revu/vplt.f90 b/src/revu/vplt.f90 similarity index 100% rename from src/6.3.02/revu/vplt.f90 rename to src/revu/vplt.f90 diff --git a/src/6.3.02/sib/sib2_co2.f90 b/src/sib/sib2_co2.f90 similarity index 100% rename from src/6.3.02/sib/sib2_co2.f90 rename to src/sib/sib2_co2.f90 diff --git a/src/6.3.02/sib/sib2_init.f90 b/src/sib/sib2_init.f90 similarity index 100% rename from src/6.3.02/sib/sib2_init.f90 rename to src/sib/sib2_init.f90 diff --git a/src/6.3.02/surface/leaf3_canopy.f90 b/src/surface/leaf3_canopy.f90 similarity index 100% rename from src/6.3.02/surface/leaf3_canopy.f90 rename to src/surface/leaf3_canopy.f90 diff --git a/src/6.3.02/surface/leaf3_init.f90 b/src/surface/leaf3_init.f90 similarity index 100% rename from src/6.3.02/surface/leaf3_init.f90 rename to src/surface/leaf3_init.f90 diff --git a/src/6.3.02/surface/leaf3_prep.f90 b/src/surface/leaf3_prep.f90 similarity index 100% rename from src/6.3.02/surface/leaf3_prep.f90 rename to src/surface/leaf3_prep.f90 diff --git a/src/6.3.02/surface/leaf3_slayer.f90 b/src/surface/leaf3_slayer.f90 similarity index 100% rename from src/6.3.02/surface/leaf3_slayer.f90 rename to src/surface/leaf3_slayer.f90 diff --git a/src/6.3.02/surface/leaf3_soilveg.f90 b/src/surface/leaf3_soilveg.f90 similarity index 100% rename from src/6.3.02/surface/leaf3_soilveg.f90 rename to src/surface/leaf3_soilveg.f90 diff --git a/src/6.3.02/surface/leaf_coms.f90 b/src/surface/leaf_coms.f90 similarity index 100% rename from src/6.3.02/surface/leaf_coms.f90 rename to src/surface/leaf_coms.f90 diff --git a/src/6.3.02/surface/ruser.f90 b/src/surface/ruser.f90 similarity index 100% rename from src/6.3.02/surface/ruser.f90 rename to src/surface/ruser.f90 diff --git a/src/6.3.02/surface/sfc_driver.f90 b/src/surface/sfc_driver.f90 similarity index 100% rename from src/6.3.02/surface/sfc_driver.f90 rename to src/surface/sfc_driver.f90 diff --git a/src/6.3.02/turb/rgrad.f90 b/src/turb/rgrad.f90 similarity index 100% rename from src/6.3.02/turb/rgrad.f90 rename to src/turb/rgrad.f90 diff --git a/src/6.3.02/turb/turb_diff.f90 b/src/turb/turb_diff.f90 similarity index 100% rename from src/6.3.02/turb/turb_diff.f90 rename to src/turb/turb_diff.f90 diff --git a/src/6.3.02/turb/turb_k.f90 b/src/turb/turb_k.f90 similarity index 100% rename from src/6.3.02/turb/turb_k.f90 rename to src/turb/turb_k.f90 diff --git a/src/6.3.02/turb/turb_ke.f90 b/src/turb/turb_ke.f90 similarity index 100% rename from src/6.3.02/turb/turb_ke.f90 rename to src/turb/turb_ke.f90