diff --git a/.gitignore b/.gitignore index 1ef81ae5..bbb5eb68 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,6 @@ /@cmake/ /@modules/ /@env/ -/BUILD/ -/build*/ -/install*/ /.mepo/ parallel_build.o* log.* diff --git a/CMakeLists.txt b/CMakeLists.txt index 58c18aff..b6103aee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,3 +44,14 @@ include_directories(${MPI_Fortran_INCLUDE_PATH}) add_subdirectory (@env) add_subdirectory (src) +# https://www.scivision.dev/cmake-auto-gitignore-build-dir/ +# --- auto-ignore build directory +if(NOT EXISTS ${PROJECT_BINARY_DIR}/.gitignore) + file(WRITE ${PROJECT_BINARY_DIR}/.gitignore "*") +endif() + +# Piggyback that file into install +install( + FILES ${PROJECT_BINARY_DIR}/.gitignore + DESTINATION ${CMAKE_INSTALL_PREFIX} + ) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..704e6d1f --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,133 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +thomas.l.clune@nasa.gov. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available +at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..73ec8c52 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,16 @@ +# Contributing to GEOSadas + +Contributing code to GEOSadas should be done via a Pull Request to this repository. + +## Contributor License Agreement (CLA) + +All external developers contributing to GEOS-ESM projects must complete a [Contributor License +Agreement](https://github.com/GEOS-ESM/cla). + +NOTE: Internal NASA contributors associated with GEOS, including contractors, +are covered by other agreements and do not need to sign a CLA. + +## License + +By contributing to GEOS-ESM projects, you agree your contributions will be +licensed under the [NASA Open Source Aggrement (NOSA) License](LICENSE.md) diff --git a/components.yaml b/components.yaml index 32a797de..a8939f56 100644 --- a/components.yaml +++ b/components.yaml @@ -5,7 +5,7 @@ GEOSadas: env: local: ./@env remote: ../ESMA_env.git - tag: v1.4.2 + tag: v1.4.3 develop: main cmake: diff --git a/parallel_build.csh b/parallel_build.csh index b0dcdd07..2c9650e3 100755 --- a/parallel_build.csh +++ b/parallel_build.csh @@ -13,7 +13,7 @@ if ($name != $name:t) then set scriptname = $name:t cd $name:h endif -set srcdir = `pwd` +set srcdir = `pwd -L` setenv ESMADIR $srcdir # Save the original argv because I'm not a good diff --git a/src/Applications/GEOSdas_App/fvsetup b/src/Applications/GEOSdas_App/fvsetup index 506e3794..48385525 100755 --- a/src/Applications/GEOSdas_App/fvsetup +++ b/src/Applications/GEOSdas_App/fvsetup @@ -341,7 +341,7 @@ # 25Jul2017 Holdaway Added resource files associated with NGGPS FV3 tlm/adjoint, sens and svec # 19Jul2018 Wargan Additions for OMPS #------------------------------------------------------------------------- -use Cwd qw(cwd); +use Cwd qw(abs_path cwd); use English; use Env; # make env vars readily available use File::Basename qw(basename dirname); @@ -379,7 +379,7 @@ my ($gocart_tracers, $radcor, $emiss, $lsmodel_flag, $rroute_flag); my ($agcm_rst_flg, $sensdeg, %setupfile, @otherheaders); my ($checkFLG, $dbqueue, $runjobFLG, $saveFLG, $stopFLG); my (@fvprompt, @fvANS1, @fvANS2, $fvsetupflags); -my ($fvhome, $fvroot, $fvbin, $checkID, $siteID); +my ($fvhome, $fvroot, $fvbin, $bindir, $pwdL, $pwdP, $checkID, $siteID); my ($remNODE, $remID); my ($qsub); my ($acqloc); @@ -394,12 +394,42 @@ system clear; get_runtime_values(); $ENV{"PATH"} = $FindBin::Bin .":$ENV{PATH}"; -# FVROOT is directory above bin dir where binaries have been installed -# -------------------------------------------------------------------- - $fvroot = dirname($FindBin::Bin); - $fvroot =~ s|/u/.realmounts/share|/share|; # for portability across - # NAS machines - $fvbin = "$fvroot/bin"; +# FVROOT is directory above fvbin where binaries have been installed +# ------------------------------------------------------------------ + $fvbin = $FindBin::Bin; # absolute path of fvbin + + chomp($pwdL = `pwd -L`); # logical path of calling program + chomp($pwdP = `pwd -P`); # physical (absolute) path of calling program + + # if fvsetup is called from local directory + #------------------------------------------ + if ($pwdP eq $FindBin::Bin) { $fvbin = $pwdL } + + # if fvsetup is called from remote directory + #------------------------------------------- + else { + $bindir = dirname($0); + + # remove single-dot (".") path segments + #-------------------------------------- + while ($bindir =~ m|^\./|) { $bindir =~ s|^\./|| } + while ($bindir =~ m|/\./|) { $bindir =~ s|/\./|/| } + while ($bindir =~ m|/\.$|) { $bindir =~ s|/\.$|| } + + # remove leading double-dot ("..") path segments + #----------------------------------------------- + while ($bindir =~ m|^\.\.|) { + $bindir =~ s|^\.\.||; + $pwdL = dirname($pwdL); + $bindir =~ s|^/||; + } + + # determine path of fvbin + #------------------------ + $bindir = "$pwdL/$bindir" unless $bindir =~ m|^/|; + $fvbin = $bindir if -e $bindir and abs_path($bindir) eq $fvbin; + } + $fvroot = dirname($fvbin); $fvetc = "$fvroot/etc"; $user = getpwuid($<) unless ($user = $ENV{"USER"}); diff --git a/src/Applications/GEOSdas_App/monthly.yyyymm.pl.tmpl b/src/Applications/GEOSdas_App/monthly.yyyymm.pl.tmpl index 6d119cde..1792ac4d 100644 --- a/src/Applications/GEOSdas_App/monthly.yyyymm.pl.tmpl +++ b/src/Applications/GEOSdas_App/monthly.yyyymm.pl.tmpl @@ -58,10 +58,10 @@ my ($EXPID, $FVHOME, $PBS_BIN, $account, $listdir, $mnthlyRC); my ($numnodes_mm, $numnodes_mp, $plotHISTrc, $qcmd, $rundir); my ($script, $siteID, $workdir, $yyyymm, %newrc, %JOBID); my ($walltime_cl, $walltime_mm, $walltime_mp, $walltime_pf); -my ($MONTHLY_PARTITION, $MONTHLY_QOS); +my ($partition, $qos); -#$MONTHLY_PARTITION = "preops"; -#$MONTHLY_QOS = "dastest"; +#$partition = "preops"; +#$qos = "dastest"; my %valid = ( "fetch" => 1, "means" => 1, @@ -115,6 +115,9 @@ sub init { "finish_plots" => \$finish, "nopush" => \$nopush, + "partition=s" => \$partition, + "qos=s" => \$qos, + "rc|mrc=s" => \$mnthlyRC, "newrc:s" => \@newrc, @@ -381,7 +384,7 @@ sub fetch_calc_tar_and_clean { sub fetch_inputs { my (%opts, $filestring, $ftype, $htype, $do_dmput, $do_tar); my ($tmpl, $prefetch_j, $jobname, $outfile); - my ($job_name, $time, $output, $partition, $vFLG); + my ($job_name, $time, $output, $parFLG, $vFLG); my (%value, @deps, $dependFLG, $cmd); # input arguments @@ -405,14 +408,14 @@ sub fetch_inputs { $job_name = "SBATCH --job-name=$jobname"; $time = "SBATCH --time=$walltime_pf"; $output = "SBATCH --output=$outfile"; - $partition = "SBATCH --partition=datamove"; + $parFLG = "SBATCH --partition=datamove"; $vFLG = "--export=outfile=$outfile"; } else { $job_name = "PBS -N $jobname"; $time = "PBS -l walltime=$walltime_pf"; $output = "PBS -o $outfile"; - $partition = ""; + $parFLG = ""; $vFLG = "-v outfile=$outfile"; } @@ -421,7 +424,7 @@ sub fetch_inputs { $value{"__TIME__"} = $time; $value{"__ACCOUNT__"} = $account; $value{"__OUTPUT__"} = $output; - $value{"__PARTITION__"} = $partition; + $value{"__PARTITION__"} = $parFLG; $value{"__FILESTRING__"} = $filestring; $value{"__HOURTYPE__"} = $htype; @@ -488,8 +491,8 @@ sub calc_monthly_means { $nodes = "SBATCH --nodes=$numnodes_mm"; $per_node = "SBATCH --tasks-per-node=$tasks_per_node"; $vFLG = "--export=outfile=$outfile"; - $parFLG = "SBATCH --partition=$MONTHLY_PARTITION" if $MONTHLY_PARTITION; - $qosFLG = "SBATCH --qos=$MONTHLY_QOS" if $MONTHLY_QOS; + $parFLG = "SBATCH --partition=$partition" if $partition; + $qosFLG = "SBATCH --qos=$qos" if $qos; } else { $job_name = "PBS -N $jobname"; @@ -549,7 +552,7 @@ sub calc_monthly_means { sub tar_and_clean_inputs { my (%opts, $filestring, $ftype, $do_tar, $lastFLG); my ($tmpl, $tarandclean_j, $jobname, $outfile); - my ($job_name, $time, $output, $partition, $vFLG); + my ($job_name, $time, $output, $parFLG, $vFLG); my (%value, $walltime, @deps, $dependFLG, $cmd); # input arguments @@ -572,14 +575,14 @@ sub tar_and_clean_inputs { $job_name = "SBATCH --job-name=$jobname"; $time = "SBATCH --time=$walltime_cl"; $output = "SBATCH --output=$outfile"; - $partition = "SBATCH --partition=datamove"; + $parFLG = "SBATCH --partition=datamove"; $vFLG = "--export=outfile=$outfile"; } else { $job_name = "PBS -N $jobname "; $time = "PBS -l walltime=$walltime_cl"; $output = "PBS -o $outfile"; - $partition = ""; + $parFLG = ""; $vFLG = "-v outfile=$outfile"; } @@ -588,7 +591,7 @@ sub tar_and_clean_inputs { $value{"__TIME__"} = $time; $value{"__ACCOUNT__"} = $account; $value{"__OUTPUT__"} = $output; - $value{"__PARTITION__"} = $partition; + $value{"__PARTITION__"} = $parFLG; $value{"__FILESTRING__"} = $filestring; $value{"__YYYYMM__"} = $yyyymm; @@ -733,7 +736,7 @@ sub archive_monthly_files { #======================================================================= sub monthly_plots { my ($tmpl, $transfer_csh, $plots_j, $jobname, $outfile); - my ($job_name, $nodes, $time, $output, $partition); + my ($job_name, $nodes, $time, $output, $parFLG); my (%value, @deps, $dependFLG, $vFLG, $cmd); # create plots transfer job script @@ -747,14 +750,14 @@ sub monthly_plots { $job_name = "SBATCH --job-name=$jobname"; $time = "SBATCH --time=$walltime_cl"; $output = "SBATCH --output=$outfile"; - $partition = "SBATCH --partition=datamove"; + $parFLG = "SBATCH --partition=datamove"; $vFLG = "--export=outfile=$outfile"; } else { $job_name = "PBS -N $jobname"; $time = "PBS -l walltime=$walltime_cl"; $output = "PBS -o $outfile"; - $partition = ""; + $parFLG = ""; $vFLG = "-v outfile=$outfile"; } @@ -763,7 +766,7 @@ sub monthly_plots { $value{"__TIME__"} = $time; $value{"__ACCOUNT__"} = $account; $value{"__OUTPUT__"} = $output; - $value{"__PARTITION__"} = $partition; + $value{"__PARTITION__"} = $parFLG; $value{"__TRANSFER__"} = basename($transfer_csh); $value{"__RUNDIR__"} = $rundir; @@ -1038,21 +1041,25 @@ purpose: calculate means, tar inputs, and/or produce plots for monthly data usage: $script [process options] [plot option] [other options] process options (see Notes below) - -means calculate monthly means - -tar tar input files - -plots produce monthly plots from monthly means - -finish_plots finish monthly plots job which stopped before completion + -means calculate monthly means + -tar tar input files + -plots produce monthly plots from monthly means + -finish_plots finish monthly plots job which stopped before completion plot option (only valid when used with -plots or -finish_plots) - -nopush do not transfer gif files to Web server after plotting + -nopush do not transfer gif files to Web server after plotting + +slurm directive options + -partition partition send monthly means jobs to specified partition + -qos qos send monthly means jobs to specified qos other options - -rc mnthlyRC name of monthly rc file [run/monthly.rc] - -newrc [n] re-create resource files prior to any other processing - if n==1, then write new monthly rc file - if n==2, then write new plots HISTORY.rc_tmpl - if no value for n is given, then n==1,2 - -h print usage information + -rc mnthlyRC name of monthly rc file [run/monthly.rc] + -newrc [n] re-create resource files prior to any other processing + if n==1, then write new monthly rc file + if n==2, then write new plots HISTORY.rc_tmpl + if no value for n is given, then n==1,2 + -h print usage information Notes: 1. Plots cannot be produced unless monthly means are calculated diff --git a/src/Applications/GEOSdas_App/monthly_setup.pl b/src/Applications/GEOSdas_App/monthly_setup.pl index 0d0bdd25..647546c7 100755 --- a/src/Applications/GEOSdas_App/monthly_setup.pl +++ b/src/Applications/GEOSdas_App/monthly_setup.pl @@ -178,7 +178,7 @@ sub write_plotfiles { $values{"\@BATCH_GROUP"} = "SBATCH --account=$GID"; $values{"\@SITE"} = uc($siteID); $values{"\@GEOSBIN"} = "$FVROOT/bin"; - $values{"\@GEOSSRC"} = dirname($FVROOT) ."/src"; + $values{"\@GEOSSRC"} = $ENV{"GEOSUTIL"}; replaceLabels($infile, $outfil, \%values,\@setenvs);