From 187105512d4d7729eca3e55cf620e8b40cb94afd Mon Sep 17 00:00:00 2001 From: Patrick Tripp <44276748+patrick-tripp@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:57:12 -0400 Subject: [PATCH] Formainpr (#93) * From the terraform folder, can use ./login to log in the head node. * CORA ADCIRC added * New EFS software has bugs, using older version * adcirc-cora README * squash merged some updates: hindcast testing, debugged patch for adcirc, saving liveocean * Minor fixes * LiveOcean tests and fixes * LO hindcast workflow updates and testing * LO and CORA ADCIRC work on NOS Sandbox * tested deployment * cora and liveocean work from user chosen directories * Removed NAME tag from cluster/config files --- .gitignore | 11 +- cloudflow/cluster/AWSCluster.py | 2 +- cloudflow/cluster/configs/NOS/nos.cora.cfg | 15 + .../cluster/configs/NOS/nos.liveocean.cfg | 15 + .../cluster/configs/{ => RPS}/ioos.amd.config | 3 +- cloudflow/cluster/configs/RPS/ioos.cora.cfg | 19 + .../configs/{ => RPS}/ioos.intel.config | 3 +- .../{liveocean.rps => RPS/ioos.liveocean.cfg} | 5 +- cloudflow/cluster/configs/RPS/ioos.nosofs.cfg | 15 + .../cluster/configs/{ => RPS}/nosofs.config | 3 +- cloudflow/cluster/configs/RPS/test.cora.cfg | 18 + .../cluster/configs/RPS/test.liveocean.cfg | 18 + cloudflow/cluster/configs/get_aws_ec2meta.sh | 37 + cloudflow/cluster/configs/ioos.config | 20 - cloudflow/cluster/configs/liveocean.config | 16 - cloudflow/cluster/configs/liveocean.ioos | 1 + cloudflow/cluster/configs/noaa.cora.config | 1 + cloudflow/cluster/configs/post.config | 3 +- cloudflow/cluster/nodeInfo.py | 15 +- cloudflow/job/ADCIRCReanalysis.py | 147 + cloudflow/job/JobFactory.py | 5 +- cloudflow/job/ROMSHindcast.py | 39 +- cloudflow/job/jobs/cora.reanalysis | 15 + .../job/jobs/liveocean.cas7_t0_x4b.hindcast | 1 + .../jobs/liveocean.cas7_t0_x4b.hindcast.dt25 | 21 + .../jobs/liveocean.cas7_t0_x4b.hindcast.dt30 | 7 +- cloudflow/job/jobs/test.cora.reanalysis | 15 + .../jobs/test.liveocean.cas7_t0_x4b.hindcast | 21 + cloudflow/job/templates/ec95d_prior_config.in | 90 + .../templates/liveocean.cas7_t0_x4b-dt25.in | 3275 +++++++++++++++++ .../templates/liveocean.cas7_t0_x4b-dt30.in | 2 +- .../templates/liveocean.cas7_t0_x4b-dt40.in | 2 +- .../job/templates/liveocean.cas7_t0_x4b.in | 2 +- .../job/templates/liveocean.cas7_t0_x4b.saved | 3274 ++++++++++++++++ .../job/templates/submit.cloudflow.template | 54 + cloudflow/utils/romsUtil.py | 6 + cloudflow/workflows/cora_launcher.sh | 99 + cloudflow/workflows/fcst_launcher.sh | 34 +- cloudflow/workflows/flows.py | 79 +- cloudflow/workflows/lohindcast_launch.py | 21 +- cloudflow/workflows/lohindcast_main.py | 1 + cloudflow/workflows/tasks.py | 70 +- cloudflow/workflows/workflow_main.py | 20 +- models/adcirc-cora/buildadcirc.sh | 55 + models/adcirc-cora/cleanme.sh | 12 + models/adcirc-cora/cmplrflags.mk | 1567 ++++++++ models/adcirc-cora/getS3packages.sh | 12 + models/adcirc-cora/install-adcirc-cora.sh | 26 + models/adcirc-cora/intel_x86_64 | 59 + models/adcirc-cora/load_modules | 10 + models/adcirc-cora/loadmodules.sh | 2 + models/liveocean/README | 2 + models/nosofs/README | 1 + patches/adcirc-cora/fix4cora.sh | 32 + patches/adcirc-cora/reinstall-esmf-netcdf.sh | 39 + scripts/aws_ec2meta.sh | 32 - scripts/funcs-setup-instance.sh | 7 +- .../cluster/configs => scripts}/newamised.sh | 0 scripts/scp-secret.sh | 9 +- scripts/spack-update-mirror.sh | 31 +- scripts/system/.bashrc | 40 + scripts/system/.tcshrc | 21 + scripts/system/patrick.gitconfig | 3 + scripts/test-setup.sh | 21 +- terraform/init_template.tpl | 24 +- terraform/login | 0 terraform/main.tf | 10 +- 67 files changed, 9335 insertions(+), 200 deletions(-) create mode 100644 cloudflow/cluster/configs/NOS/nos.cora.cfg create mode 100644 cloudflow/cluster/configs/NOS/nos.liveocean.cfg rename cloudflow/cluster/configs/{ => RPS}/ioos.amd.config (89%) create mode 100644 cloudflow/cluster/configs/RPS/ioos.cora.cfg rename cloudflow/cluster/configs/{ => RPS}/ioos.intel.config (89%) rename cloudflow/cluster/configs/{liveocean.rps => RPS/ioos.liveocean.cfg} (86%) create mode 100644 cloudflow/cluster/configs/RPS/ioos.nosofs.cfg rename cloudflow/cluster/configs/{ => RPS}/nosofs.config (89%) create mode 100644 cloudflow/cluster/configs/RPS/test.cora.cfg create mode 100644 cloudflow/cluster/configs/RPS/test.liveocean.cfg create mode 100755 cloudflow/cluster/configs/get_aws_ec2meta.sh delete mode 100644 cloudflow/cluster/configs/ioos.config delete mode 100644 cloudflow/cluster/configs/liveocean.config create mode 120000 cloudflow/cluster/configs/liveocean.ioos create mode 120000 cloudflow/cluster/configs/noaa.cora.config create mode 100644 cloudflow/job/ADCIRCReanalysis.py create mode 100644 cloudflow/job/jobs/cora.reanalysis create mode 100644 cloudflow/job/jobs/liveocean.cas7_t0_x4b.hindcast.dt25 create mode 100644 cloudflow/job/jobs/test.cora.reanalysis create mode 100644 cloudflow/job/jobs/test.liveocean.cas7_t0_x4b.hindcast create mode 100644 cloudflow/job/templates/ec95d_prior_config.in create mode 100644 cloudflow/job/templates/liveocean.cas7_t0_x4b-dt25.in create mode 100644 cloudflow/job/templates/liveocean.cas7_t0_x4b.saved create mode 100644 cloudflow/job/templates/submit.cloudflow.template create mode 100755 cloudflow/workflows/cora_launcher.sh create mode 120000 cloudflow/workflows/lohindcast_main.py create mode 100755 models/adcirc-cora/buildadcirc.sh create mode 100755 models/adcirc-cora/cleanme.sh create mode 100644 models/adcirc-cora/cmplrflags.mk create mode 100755 models/adcirc-cora/getS3packages.sh create mode 100755 models/adcirc-cora/install-adcirc-cora.sh create mode 100644 models/adcirc-cora/intel_x86_64 create mode 100644 models/adcirc-cora/load_modules create mode 100644 models/adcirc-cora/loadmodules.sh create mode 100644 models/liveocean/README create mode 100644 models/nosofs/README create mode 100755 patches/adcirc-cora/fix4cora.sh create mode 100755 patches/adcirc-cora/reinstall-esmf-netcdf.sh delete mode 100755 scripts/aws_ec2meta.sh rename {cloudflow/cluster/configs => scripts}/newamised.sh (100%) create mode 100644 scripts/system/.bashrc create mode 100644 scripts/system/.tcshrc create mode 100644 scripts/system/patrick.gitconfig mode change 100644 => 100755 terraform/login diff --git a/.gitignore b/.gitignore index 20b409b..a81c1c1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,18 +2,16 @@ .DS_Store tmp *.egg-info/ +*.swp .ipynb_checkpoints -worflow/*.ipynb +**/*.ipynb .pytest_cache/ -workflow/dist -workflow/*.out +cloudflow/*.out +cloudflow/*.log **/worker-*.dirlock **/purge.lock **/global.lock -workflow/workflows/lo.out .idea/ -workflow/.idea/ -workflow/venv/ .eggs/ dist/ docs/build/ @@ -33,3 +31,4 @@ my.tfvars my.plan build/ cloudflow/build/ +.nfs* diff --git a/cloudflow/cluster/AWSCluster.py b/cloudflow/cluster/AWSCluster.py index e8446f7..552ee5f 100644 --- a/cloudflow/cluster/AWSCluster.py +++ b/cloudflow/cluster/AWSCluster.py @@ -28,7 +28,7 @@ timelog.setLevel(logging.DEBUG) timelog.propagate = False -fh = logging.FileHandler(f"{homedir}/qops_forecast.log") +fh = logging.FileHandler(f"{homedir}/cluster_runtime.log") fh.setLevel(logging.DEBUG) formatter = logging.Formatter(' %(asctime)s %(levelname)s | %(message)s') fh.setFormatter(formatter) diff --git a/cloudflow/cluster/configs/NOS/nos.cora.cfg b/cloudflow/cluster/configs/NOS/nos.cora.cfg new file mode 100644 index 0000000..73c106a --- /dev/null +++ b/cloudflow/cluster/configs/NOS/nos.cora.cfg @@ -0,0 +1,15 @@ +{ +"platform" : "AWS", +"region" : "us-east-2", +"nodeType" : "hpc6a.48xlarge", +"nodeCount" : 1, +"tags" : [ + { "Key": "Name", "Value": "CORA-node" }, + { "Key": "Project", "Value": "NOS-cloud-sandbox" } + ], +"image_id" : "ami-082e2e4e7ef1c6d77", +"key_name" : "rsa_sandbox_key", +"sg_ids" : ["sg-05c044182398b2a27", "sg-0e5148638d9196f69", "sg-06ca6bc5d4b377dad"], +"subnet_id" : "subnet-00075cfbfcbc8f2cf", +"placement_group" : "ioos_cloud_sandbox_Terraform_Placement_Group" +} diff --git a/cloudflow/cluster/configs/NOS/nos.liveocean.cfg b/cloudflow/cluster/configs/NOS/nos.liveocean.cfg new file mode 100644 index 0000000..43bd44d --- /dev/null +++ b/cloudflow/cluster/configs/NOS/nos.liveocean.cfg @@ -0,0 +1,15 @@ +{ +"platform" : "AWS", +"region" : "us-east-2", +"nodeType" : "r7iz.32xlarge", +"nodeCount" : 4, +"tags" : [ + { "Key": "Name", "Value": "LiveOcean-node" }, + { "Key": "Project", "Value": "NOS-cloud-sandbox" } + ], +"image_id" : "ami-082e2e4e7ef1c6d77", +"key_name" : "rsa_sandbox_key", +"sg_ids" : ["sg-05c044182398b2a27", "sg-0e5148638d9196f69", "sg-06ca6bc5d4b377dad"], +"subnet_id" : "subnet-00075cfbfcbc8f2cf", +"placement_group" : "ioos_cloud_sandbox_Terraform_Placement_Group" +} diff --git a/cloudflow/cluster/configs/ioos.amd.config b/cloudflow/cluster/configs/RPS/ioos.amd.config similarity index 89% rename from cloudflow/cluster/configs/ioos.amd.config rename to cloudflow/cluster/configs/RPS/ioos.amd.config index 1dd7e66..b2959a5 100644 --- a/cloudflow/cluster/configs/ioos.amd.config +++ b/cloudflow/cluster/configs/RPS/ioos.amd.config @@ -5,8 +5,7 @@ "nodeCount" : 2, "tags" : [ { "Key": "Name", "Value": "IOOS-cloud-sandbox" }, - { "Key": "Project", "Value": "IOOS-cloud-sandbox" }, - { "Key": "NAME", "Value": "nosofs-fcst" } + { "Key": "Project", "Value": "IOOS-cloud-sandbox" } ], "image_id" : "ami-01c437ac2b5beddda", "key_name" : "ioos-sandbox", diff --git a/cloudflow/cluster/configs/RPS/ioos.cora.cfg b/cloudflow/cluster/configs/RPS/ioos.cora.cfg new file mode 100644 index 0000000..6bef692 --- /dev/null +++ b/cloudflow/cluster/configs/RPS/ioos.cora.cfg @@ -0,0 +1,19 @@ +{ +"platform" : "AWS", +"region" : "us-east-2", +"nodeType" : "hpc6a.48xlarge", +"nodeCount" : 1, +"tags" : [ + { "Key": "Name", "Value": "CORA-Cloud-Sandbox-node" }, + { "Key": "Project", "Value": "IOOS-Cloud-Sandbox" } + ], +"image_id" : "ami-0d97c0e5cea6aa80b", +"key_name" : "ioos-sandbox", +"sg_ids" : [ + "sg-070faae1c63b4b0a2", + "sg-0804c2befa81516aa", + "sg-0f6684b52d2e9e107" + ], +"subnet_id" : "subnet-05764d14e38acec51", +"placement_group" : "cora-cloud-sandbox-us-east-2b_Terraform_Placement_Group" +} diff --git a/cloudflow/cluster/configs/ioos.intel.config b/cloudflow/cluster/configs/RPS/ioos.intel.config similarity index 89% rename from cloudflow/cluster/configs/ioos.intel.config rename to cloudflow/cluster/configs/RPS/ioos.intel.config index 0846016..3258cd4 100644 --- a/cloudflow/cluster/configs/ioos.intel.config +++ b/cloudflow/cluster/configs/RPS/ioos.intel.config @@ -5,8 +5,7 @@ "nodeCount" : 1, "tags" : [ { "Key": "Name", "Value": "IOOS-cloud-sandbox" }, - { "Key": "Project", "Value": "IOOS-cloud-sandbox" }, - { "Key": "NAME", "Value": "nosofs-fcst" } + { "Key": "Project", "Value": "IOOS-cloud-sandbox" } ], "image_id" : "ami-052928467e84be78c", "key_name" : "ioos-sandbox", diff --git a/cloudflow/cluster/configs/liveocean.rps b/cloudflow/cluster/configs/RPS/ioos.liveocean.cfg similarity index 86% rename from cloudflow/cluster/configs/liveocean.rps rename to cloudflow/cluster/configs/RPS/ioos.liveocean.cfg index c81b040..c89c924 100644 --- a/cloudflow/cluster/configs/liveocean.rps +++ b/cloudflow/cluster/configs/RPS/ioos.liveocean.cfg @@ -2,11 +2,10 @@ "platform" : "AWS", "region" : "us-east-2", "nodeType" : "hpc6a.48xlarge", -"nodeCount" : 2, +"nodeCount" : 8, "tags" : [ { "Key": "Name", "Value": "IOOS-cloud-sandbox" }, - { "Key": "Project", "Value": "IOOS-cloud-sandbox" }, - { "Key": "NAME", "Value": "liveocean-fcst" } + { "Key": "Project", "Value": "IOOS-cloud-sandbox" } ], "image_id" : "ami-07d0aa6a6ac23d33a", "key_name" : "ioos-sandbox", diff --git a/cloudflow/cluster/configs/RPS/ioos.nosofs.cfg b/cloudflow/cluster/configs/RPS/ioos.nosofs.cfg new file mode 100644 index 0000000..c89c924 --- /dev/null +++ b/cloudflow/cluster/configs/RPS/ioos.nosofs.cfg @@ -0,0 +1,15 @@ +{ +"platform" : "AWS", +"region" : "us-east-2", +"nodeType" : "hpc6a.48xlarge", +"nodeCount" : 8, +"tags" : [ + { "Key": "Name", "Value": "IOOS-cloud-sandbox" }, + { "Key": "Project", "Value": "IOOS-cloud-sandbox" } + ], +"image_id" : "ami-07d0aa6a6ac23d33a", +"key_name" : "ioos-sandbox", +"sg_ids" : [ "sg-054f4248a8fc54750", "sg-0c9bb98732e936e66", "sg-0ce1abfe87363d80b" ], +"subnet_id" : "subnet-04b0eef9cb8015d31", +"placement_group" : "ioos_cloud_sandbox-us-east-2b_Terraform_Placement_Group" +} diff --git a/cloudflow/cluster/configs/nosofs.config b/cloudflow/cluster/configs/RPS/nosofs.config similarity index 89% rename from cloudflow/cluster/configs/nosofs.config rename to cloudflow/cluster/configs/RPS/nosofs.config index c6b14b7..15a7b72 100644 --- a/cloudflow/cluster/configs/nosofs.config +++ b/cloudflow/cluster/configs/RPS/nosofs.config @@ -5,8 +5,7 @@ "nodeCount" : 1, "tags" : [ { "Key": "Name", "Value": "IOOS-cloud-sandbox" }, - { "Key": "Project", "Value": "IOOS-cloud-sandbox" }, - { "Key": "NAME", "Value": "nosofs-fcst" } + { "Key": "Project", "Value": "IOOS-cloud-sandbox" } ], "image_id" : "ami-076b2467dfd17d05e", "key_name" : "ioos-sandbox", diff --git a/cloudflow/cluster/configs/RPS/test.cora.cfg b/cloudflow/cluster/configs/RPS/test.cora.cfg new file mode 100644 index 0000000..359566d --- /dev/null +++ b/cloudflow/cluster/configs/RPS/test.cora.cfg @@ -0,0 +1,18 @@ +{ +"platform" : "AWS", +"region" : "us-east-2", +"nodeType" : "hpc6a.48xlarge", +"nodeCount" : 1, +"tags" : [ + { "Key": "Name", "Value": "CORA-Cloud-Sandbox-node" }, + { "Key": "Project", "Value": "IOOS-Cloud-Sandbox" } + ], +"image_id" : "ami-049a762c1343a9d98", +"key_name" : "ioos-sandbox", +"sg_ids" : [ "sg-0feaeb0d419b7ddda", + "sg-046f683021585a25f", + "sg-0416cbb8c060a1779" + ], +"subnet_id" : "subnet-0be869ddbf3096968", +"placement_group" : "forPR-cloud-sandbox-us-east-2b_Terraform_Placement_Group" +} diff --git a/cloudflow/cluster/configs/RPS/test.liveocean.cfg b/cloudflow/cluster/configs/RPS/test.liveocean.cfg new file mode 100644 index 0000000..d8a5a1c --- /dev/null +++ b/cloudflow/cluster/configs/RPS/test.liveocean.cfg @@ -0,0 +1,18 @@ +{ +"platform" : "AWS", +"region" : "us-east-2", +"nodeType" : "hpc6a.48xlarge", +"nodeCount" : 8, +"tags" : [ + { "Key": "Name", "Value": "forPR-Cloud-Sandbox-node" }, + { "Key": "Project", "Value": "IOOS-cloud-sandbox" } + ], +"image_id" : "ami-049a762c1343a9d98", +"key_name" : "ioos-sandbox", +"sg_ids" : [ "sg-0feaeb0d419b7ddda", + "sg-046f683021585a25f", + "sg-0416cbb8c060a1779" + ], +"subnet_id" : "subnet-0be869ddbf3096968", +"placement_group" : "forPR-cloud-sandbox-us-east-2b_Terraform_Placement_Group" +} diff --git a/cloudflow/cluster/configs/get_aws_ec2meta.sh b/cloudflow/cluster/configs/get_aws_ec2meta.sh new file mode 100755 index 0000000..c222dbc --- /dev/null +++ b/cloudflow/cluster/configs/get_aws_ec2meta.sh @@ -0,0 +1,37 @@ +#!/bin/bash +#set -x + +TOKEN=`curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` +META="http://169.254.169.254/latest/meta-data" + +INSTANCEID=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" $META/instance-id) +IFACE=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" $META/network/interfaces/macs) +SUBNET_ID=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" $META/network/interfaces/macs/${IFACE}/subnet-id) +VPC_ID=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" $META/network/interfaces/macs/${IFACE}/vpc-id) +REGION=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" $META/placement/availability-zone | sed 's/[a-z]$//') +MAC=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" $META/network/interfaces/macs | head -1) +SGIDS=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" $META/network/interfaces/macs/${MAC}/security-group-ids) + +#AMIID=`tail /tmp/setup.log | grep ImageId` + +#PLACEMENT_GROUP=`aws ec2 describe-placement-groups | grep GroupId | awk -F\" '{print $4}'` +#PLACEMENT_GROUP=`aws ec2 describe-placement-groups | grep GroupId` + +echo "instanceid: $INSTANCEID" +#echo "iface: $IFACE" +echo "region: $REGION" +echo "vpc_id: $VPC_ID" +echo "image_id: $AMIID" +echo "sg_ids: " +echo "$SGIDS" +echo "subnet_id: $SUBNET_ID" +echo "placement_group: $PLACEMENT_GROUP" + +#tail /tmp/setup.log | grep ImageId + +# Can manually create an AMI here +# ami_name="IOOS Cloud Sandbox AMI" +# project="IOOS-cloud-sandbox" + +# /usr/local/bin/aws --region ${REGION} ec2 create-image --instance-id $INSTANCEID --name "${ami_name}" \ +# --tag-specification "ResourceType=image,Tags=[{Key=\"Name\",Value=\"${ami_name}\"},{Key=\"Project\",Value=\"${project}\"}]" diff --git a/cloudflow/cluster/configs/ioos.config b/cloudflow/cluster/configs/ioos.config deleted file mode 100644 index 5b8f831..0000000 --- a/cloudflow/cluster/configs/ioos.config +++ /dev/null @@ -1,20 +0,0 @@ -{ -"platform" : "AWS", -"region" : "us-east-2", -"nodeType" : "hpc6a.48xlarge", -"nodeCount" : 2, -"tags" : [ - { "Key": "Name", "Value": "IOOS-cloud-sandbox" }, - { "Key": "Project", "Value": "IOOS-cloud-sandbox" }, - { "Key": "NAME", "Value": "nosofs-fcst" } - ], -"image_id" : "ami-0a4b30237fee5d223", -"key_name" : "ioos-sandbox", -"sg_ids" : [ - "sg-0810cdb0357f0a92c", - "sg-058243450eb3b4308", - "sg-0b2a044dad6a21156" - ], -"subnet_id" : "subnet-0a83f73406e809b00", -"placement_group" : "Patrick-x86_64-sandbox_Terraform_Placement_Group" -} diff --git a/cloudflow/cluster/configs/liveocean.config b/cloudflow/cluster/configs/liveocean.config deleted file mode 100644 index a82175a..0000000 --- a/cloudflow/cluster/configs/liveocean.config +++ /dev/null @@ -1,16 +0,0 @@ -{ -"platform" : "AWS", -"region" : "us-east-1", -"nodeType" : "c5n.18xlarge", -"nodeCount" : 2, -"tags" : [ - { "Key": "Name", "Value": "IOOS-cloud-sandbox" }, - { "Key": "Project", "Value": "IOOS-cloud-sandbox" }, - { "Key": "NAME", "Value": "liveocean-fcst" } - ], -"image_id" : "ami-052f3e9220b9961dc", -"key_name" : "patrick-ioos-cloud-sandbox", -"sg_ids" : ["sg-006041073bfa7b072", "sg-0a48755f7b926b051", "sg-04a6bcecaec589f64"], -"subnet_id" : "subnet-050093b957519d622", -"placement_group" : "IOOS-cloud-sandbox-cluster-placement-group" -} diff --git a/cloudflow/cluster/configs/liveocean.ioos b/cloudflow/cluster/configs/liveocean.ioos new file mode 120000 index 0000000..56b3cb5 --- /dev/null +++ b/cloudflow/cluster/configs/liveocean.ioos @@ -0,0 +1 @@ +NOS/nos.liveocean.cfg \ No newline at end of file diff --git a/cloudflow/cluster/configs/noaa.cora.config b/cloudflow/cluster/configs/noaa.cora.config new file mode 120000 index 0000000..dda48dd --- /dev/null +++ b/cloudflow/cluster/configs/noaa.cora.config @@ -0,0 +1 @@ +NOS/nos.cora.cfg \ No newline at end of file diff --git a/cloudflow/cluster/configs/post.config b/cloudflow/cluster/configs/post.config index 5d7a3c4..6ce808f 100644 --- a/cloudflow/cluster/configs/post.config +++ b/cloudflow/cluster/configs/post.config @@ -5,8 +5,7 @@ "nodeCount" : 1, "tags" : [ { "Key": "Name", "Value": "IOOS-cloud-sandbox" }, - { "Key": "Project", "Value": "IOOS-cloud-sandbox" }, - { "Key": "NAME", "Value": "nosofs plotting" } + { "Key": "Project", "Value": "IOOS-cloud-sandbox" } ], "image_id" : "ami-052f3e9220b9961dc", "key_name" : "patrick-ioos-cloud-sandbox", diff --git a/cloudflow/cluster/nodeInfo.py b/cloudflow/cluster/nodeInfo.py index 70de3a4..eaea770 100644 --- a/cloudflow/cluster/nodeInfo.py +++ b/cloudflow/cluster/nodeInfo.py @@ -5,16 +5,13 @@ __license__ = "BSD 3-Clause" - awsTypes = {'c5.large': 1, 'c5.xlarge': 2, 'c5.2xlarge': 4, 'c5.4xlarge': 8, 'c5.9xlarge': 18, 'c5.12xlarge': 24, 'c5.18xlarge': 36, 'c5.24xlarge': 48, 'c5.metal': 36, 'c5n.large': 1, 'c5n.xlarge': 2, 'c5n.2xlarge': 4, 'c5n.4xlarge': 8, 'c5n.9xlarge': 18, 'c5n.18xlarge': 36, 'c5n.24xlarge': 48, 'c5n.metal': 36, 't3.large': 1, 't3.xlarge': 2, 't3.2xlarge': 4, 'c5a.2xlarge': 4, 'c5a.4xlarge': 8, 'c5a.24xlarge': 48, - 'hpc6a.48xlarge': 96 } - -efaTypes = ['c5n.18xlarge', 'hpc6a.48xlarge'] + 'hpc6a.48xlarge': 96, 'hpc7a.96xlarge': 192, 'hpc7a.48xlarge': 96, 'c7i.48xlarge': 96, 'r7iz.32xlarge': 64 } def getPPN(instance_type): @@ -33,16 +30,6 @@ def getPPN(instance_type): Exception if instance_type is not found """ - # awsTypes = {'c5.large': 1, 'c5.xlarge': 2, 'c5.2xlarge': 4, 'c5.4xlarge': 8, 'c5.9xlarge': 18, 'c5.12xlarge': 24, - # 'c5.18xlarge': 36, 'c5.24xlarge': 48, 'c5.metal': 36, - # 'c5n.large': 1, 'c5n.xlarge': 2, 'c5n.2xlarge': 4, 'c5n.4xlarge': 8, 'c5n.9xlarge': 18, - # 'c5n.18xlarge': 36, 'c5n.24xlarge': 48, 'c5n.metal': 36, - # 't3.large': 1, 't3.xlarge': 2, 't3.2xlarge': 4, - # 'c5a.2xlarge': 4, 'c5a.4xlarge': 8, 'c5a.24xlarge': 48, - # 'hpc6a.48xlarge': 96 } - - # efaTypes = ['c5n.18xlarge', 'hpc6a.48xlarge'] - try: ppn = awsTypes[instance_type] except Exception as e: diff --git a/cloudflow/job/ADCIRCReanalysis.py b/cloudflow/job/ADCIRCReanalysis.py new file mode 100644 index 0000000..69e6547 --- /dev/null +++ b/cloudflow/job/ADCIRCReanalysis.py @@ -0,0 +1,147 @@ +import datetime +import os +import sys + +if os.path.abspath('..') not in sys.path: + sys.path.append(os.path.abspath('..')) + +curdir = os.path.dirname(os.path.abspath(__file__)) + +from cloudflow.job.Job import Job +from cloudflow.utils import romsUtil as util + +__copyright__ = "Copyright © 2023 RPS Group, Inc. All rights reserved." +__license__ = "BSD 3-Clause" + + +debug = False + + +class ADCIRCReanalysis(Job): + """ Implementation of Job class for ADCIRC Reanalysis (CORA) + + Attributes + ---------- + jobtype : str + Always 'adcircforecast' for this class. + + configfile : str + A JSON configuration file containing the required parameters for this class. + + NPROCS : int + Total number of processors in this cluster. + + OFS : str + The ocean forecast to run. + + YYYY : str + The run date in format YYYY + + BUCKET : str + The cloud bucket name for saving results + + BCKTFLDR : str + The cloud folder name for saving results + + OUTDIR : str + The full path to the output folder + + CONFIG : str + The ocean.in file to use or "AUTO" to use a template + + CONFIGTMPL : str + The ocean.in template to use or "AUTO" to use the default template + + TEMPLPATH : str + The full path to the templates to use + + """ + + + # TODO: make self and cfDict consistent + def __init__(self, configfile, NPROCS ): + """ Constructor + + Parameters + ---------- + configfile : str + + NPROCS : int + The number of processors to run the job on + + """ + + self.jobtype = 'adcircreanalysis' + self.configfile = configfile + + self.NPROCS = NPROCS + + self.TEMPLPATH = f"{curdir}/templates" + + if debug: + print(f"DEBUG: in ADCIRCReanalysis init") + print(f"DEBUG: job file is: {configfile}") + + cfDict = self.readConfig(configfile) + self.parseConfig(cfDict) + + self.make_config() + + return + + + def parseConfig(self, cfDict): + """ Parses the configuration dictionary to class attributes + + Parameters + ---------- + cfDict : dict + Dictionary containing this cluster parameterized settings. + """ + + self.OFS = cfDict['OFS'] + self.YYYY = cfDict['YYYY'] + self.BUCKET = cfDict['BUCKET'] + self.BCKTFLDR = cfDict['BCKTFLDR'] + self.OUTDIR = cfDict['OUTDIR'] + self.ProjectName = cfDict['ProjectName'] + self.ProjectHome = cfDict['ProjectHome'] + self.ADCIRCHome = cfDict['ADCIRCHome'] + self.CONFIG = cfDict['CONFIG'] + self.CONFIGTMPL = cfDict['CONFIGTMPL'] + self.contact = cfDict['contact'] + self.WRITERCORES = cfDict['WRITERCORES'] + + return + + def make_config(self): + + if self.OFS == 'adcirc-cora': + self.__make_cora_config() + else: + raise Exception(f"I don't know how to create a config for {OFS}") + + + def __make_cora_config(self): + """ Create the config file used by ADCIRC run_storms.sh """ + YYYY = self.YYYY + + print(f'in {__name__}: YYYY : {YYYY}') + + template = self.CONFIGTMPL + + settings = { + "__ProjectName__": self.ProjectName, + "__ProjectHome__": self.ProjectHome, + "__ADCIRCHome__": self.ADCIRCHome, + "__contact__": self.contact, + "__NPROCS__": self.NPROCS, + "__WRITERCORES__": self.WRITERCORES + } + + # Create the CORA config file + outfile = self.CONFIG + util.makeADCIRCin(settings, template, outfile) + +if __name__ == '__main__': + pass diff --git a/cloudflow/job/JobFactory.py b/cloudflow/job/JobFactory.py index 5dd535b..20fe1fa 100644 --- a/cloudflow/job/JobFactory.py +++ b/cloudflow/job/JobFactory.py @@ -6,6 +6,7 @@ from cloudflow.job.Plotting import Plotting from cloudflow.job.FVCOMForecast import FVCOMForecast from cloudflow.job.ADCIRCForecast import ADCIRCForecast +from cloudflow.job.ADCIRCReanalysis import ADCIRCReanalysis __copyright__ = "Copyright © 2023 RPS Group, Inc. All rights reserved." __license__ = "BSD 3-Clause" @@ -13,7 +14,6 @@ debug = True - # noinspection PyCallingNonCallable class JobFactory: """ Class factory for different Job implementations """ @@ -21,7 +21,6 @@ class JobFactory: def __init__(self): return - def job(self, configfile: str, NPROCS: int) -> Job: """ Create a new specific type of Job instance @@ -53,6 +52,8 @@ def job(self, configfile: str, NPROCS: int) -> Job: newjob = ADCIRCForecast(configfile, NPROCS) elif (jobtype == 'plotting') or (jobtype == 'plotting_diff'): newjob = Plotting(configfile, NPROCS) + elif (jobtype == 'adcircreanalysis'): + newjob = ADCIRCReanalysis(configfile, NPROCS) else: raise Exception('Unsupported jobtype') diff --git a/cloudflow/job/ROMSHindcast.py b/cloudflow/job/ROMSHindcast.py index f2709c8..5ae09f5 100644 --- a/cloudflow/job/ROMSHindcast.py +++ b/cloudflow/job/ROMSHindcast.py @@ -144,6 +144,14 @@ def parseConfig(self, cfDict): self.OCEANIN = cfDict['OCEANIN'] self.OCNINTMPL = cfDict['OCNINTMPL'] + # LiveOcean experiment + if self.OFS == "liveocean": + if 'EXPNAME' in cfDict: + self.EXPNAME = cfDict["EXPNAME"] + else: + raise Exception(f"EXPNAME (experiment name) missing in {this.configfile}") + + # Coupled models have additional input files if 'CPLINTMPL' in cfDict: self.CPLINTMPL = cfDict['CPLINTMPL'] @@ -161,7 +169,7 @@ def parseConfig(self, cfDict): if self.OCNINTMPL == "auto": self.OCNINTMPL = f"{self.TEMPLPATH}/{self.OFS}.ocean.in" - + return @@ -191,27 +199,30 @@ def __make_oceanin_lo(self): OFS = self.OFS COMROT = self.COMROT PTMP = self.PTMP + EXPNAME = self.EXPNAME + OUTDIR = self.OUTDIR - print(f'in __make_oceanin_lo: CDATE: {CDATE}') - - ## TODO: hardcoded, need to parameterize - EXPERIMENT = 'cas7_t0_x4b' + if int(CDATE) >= 2016010101: + TRAPSDIR = "trapsF00" + else: + TRAPSDIR = "traps00" template = self.OCNINTMPL - # fdate = f"f{CDATE[0:4]}.{CDATE[4:6]}.{CDATE[6:8]}" fdate = util.lo_date(CDATE) prevdate = util.ndate(CDATE, -1) fprevdate = util.lo_date(prevdate) - self.OUTDIR = f"{COMROT}/LO_roms/{EXPERIMENT}/{fdate}" + self.OUTDIR = f"{COMROT}/LO_roms/{EXPNAME}/{fdate}" - print(f'In __make_oceanin_lo: {self.OUTDIR}') + if debug: + print(f'self.OUTDIR: {self.OUTDIR}') + print(f'self.COMROT: {self.COMROT}') if not os.path.exists(self.OUTDIR): os.makedirs(self.OUTDIR) - self.ININAME = f"{COMROT}/LO_roms/{EXPERIMENT}/{fprevdate}/ocean_rst.nc" + self.ININAME = f"{COMROT}/LO_roms/{EXPNAME}/{fprevdate}/ocean_rst.nc" DSTART = util.ndays(CDATE, self.TIME_REF) # DSTART = days from TIME_REF to start of forecast day @@ -224,10 +235,11 @@ def __make_oceanin_lo(self): "__FDATE__": fdate, "__ININAME__": self.ININAME, "__COMROT__": COMROT, - "__SAVE__": self.SAVE + "__SAVE__": self.SAVE, + "__TRAPSDIR__" : TRAPSDIR } - # Create the ocean.in + # Create the ocean.in, decompose NTILEI x NTILEJ outfile = f"{self.OUTDIR}/liveocean.in" ratio = 0.5 # ratio=0.375 # Testing 6 nodes (9x24) crashes, .444 crashes (12x18) @@ -339,8 +351,8 @@ def __make_oceanin_wrfroms(self): self.NHOURS = int(int(self.NTIMES)/DT) # TODO: FIX THIS. It does not come out right for wrfroms - # DSTART = 2064.25d0 ! days - # TIDE_START = 0.0d0 ! days + # DSTART = 2064.25d0 ! days + # TIDE_START = 0.0d0 ! days # "CDATE": "20110827", # "HH": "06", # "TIME_REF": "20060101.0d0", @@ -476,6 +488,5 @@ def __make_wrfin(self): return - if __name__ == '__main__': pass diff --git a/cloudflow/job/jobs/cora.reanalysis b/cloudflow/job/jobs/cora.reanalysis new file mode 100644 index 0000000..2cb42e9 --- /dev/null +++ b/cloudflow/job/jobs/cora.reanalysis @@ -0,0 +1,15 @@ +{ + "JOBTYPE" : "adcircreanalysis", + "OFS" : "adcirc-cora", + "YYYY" : "2018", + "BUCKET" : "", + "BCKTFLDR" : "", + "OUTDIR" : "", + "ProjectName" : "Reanalysis-test", + "ProjectHome" : "/save/ec2-user/cora-runs/ADCIRC", + "ADCIRCHome" : "/save/ec2-user/adcirc/work", + "CONFIG" : "/save/ec2-user/cora-runs/ADCIRC/configs/ec95d_prior_config.yml", + "CONFIGTMPL" : "/save/ec2-user/Cloud-Sandbox/cloudflow/job/templates/ec95d_prior_config.in", + "contact" : "notme@my.com", + "WRITERCORES" : "4" +} diff --git a/cloudflow/job/jobs/liveocean.cas7_t0_x4b.hindcast b/cloudflow/job/jobs/liveocean.cas7_t0_x4b.hindcast index 2c5cfe8..b14ad3e 100644 --- a/cloudflow/job/jobs/liveocean.cas7_t0_x4b.hindcast +++ b/cloudflow/job/jobs/liveocean.cas7_t0_x4b.hindcast @@ -1,6 +1,7 @@ { "JOBTYPE" : "romshindcast", "OFS" : "liveocean", + "EXPNAME" : "cas7_t0_x4b", "CDATE" : "20121008", "SDATE" : "20121008", "EDATE" : "20121009", diff --git a/cloudflow/job/jobs/liveocean.cas7_t0_x4b.hindcast.dt25 b/cloudflow/job/jobs/liveocean.cas7_t0_x4b.hindcast.dt25 new file mode 100644 index 0000000..a930ffd --- /dev/null +++ b/cloudflow/job/jobs/liveocean.cas7_t0_x4b.hindcast.dt25 @@ -0,0 +1,21 @@ +{ + "JOBTYPE" : "romshindcast", + "OFS" : "liveocean", + "EXPNAME" : "cas7_t0_x4b", + "CDATE" : "20160101", + "SDATE" : "20160101", + "EDATE" : "20160101", + "HH" : "00", + "COMROT" : "/com/ec2-user", + "SAVE" : "/save/ec2-user", + "PTMP" : "/ptmp", + "EXEC" : "", + "TIME_REF" : "19700101", + "BUCKET" : "ioos-cloud-sandbox", + "BCKTFLDR" : "LiveOcean/output", + "NTIMES" : "3456", + "ININAME" : "auto", + "OUTDIR" : "auto", + "OCEANIN" : "auto", + "OCNINTMPL" : "/save/ec2-user/Cloud-Sandbox/cloudflow/job/templates/liveocean.cas7_t0_x4b-dt25.in" +} diff --git a/cloudflow/job/jobs/liveocean.cas7_t0_x4b.hindcast.dt30 b/cloudflow/job/jobs/liveocean.cas7_t0_x4b.hindcast.dt30 index af4d707..9da9be8 100644 --- a/cloudflow/job/jobs/liveocean.cas7_t0_x4b.hindcast.dt30 +++ b/cloudflow/job/jobs/liveocean.cas7_t0_x4b.hindcast.dt30 @@ -1,9 +1,10 @@ { "JOBTYPE" : "romshindcast", "OFS" : "liveocean", - "CDATE" : "20121008", - "SDATE" : "20121008", - "EDATE" : "20121009", + "EXPNAME" : "cas7_t0_x4b", + "CDATE" : "20160101", + "SDATE" : "20160101", + "EDATE" : "20201231", "HH" : "00", "COMROT" : "/com/ec2-user", "SAVE" : "/save/ec2-user", diff --git a/cloudflow/job/jobs/test.cora.reanalysis b/cloudflow/job/jobs/test.cora.reanalysis new file mode 100644 index 0000000..b538258 --- /dev/null +++ b/cloudflow/job/jobs/test.cora.reanalysis @@ -0,0 +1,15 @@ +{ + "JOBTYPE" : "adcircreanalysis", + "OFS" : "adcirc-cora", + "YYYY" : "2018", + "BUCKET" : "", + "BCKTFLDR" : "", + "OUTDIR" : "", + "ProjectName" : "Reanalysis-test", + "ProjectHome" : "/save/patrick/cora-runs/ADCIRC", + "ADCIRCHome" : "/save/patrick/adcirc/work", + "CONFIG" : "/save/patrick/cora-runs/ADCIRC/configs/ec95d_prior_config.yml", + "CONFIGTMPL" : "/save/patrick/forPR.Cloud-Sandbox/cloudflow/job/templates/ec95d_prior_config.in", + "contact" : "notme@my.com", + "WRITERCORES" : "4" +} diff --git a/cloudflow/job/jobs/test.liveocean.cas7_t0_x4b.hindcast b/cloudflow/job/jobs/test.liveocean.cas7_t0_x4b.hindcast new file mode 100644 index 0000000..194eda0 --- /dev/null +++ b/cloudflow/job/jobs/test.liveocean.cas7_t0_x4b.hindcast @@ -0,0 +1,21 @@ +{ + "JOBTYPE" : "romshindcast", + "OFS" : "liveocean", + "EXPNAME" : "cas7_t0_x4b", + "CDATE" : "20121008", + "SDATE" : "20121008", + "EDATE" : "20121009", + "HH" : "00", + "COMROT" : "/com/patrick", + "SAVE" : "/save/patrick", + "PTMP" : "/ptmp", + "EXEC" : "", + "TIME_REF" : "19700101", + "BUCKET" : "ioos-cloud-sandbox", + "BCKTFLDR" : "LiveOcean/output", + "NTIMES" : "2160", + "ININAME" : "auto", + "OUTDIR" : "auto", + "OCEANIN" : "auto", + "OCNINTMPL" : "/save/patrick/forPR.Cloud-Sandbox/cloudflow/job/templates/liveocean.cas7_t0_x4b.in" +} diff --git a/cloudflow/job/templates/ec95d_prior_config.in b/cloudflow/job/templates/ec95d_prior_config.in new file mode 100644 index 0000000..5c6d0d3 --- /dev/null +++ b/cloudflow/job/templates/ec95d_prior_config.in @@ -0,0 +1,90 @@ +# Project-level definitions +Main: + ProjectName: __ProjectName__ + ProjectHome: __ProjectHome__ + ADCIRCHome: __ADCIRCHome__ + ExtraTag: "" + Experiment: "prior" + OutputFormat: "netCDF" + # Processing definitions + PackageOnly: 0 + DontPrep: 0 + PrepInSubmit: 1 + # submit run to scheduler + Submit: 1 + # invokes a cleanup script in BinDir/cleanup.sh + CleanUpDoneRuns: 0 + CleanUpOnly: 0 + # assumes grid already decomposed (deprecated) + AssumeDecomp: 0 + ClobberRuns: 0 + +netCDF: + title: "GECtestruns" + institution: "RPS" + source: "IOOS SB" + history: "none" + references: "tbd" + convention: "CF-UGRID_0.90" + #contact: "patrick.tripp@tetratech.com" + contact: __contact__ + #basedate replaced at runtime + basedate: "TBD" + +## ADCIRC/SWAN grid definition (files must be in $GridDir) +Grid: + Name: "ec95d" + NameAbbrev: "ec95d" + Extension: "14" + +MetSource: + Model: "ERA5" + +Fort15: + # 568 # | 568 etc... + IHOT: "0" + SpinupLength: "31.0" # days + # NTIP if true, compute tidal potential nodal/equilibrium values, + # expects as a tag in template file. If false, + # assumes the template fort.15 file takes care of tidal potential. + NTIP: true + # NBFR if true, expects to fill and . If false, assumes template file specifies as needed. + NBFR: true + # Winds + NWS: "-12" + # "hbl" | "owi" | "gahm" + WinPreSrc: "owi" + WithBasin: 1 + WithRegion: 0 + BasinPreFile: "fort.221" + BasinWinFile: "fort.222" + RegionPreFile: "fort.223" + RegionWinFile: "fort.224" + IncludeRivers: 0 + #DRAMP: "7. 0.25 0. 0. 7. 7. 1. 0. " + # forcing rampup length, days + DRAMP: 15.0 + # model time step, secs + DT: 15.0 + # use padcswan (1), or not (0) + Coupled: 0 + # Output + StationFile: None + #sets output SPOOLing, secs + GlobalOutputInterval: 3600.0 + LocalOutputInterval: 3600.0 + RNDAY: 400.0 + TOUTSE: 30.958333333333333 + DynWatLevCor: None + +Job: + Manager: cloudflow + NumberOfCores: __NPROCS__ + NumberOfWriterCores: __WRITERCORES__ + Partition: None + ProcessorsPerNode: None + Queue: None + Reservation: None + StatusCommand: None + SubmitCommand: None + WallTime: None diff --git a/cloudflow/job/templates/liveocean.cas7_t0_x4b-dt25.in b/cloudflow/job/templates/liveocean.cas7_t0_x4b-dt25.in new file mode 100644 index 0000000..96391aa --- /dev/null +++ b/cloudflow/job/templates/liveocean.cas7_t0_x4b-dt25.in @@ -0,0 +1,3275 @@ +! +! ROMS/TOMS Standard Input parameters. +! +!svn $Id: roms_upwelling.in 1087 2021-09-10 01:11:17Z arango $ +!========================================================= Hernan G. Arango === +! Copyright (c) 2002-2021 The ROMS/TOMS Group ! +! Licensed under a MIT/X style license ! +! See License_ROMS.txt ! +!============================================================================== +! ! +! Input parameters can be entered in ANY order, provided that the parameter ! +! KEYWORD (usually, upper case) is typed correctly followed by "=" or "==" ! +! symbols. Any comment lines are allowed and must begin with an exclamation ! +! mark (!) in column one. Comments may appear to the right of a parameter ! +! specification to improve documentation. Comments are ignored during ! +! reading. Blank lines are also allowed and ignored. Continuation lines in ! +! a parameter specification are allowed if preceded by a backslash (\). In ! +! some instances, more than one value is required for a parameter. If fewer ! +! values are provided, the last value is assigned for the entire parameter ! +! array. The multiplication symbol (*), without blank spaces in between, ! +! is allowed for a parameter specification. For example, in two grids nested ! +! application: ! +! ! +! AKT_BAK == 2*1.0d-6 2*5.0d-6 ! m2/s ! +! ! +! indicates that the first two entries of array AKT_BAK, in fortran column- ! +! major order, will have the same value of "1.0d-6" for grid 1, whereas the ! +! next two entries will have the same value of "5.0d-6" for grid 2. ! +! ! +! In multiple levels of nesting or multiple connected domains step-ups, ! +! "Ngrids" entries are expected for some of these parameters. In such case, ! +! the order of the entries for a parameter is critical. It must follow the ! +! same order (1:Ngrids) as in the state variable declaration. The USER may ! +! follow the above guidelines for specifying his/her values. These parameters ! +! are marked by "==" plural symbol after the KEYWORD. ! +! ! +! Multiple NetCDF files are allowed for input field(s). It is useful when ! +! splitting input data (climatology, boundary, forcing) time records into ! +! several files (say monthly, annual, etc.). In this case, each multiple ! +! filename entry lines need to end with the vertical bar (|) symbol. For ! +! example: ! +! ! +! NFFILES == 6 ! number of forcing files ! +! ! +! FRCNAME == my_lwrad_year1.nc | ! +! my_lwrad_year2.nc \ ! +! my_swrad_year1.nc | ! +! my_swrad_year2.nc \ ! +! my_winds_year1.nc | ! +! my_winds_year2.nc \ ! +! my_Pair_year1.nc | ! +! my_Pair_year2.nc \ ! +! my_Qair_year1.nc | ! +! my_Qair_year2.nc \ ! +! my_Tair_year1.nc | ! +! my_Tair_year2.nc ! +! ! +! Notice that NFFILES is 6 and not 12. There are 6 uniquely different fields ! +! in the file list, we DO NOT count file entries followed by the vertical ! +! bar symbol. This is because multiple file entries are processed in ROMS ! +! with derived type structures. ! +! ! +!============================================================================== +! +! Application title. + + TITLE = LiveOcean input file + +! C-preprocessing Flag. + + MyAppCPP = X4B + +! Input variable information file name. This file needs to be processed +! first so all information arrays can be initialized properly. + + VARNAME = __SAVE__/LiveOcean/LO_roms_source_git/ROMS/External/varinfo.yaml + +! Number of nested grids. + + Ngrids = 1 + +! Number of grid nesting layers. This parameter is used to allow refinement +! and composite grid combinations. + + NestLayers = 1 + +! Number of grids in each nesting layer [1:NestLayers]. + +GridsInLayer = 1 + +! Grid dimension parameters. See notes below in the Glossary for how to set +! these parameters correctly. + + Lm == 661 ! Number of I-direction INTERIOR RHO-points + Mm == 1300 ! Number of J-direction INTERIOR RHO-points + N == 30 ! Number of vertical levels + + Nbed = 0 ! Number of sediment bed layers + + NAT = 2 ! Number of active tracers (usually, 2) + NPT = 0 ! Number of inactive passive tracers + NCS = 0 ! Number of cohesive (mud) sediment tracers + NNS = 0 ! Number of non-cohesive (sand) sediment tracers + +! Domain decomposition parameters for serial, distributed-memory or +! shared-memory configurations used to determine tile horizontal range +! indices (Istr,Iend) and (Jstr,Jend), [1:Ngrids]. + + NtileI == __NTILEI__ + NtileJ == __NTILEJ__ + +! NtileI == 10 ! I-direction partition +! NtileJ == 20 ! J-direction partition + +! Set horizontal and vertical advection schemes for active and inert +! tracers. A different advection scheme is allowed for each tracer. +! For example, a positive-definite (monotonic) algorithm can be activated +! for salinity and inert tracers, while a different one is set for +! temperature. [1:NAT+NPT,Ngrids] values are expected. +! +! Keyword Advection Algorithm +! +! A4 4th-order Akima (horizontal/vertical) +! C2 2nd-order centered differences (horizontal/vertical) +! C4 4th-order centered differences (horizontal/vertical) +! HSIMT 3th-order HSIMT-TVD (horizontal/vertical) +! MPDATA recursive flux corrected MPDATA (horizontal/vertical) +! SPLINES parabolic splines (only vertical) +! SU3 split third-order upstream (horizontal/vertical) +! U3 3rd-order upstream-biased (only horizontal) +! +! The user has the option of specifying the full Keyword or the first +! two letters, regardless if using uppercase or lowercase. If nested +! grids, specify values for each grid (see glossary below). + + Hadvection == MPDATA \ ! temperature + MPDATA ! salinity + + Vadvection == MPDATA \ ! temperature + MPDATA ! salinity + +! Adjoint-based algorithms can have different horizontal and schemes +! for active and inert tracers. + +ad_Hadvection == U3 \ ! temperature + U3 ! salinity + +ad_Vadvection == C4 \ ! temperature + C4 ! salinity + +! Set lateral boundary conditions keyword. Notice that a value is expected +! for each boundary segment per nested grid for each state variable. +! +! Each tracer variable requires [1:4,1:NAT+NPT,Ngrids] values. Otherwise, +! [1:4,1:Ngrids] values are expected for other variables. The boundary +! order is: 1=west, 2=south, 3=east, and 4=north. That is, anticlockwise +! starting at the western boundary. +! +! The keyword is case insensitive and usually has three characters. However, +! it is possible to have compound keywords, if applicable. For example, the +! keyword "RadNud" implies radiation boundary condition with nudging. This +! combination is usually used in active/passive radiation conditions. +! +! Keyword Lateral Boundary Condition Type +! +! Cha Chapman_implicit (free-surface) +! Che Chapman_explicit (free-surface) +! Cla Clamped +! Clo Closed +! Fla Flather (2D momentum) _____N_____ j=Mm +! Gra Gradient | 4 | +! Nes Nested (refinement) | | +! Nud Nudging 1 W E 3 +! Per Periodic | | +! Rad Radiation |_____S_____| +! Red Reduced Physics (2D momentum) 2 j=1 +! Shc Shchepetkin (2D momentum) i=1 i=Lm +! +! W S E N +! e o a o +! s u s r +! t t t t +! h h +! +! 1 2 3 4 + + LBC(isFsur) == Cha Cha Clo Cha ! free-surface + LBC(isUbar) == Fla Fla Clo Fla ! 2D U-momentum + LBC(isVbar) == Fla Fla Clo Fla ! 2D V-momentum + LBC(isUvel) == RadNud RadNud Clo RadNud ! 3D U-momentum + LBC(isVvel) == RadNud RadNud Clo RadNud ! 3D V-momentum + LBC(isMtke) == RadNud RadNud Clo RadNud ! mixing TKE + + LBC(isTvar) == RadNud RadNud Clo RadNud \ ! temperature + RadNud RadNud Clo RadNud ! salinity + +! Adjoint-based algorithms can have different lateral boundary +! conditions keywords. + +ad_LBC(isFsur) == Per Clo Per Clo ! free-surface +ad_LBC(isUbar) == Per Clo Per Clo ! 2D U-momentum +ad_LBC(isVbar) == Per Clo Per Clo ! 2D V-momentum +ad_LBC(isUvel) == Per Clo Per Clo ! 3D U-momentum +ad_LBC(isVvel) == Per Clo Per Clo ! 3D V-momentum +ad_LBC(isMtke) == Per Clo Per Clo ! mixing TKE + +ad_LBC(isTvar) == Per Clo Per Clo \ ! temperature + Per Clo Per Clo ! salinity + +! Set lateral open boundary edge volume conservation switch for +! nonlinear model and adjoint-based algorithms. Usually activated +! with radiation boundary conditions to enforce global mass +! conservation, except if tidal forcing is enabled. [1:Ngrids]. + + VolCons(west) == F ! western boundary + VolCons(east) == F ! eastern boundary + VolCons(south) == F ! southern boundary + VolCons(north) == F ! northern boundary + +ad_VolCons(west) == F ! western boundary +ad_VolCons(east) == F ! eastern boundary +ad_VolCons(south) == F ! southern boundary +ad_VolCons(north) == F ! northern boundary + +! Time-Stepping parameters. + + NTIMES == __NTIMES__ +! NTIMES == 3456 + DT == 25.0d0 + NDTFAST == 20 + +! Number of timesteps for computing observation impacts during the +! analysis-forecast cycle. + + NTIMES_ANA == 1440 ! analysis interval + NTIMES_FCT == 1440 ! forecast interval + +! Model iteration loops parameters. + + ERstr = 1 + ERend = 1 + Nouter = 1 + Ninner = 1 + Nsaddle = 1 + Nintervals = 1 + +! Number of eigenvalues (NEV) and eigenvectors (NCV) to compute for the +! Lanczos/Arnoldi problem in the Generalized Stability Theory (GST) +! analysis. NCV must be greater than NEV (see documentation below). + + NEV = 2 ! Number of eigenvalues + NCV = 10 ! Number of eigenvectors + +! Input/Output parameters. + + NRREC == -1 + LcycleRST == T + NRST == __NTIMES__ + NSTA == 1 + NFLT == 1 + NINFO == 144 + +! Output history, quicksave, average, and diagnostic files parameters. + +! his_interval is 3600 ( one day ) + LDEFOUT == T + NHIS == 144 + NDEFHIS == 144 + NQCK == 0 + NDEFQCK == 0 + NTSAVG == 1 + NAVG == 90 + NDEFAVG == 90 + NTSDIA == 1 + NDIA == 90 + NDEFDIA == 90 + +! Output tangent linear and adjoint models parameters. + + LcycleTLM == F + NTLM == 72 + NDEFTLM == 0 + LcycleADJ == F + NADJ == 72 + NDEFADJ == 0 + NSFF == 72 + NOBC == 72 + +! GST output and check pointing restart parameters. + + LmultiGST = F ! one eigenvector per file + LrstGST = F ! GST restart switch + MaxIterGST = 500 ! maximum number of iterations + NGST = 10 ! check pointing interval + +! Relative accuracy of the Ritz values computed in the GST analysis. + + Ritz_tol = 1.0d-15 + +! Harmonic/biharmonic horizontal diffusion of tracer for nonlinear model +! and adjoint-based algorithms: [1:NAT+NPT,Ngrids]. + + TNU2 == 2*0.0d0 ! m2/s + TNU4 == 2*0.0d0 ! m4/s + + ad_TNU2 == 0.0d0 0.0d0 ! m2/s + ad_TNU4 == 0.0d0 0.0d0 ! m4/s + +! Harmonic/biharmonic, horizontal viscosity coefficient for nonlinear model +! and adjoint-based algorithms: [Ngrids]. + + VISC2 == 0.0d0 ! m2/s + VISC4 == 0.0d0 ! m4/s + + ad_VISC2 == 0.0d0 ! m2/s + ad_VISC4 == 0.0d0 ! m4/s + +! Logical switches (TRUE/FALSE) to increase/decrease horizontal viscosity +! and/or diffusivity in specific areas of the application domain (like +! sponge areas) for the desired application grid. + + LuvSponge == F ! horizontal momentum +LtracerSponge == F F ! temperature, salinity, inert + +! Vertical mixing coefficients for tracers in nonlinear model and +! basic state scale factor in adjoint-based algorithms: [1:NAT+NPT,Ngrids] + + AKT_BAK == 2*5.0d-6 ! m2/s + + ad_AKT_fac == 1.0d0 1.0d0 ! nondimensional + +! Vertical mixing coefficient for momentum for nonlinear model and +! basic state scale factor in adjoint-based algorithms: [Ngrids]. + + AKV_BAK == 5.0d-6 ! m2/s + + ad_AKV_fac == 1.0d0 ! nondimensional + +! Upper threshold values to limit vertical mixing coefficients computed +! from vertical mixing parameterizations. Although this is an engineering +! fix, the vertical mixing values inferred from ocean observations are +! rarely higher than this upper limit value. + + AKT_LIMIT == 1.0d-3 1.0d-3 ! m2/s + + AKV_LIMIT == 1.0d-3 ! m2/s + +! Turbulent closure parameters. + + AKK_BAK == 5.0d-6 ! m2/s + AKP_BAK == 5.0d-6 ! m2/s + TKENU2 == 0.0d0 ! m2/s + TKENU4 == 0.0d0 ! m4/s + +! Generic length-scale turbulence closure parameters. + + GLS_P == 3.0d0 ! K-epsilon + GLS_M == 1.5d0 + GLS_N == -1.0d0 + GLS_Kmin == 7.6d-6 + GLS_Pmin == 1.0d-12 + + GLS_CMU0 == 0.5477d0 + GLS_C1 == 1.44d0 + GLS_C2 == 1.92d0 + GLS_C3M == -0.4d0 + GLS_C3P == 1.0d0 + GLS_SIGK == 1.0d0 + GLS_SIGP == 1.30d0 + +! Constants used in surface turbulent kinetic energy flux computation. + + CHARNOK_ALPHA == 1400.0d0 ! Charnok surface roughness + ZOS_HSIG_ALPHA == 0.5d0 ! roughness from wave amplitude + SZ_ALPHA == 0.25d0 ! roughness from wave dissipation + CRGBAN_CW == 100.0d0 ! Craig and Banner wave breaking + +! Constants used in momentum stress computation. + + RDRG == 3.0d-04 ! m/s + RDRG2 == 3.0d-03 ! nondimensional + Zob == 0.02d0 ! m + Zos == 0.02d0 ! m + +! Height (m) of atmospheric measurements for Bulk fluxes parameterization. + + BLK_ZQ == 2.0d0 ! air humidity + BLK_ZT == 2.0d0 ! air temperature + BLK_ZW == 10.0d0 ! winds + +! Minimum depth for wetting and drying. + + DCRIT == 0.10d0 ! m + +! Various parameters. + + WTYPE == 5 + LEVSFRC == 15 + LEVBFRC == 1 + +! Set vertical, terrain-following coordinates transformation equation and +! stretching function (see below for details), [1:Ngrids]. + + Vtransform == 2 ! transformation equation + Vstretching == 4 ! stretching function + +! Vertical S-coordinates parameters (see below for details), [1:Ngrids]. + + THETA_S == 4.0d0 ! surface stretching parameter + THETA_B == 2.0d0 ! bottom stretching parameter + TCLINE == 10.0d0 ! critical depth (m) + +! Mean Density and Brunt-Vaisala frequency. + + RHO0 = 1023.7d0 ! kg/m3 + BVF_BAK = 1.0d-5 ! 1/s2 + +! If tide generating forces, set switch (T/F) to apply a 18.6-year lunar +! nodal correction to equilibrium tide constituents. + + Lnodal = T + +! Time-stamp assigned for model initialization, reference time +! origin for tidal forcing, and model reference time for output +! NetCDF units attribute. + +! DSTART = 15622.0d0 ! days + DSTART = __DSTART__ + + TIDE_START = 8035.0d0 ! days +! PM Note: TIDE_START is days from TIME_REF to 1/1/1992 + TIME_REF = 19700101.0d0 ! yyyymmdd.dd + +! Nudging/relaxation time scales, inverse scales will be computed +! internally, [1:Ngrids]. + + TNUDG == 3.0d0 3.0d0 ! days + ZNUDG == 3.0d0 ! days + M2NUDG == 3.0d0 ! days + M3NUDG == 3.0d0 ! days + +! Factor between passive (outflow) and active (inflow) open boundary +! conditions, [1:Ngrids]. If OBCFAC > 1, nudging on inflow is stronger +! than on outflow (recommended). + + OBCFAC == 4.0d0 ! nondimensional + +! Linear equation of State parameters: + + R0 == 1027.0d0 ! kg/m3 + T0 == 14.0d0 ! Celsius + S0 == 35.0d0 ! nondimensional + TCOEF == 1.7d-4 ! 1/Celsius + SCOEF == 0.0d0 ! nondimensional + +! Slipperiness parameter: 1.0 (free slip) or -1.0 (no slip) + + GAMMA2 == -1.0d0 + +! Logical switches (TRUE/FALSE) to activate horizontal momentum transport +! point Sources/Sinks (like river runoff transport) and mass point +! Sources/Sinks (like volume vertical influx), [1:Ngrids]. + + LuvSrc == T ! horizontal momentum transport + LwSrc == T ! volume vertical influx + +! Logical switches (TRUE/FALSE) to activate tracers point Sources/Sinks +! (like river runoff) and to specify which tracer variables to consider: +! [1:NAT+NPT,Ngrids]. See glossary below for details. + + LtracerSrc == T T ! temperature, salinity, inert + +! Logical switches (TRUE/FALSE) to read and process climatology fields. +! See glossary below for details. + + LsshCLM == T ! sea-surface height + Lm2CLM == T ! 2D momentum + Lm3CLM == T ! 3D momentum + + LtracerCLM == T T ! temperature, salinity, inert + +! Logical switches (TRUE/FALSE) to nudge the desired climatology field(s). +! If not analytical climatology fields, users need to turn ON the logical +! switches above to process the fields from the climatology NetCDF file +! that are needed for nudging. See glossary below for details. + + LnudgeM2CLM == T ! 2D momentum + LnudgeM3CLM == T ! 3D momentum + + LnudgeTCLM == T T ! temperature, salinity, inert + +! Starting (DstrS) and ending (DendS) day for adjoint sensitivity forcing. +! DstrS must be less or equal to DendS. If both values are zero, their +! values are reset internally to the full range of the adjoint integration. + + DstrS == 0.0d0 ! starting day + DendS == 0.0d0 ! ending day + +! Starting and ending vertical levels of the 3D adjoint state variables +! whose sensitivity is required. + + KstrS == 1 ! starting level + KendS == 1 ! ending level + +! Logical switches (TRUE/FALSE) to specify the adjoint state variables +! whose sensitivity is required. + +Lstate(isFsur) == F ! free-surface +Lstate(isUbar) == F ! 2D U-momentum +Lstate(isVbar) == F ! 2D V-momentum +Lstate(isUvel) == F ! 3D U-momentum +Lstate(isVvel) == F ! 3D V-momentum +Lstate(isWvel) == F ! 3D W-momentum + +Lstate(isTvar) == F F ! NT tracers + +! Logical switches (TRUE/FALSE) to specify the state variables for +! which Forcing Singular Vectors or Stochastic Optimals is required. + +Fstate(isFsur) == F ! free-surface +Fstate(isUbar) == F ! 2D U-momentum +Fstate(isVbar) == F ! 2D V-momentum +Fstate(isUvel) == F ! 3D U-momentum +Fstate(isVvel) == F ! 3D V-momentum +Fstate(isTvar) == F F ! NT tracers + +Fstate(isUstr) == T ! surface U-stress +Fstate(isVstr) == T ! surface V-stress +Fstate(isTsur) == F F ! NT surface tracers flux + +! Stochastic Optimals time decorrelation scale (days) assumed for +! red noise processes. + + SO_decay == 2.0d0 ! days + +! Stochastic Optimals surface forcing standard deviation for +! dimensionalization. + +SO_sdev(isFsur) == 1.0d0 ! free-surface +SO_sdev(isUbar) == 1.0d0 ! 2D U-momentum +SO_sdev(isVbar) == 1.0d0 ! 2D V-momentum +SO_sdev(isUvel) == 1.0d0 ! 3D U-momentum +SO_sdev(isVvel) == 1.0d0 ! 3D V-momentum +SO_sdev(isTvar) == 1.0d0 1.0d0 ! NT tracers + +SO_sdev(isUstr) == 1.0d0 ! surface U-stress +SO_sdev(isVstr) == 1.0d0 ! surface V-stress +SO_sdev(isTsur) == 1.0d0 1.0d0 ! NT surface tracers flux + +! Logical switches (TRUE/FALSE) to activate writing of fields into +! HISTORY output file. + +Hout(idUvel) == T ! u 3D U-velocity +Hout(idVvel) == T ! v 3D V-velocity +Hout(idu3dE) == F ! u_eastward 3D U-eastward at RHO-points +Hout(idv3dN) == F ! v_northward 3D V-northward at RHO-points +Hout(idWvel) == T ! w 3D W-velocity +Hout(idOvel) == F ! omega omega vertical velocity +Hout(idUbar) == T ! ubar 2D U-velocity +Hout(idVbar) == T ! vbar 2D V-velocity +Hout(idu2dE) == F ! ubar_eastward 2D U-eastward at RHO-points +Hout(idv2dN) == F ! vbar_northward 2D V-northward at RHO-points +Hout(idFsur) == T ! zeta free-surface +Hout(idBath) == F ! bath time-dependent bathymetry + +Hout(idTvar) == T T ! temp, salt temperature and salinity + +Hout(idpthR) == F ! z_rho time-varying depths of RHO-points +Hout(idpthU) == F ! z_u time-varying depths of U-points +Hout(idpthV) == F ! z_v time-varying depths of V-points +Hout(idpthW) == F ! z_w time-varying depths of W-points + +Hout(idUsms) == T ! sustr surface U-stress +Hout(idVsms) == T ! svstr surface V-stress +Hout(idUbms) == T ! bustr bottom U-stress +Hout(idVbms) == T ! bvstr bottom V-stress + +Hout(idUbrs) == F ! bustrc bottom U-current stress +Hout(idVbrs) == F ! bvstrc bottom V-current stress +Hout(idUbws) == F ! bustrw bottom U-wave stress +Hout(idVbws) == F ! bvstrw bottom V-wave stress +Hout(idUbcs) == F ! bustrcwmax bottom max wave-current U-stress +Hout(idVbcs) == F ! bvstrcwmax bottom max wave-current V-stress + +Hout(idUbot) == F ! Ubot bed wave orbital U-velocity +Hout(idVbot) == F ! Vbot bed wave orbital V-velocity +Hout(idUbur) == F ! Ur bottom U-velocity above bed +Hout(idVbvr) == F ! Vr bottom V-velocity above bed + +Hout(idW2xx) == F ! Sxx_bar 2D radiation stress, Sxx component +Hout(idW2xy) == F ! Sxy_bar 2D radiation stress, Sxy component +Hout(idW2yy) == F ! Syy_bar 2D radiation stress, Syy component +Hout(idU2rs) == F ! Ubar_Rstress 2D radiation U-stress +Hout(idV2rs) == F ! Vbar_Rstress 2D radiation V-stress +Hout(idU2Sd) == F ! ubar_stokes 2D U-Stokes velocity +Hout(idV2Sd) == F ! vbar_stokes 2D V-Stokes velocity + +Hout(idW3xx) == F ! Sxx 3D radiation stress, Sxx component +Hout(idW3xy) == F ! Sxy 3D radiation stress, Sxy component +Hout(idW3yy) == F ! Syy 3D radiation stress, Syy component +Hout(idW3zx) == F ! Szx 3D radiation stress, Szx component +Hout(idW3zy) == F ! Szy 3D radiation stress, Szy component +Hout(idU3rs) == F ! u_Rstress 3D U-radiation stress +Hout(idV3rs) == F ! v_Rstress 3D V-radiation stress +Hout(idU3Sd) == F ! u_stokes 3D U-Stokes velocity +Hout(idV3Sd) == F ! v_stokes 3D V-Stokes velocity + +Hout(idWamp) == F ! Hwave wave height +Hout(idWlen) == F ! Lwave wave length +Hout(idWdir) == F ! Dwave wave direction +Hout(idWptp) == F ! Pwave_top wave surface period +Hout(idWpbt) == F ! Pwave_bot wave bottom period +Hout(idWorb) == F ! Ub_swan wave bottom orbital velocity +Hout(idWdis) == F ! Wave_dissip wave dissipation + +Hout(idPair) == T ! Pair surface air pressure +Hout(idTair) == T ! Tair surface air temperature +Hout(idUair) == T ! Uair surface U-wind component +Hout(idVair) == T ! Vair surface V-wind component + +Hout(idTsur) == T T ! shflux, ssflux surface net heat and salt flux +Hout(idLhea) == T ! latent latent heat flux +Hout(idShea) == T ! sensible sensible heat flux +Hout(idLrad) == T ! lwrad longwave radiation flux +Hout(idSrad) == T ! swrad shortwave radiation flux +Hout(idEmPf) == T ! EminusP E-P flux +Hout(idevap) == T ! evaporation evaporation rate +Hout(idrain) == T ! rain precipitation rate + +Hout(idDano) == F ! rho density anomaly +Hout(idVvis) == T ! AKv vertical viscosity +Hout(idTdif) == F ! AKt vertical T-diffusion +Hout(idSdif) == T ! AKs vertical Salinity diffusion +Hout(idHsbl) == F ! Hsbl depth of surface boundary layer +Hout(idHbbl) == F ! Hbbl depth of bottom boundary layer +Hout(idMtke) == F ! tke turbulent kinetic energy +Hout(idMtls) == F ! gls turbulent length scale + +! Logical switches (TRUE/FALSE) to activate writing of extra inert passive +! tracers other than biological and sediment tracers into the HISTORY +! output file. An inert passive tracer is one that it is only advected and +! diffused. Other processes are ignored. These tracers include, for example, +! dyes, pollutants, oil spills, etc. NPT values are expected. However, these +! switches can be activated using compact parameter specification. + + Hout(inert) == F ! dye_01, ... inert passive tracers + +! Logical switches (TRUE/FALSE) to activate writing of fields into +! QUICKSAVE output file. + +Qout(idUvel) == F ! u 3D U-velocity +Qout(idVvel) == F ! v 3D V-velocity +Qout(idu3dE) == F ! u_eastward 3D U-eastward at RHO-points +Qout(idv3dN) == F ! v_northward 3D V-northward at RHO-points +Qout(idWvel) == F ! w 3D W-velocity +Qout(idOvel) == F ! omega omega vertical velocity +Qout(idUbar) == T ! ubar 2D U-velocity +Qout(idVbar) == T ! vbar 2D V-velocity +Qout(idu2dE) == T ! ubar_eastward 2D U-eastward at RHO-points +Qout(idv2dN) == T ! vbar_northward 2D V-northward at RHO-points +Qout(idFsur) == T ! zeta free-surface +Qout(idBath) == T ! bath time-dependent bathymetry + +Qout(idTvar) == F F ! temp, salt temperature and salinity + +Qout(idUsur) == T ! u_sur surface U-velocity +Qout(idVsur) == T ! v_sur surface V-velocity +Qout(idUsuE) == T ! u_sur_eastward surface U-eastward velocity +Qout(idVsuN) == T ! v_sur_northward surface V-northward velocity + +Qout(idsurT) == T T ! temp_sur, salt_sur surface temperature and salinity + +Qout(idpthR) == F ! z_rho time-varying depths of RHO-points +Qout(idpthU) == F ! z_u time-varying depths of U-points +Qout(idpthV) == F ! z_v time-varying depths of V-points +Qout(idpthW) == F ! z_w time-varying depths of W-points + +Qout(idUsms) == F ! sustr surface U-stress +Qout(idVsms) == F ! svstr surface V-stress +Qout(idUbms) == F ! bustr bottom U-stress +Qout(idVbms) == F ! bvstr bottom V-stress + +Qout(idUbrs) == F ! bustrc bottom U-current stress +Qout(idVbrs) == F ! bvstrc bottom V-current stress +Qout(idUbws) == F ! bustrw bottom U-wave stress +Qout(idVbws) == F ! bvstrw bottom V-wave stress +Qout(idUbcs) == F ! bustrcwmax bottom max wave-current U-stress +Qout(idVbcs) == F ! bvstrcwmax bottom max wave-current V-stress + +Qout(idUbot) == F ! Ubot bed wave orbital U-velocity +Qout(idVbot) == F ! Vbot bed wave orbital V-velocity +Qout(idUbur) == F ! Ur bottom U-velocity above bed +Qout(idVbvr) == F ! Vr bottom V-velocity above bed + +Qout(idW2xx) == F ! Sxx_bar 2D radiation stress, Sxx component +Qout(idW2xy) == F ! Sxy_bar 2D radiation stress, Sxy component +Qout(idW2yy) == F ! Syy_bar 2D radiation stress, Syy component +Qout(idU2rs) == F ! Ubar_Rstress 2D radiation U-stress +Qout(idV2rs) == F ! Vbar_Rstress 2D radiation V-stress +Qout(idU2Sd) == F ! ubar_stokes 2D U-Stokes velocity +Qout(idV2Sd) == F ! vbar_stokes 2D V-Stokes velocity + +Qout(idW3xx) == F ! Sxx 3D radiation stress, Sxx component +Qout(idW3xy) == F ! Sxy 3D radiation stress, Sxy component +Qout(idW3yy) == F ! Syy 3D radiation stress, Syy component +Qout(idW3zx) == F ! Szx 3D radiation stress, Szx component +Qout(idW3zy) == F ! Szy 3D radiation stress, Szy component +Qout(idU3rs) == F ! u_Rstress 3D U-radiation stress +Qout(idV3rs) == F ! v_Rstress 3D V-radiation stress +Qout(idU3Sd) == F ! u_stokes 3D U-Stokes velocity +Qout(idV3Sd) == F ! v_stokes 3D V-Stokes velocity + +Qout(idWamp) == F ! Hwave wave height +Qout(idWlen) == F ! Lwave wave length +Qout(idWdir) == F ! Dwave wave direction +Qout(idWptp) == F ! Pwave_top wave surface period +Qout(idWpbt) == F ! Pwave_bot wave bottom period +Qout(idWorb) == F ! Ub_swan wave bottom orbital velocity +Qout(idWdis) == F ! Wave_dissip wave dissipation + +Qout(idPair) == F ! Pair surface air pressure +Qout(idTair) == F ! Tair surface air temperature +Qout(idUair) == F ! Uair surface U-wind component +Qout(idVair) == F ! Vair surface V-wind component + +Qout(idTsur) == F F ! shflux, ssflux surface net heat and salt flux +Qout(idLhea) == F ! latent latent heat flux +Qout(idShea) == F ! sensible sensible heat flux +Qout(idLrad) == F ! lwrad longwave radiation flux +Qout(idSrad) == F ! swrad shortwave radiation flux +Qout(idEmPf) == F ! EminusP E-P flux +Qout(idevap) == F ! evaporation evaporation rate +Qout(idrain) == F ! rain precipitation rate + +Qout(idDano) == F ! rho density anomaly +Qout(idVvis) == F ! AKv vertical viscosity +Qout(idTdif) == F ! AKt vertical T-diffusion +Qout(idSdif) == F ! AKs vertical Salinity diffusion +Qout(idHsbl) == F ! Hsbl depth of surface boundary layer +Qout(idHbbl) == F ! Hbbl depth of bottom boundary layer +Qout(idMtke) == F ! tke turbulent kinetic energy +Qout(idMtls) == F ! gls turbulent length scale + +! Logical switches (TRUE/FALSE) to activate writing of extra inert passive +! tracers other than biological and sediment tracers into the QUICKSAVE +! output file. An inert passive tracer is one that it is only advected and +! diffused. Other processes are ignored. These tracers include, for example, +! dyes, pollutants, oil spills, etc. NPT values are expected. However, these +! switches can be activated using compact parameter specification. + + Qout(inert) == F ! dye_01, ... inert passive tracers + Qout(Snert) == F ! dye_01_sur, ... surface inert passive tracers + +! Logical switches (TRUE/FALSE) to activate writing of time-averaged +! fields into AVERAGE output file. + +Aout(idUvel) == T ! u 3D U-velocity +Aout(idVvel) == T ! v 3D V-velocity +Aout(idu3dE) == F ! u_eastward 3D U-eastward at RHO-points +Aout(idv3dN) == F ! v_northward 3D V-northward at RHO-points +Aout(idWvel) == T ! w 3D W-velocity +Aout(idOvel) == T ! omega omega vertical velocity +Aout(idUbar) == T ! ubar 2D U-velocity +Aout(idVbar) == T ! vbar 2D V-velocity +Aout(idu2dE) == F ! ubar_eastward 2D U-eastward at RHO-points +Aout(idv2dN) == F ! vbar_northward 2D V-northward at RHO-points +Aout(idFsur) == T ! zeta free-surface + +Aout(idTvar) == T T ! temp, salt temperature and salinity + +Aout(idUsms) == F ! sustr surface U-stress +Aout(idVsms) == F ! svstr surface V-stress +Aout(idUbms) == F ! bustr bottom U-stress +Aout(idVbms) == F ! bvstr bottom V-stress + +Aout(idW2xx) == F ! Sxx_bar 2D radiation stress, Sxx component +Aout(idW2xy) == F ! Sxy_bar 2D radiation stress, Sxy component +Aout(idW2yy) == F ! Syy_bar 2D radiation stress, Syy component +Aout(idU2rs) == F ! Ubar_Rstress 2D radiation U-stress +Aout(idV2rs) == F ! Vbar_Rstress 2D radiation V-stress +Aout(idU2Sd) == F ! ubar_stokes 2D U-Stokes velocity +Aout(idV2Sd) == F ! vbar_stokes 2D V-Stokes velocity + +Aout(idW3xx) == F ! Sxx 3D radiation stress, Sxx component +Aout(idW3xy) == F ! Sxy 3D radiation stress, Sxy component +Aout(idW3yy) == F ! Syy 3D radiation stress, Syy component +Aout(idW3zx) == F ! Szx 3D radiation stress, Szx component +Aout(idW3zy) == F ! Szy 3D radiation stress, Szy component +Aout(idU3rs) == F ! u_Rstress 3D U-radiation stress +Aout(idV3rs) == F ! v_Rstress 3D V-radiation stress +Aout(idU3Sd) == F ! u_stokes 3D U-Stokes velocity +Aout(idV3Sd) == F ! v_stokes 3D V-Stokes velocity + +Aout(idPair) == F ! Pair surface air pressure +Aout(idTair) == F ! Tair surface air temperature +Aout(idUair) == F ! Uair surface U-wind component +Aout(idVair) == F ! Vair surface V-wind component + +Aout(idTsur) == F F ! shflux, ssflux surface net heat and salt flux +Aout(idLhea) == F ! latent latent heat flux +Aout(idShea) == F ! sensible sensible heat flux +Aout(idLrad) == F ! lwrad longwave radiation flux +Aout(idSrad) == F ! swrad shortwave radiation flux +Aout(idevap) == F ! evaporation evaporation rate +Aout(idrain) == F ! rain precipitation rate + +Aout(idDano) == F ! rho density anomaly +Aout(idVvis) == F ! AKv vertical viscosity +Aout(idTdif) == F ! AKt vertical T-diffusion +Aout(idSdif) == F ! AKs vertical Salinity diffusion +Aout(idHsbl) == F ! Hsbl depth of surface boundary layer +Aout(idHbbl) == F ! Hbbl depth of bottom boundary layer + +Aout(id2dRV) == F ! pvorticity_bar 2D relative vorticity +Aout(id3dRV) == F ! pvorticity 3D relative vorticity +Aout(id2dPV) == F ! rvorticity_bar 2D potential vorticity +Aout(id3dPV) == F ! rvorticity 3D potential vorticity + +Aout(idu3dD) == F ! u_detided detided 3D U-velocity +Aout(idv3dD) == F ! v_detided detided 3D V-velocity +Aout(idu2dD) == F ! ubar_detided detided 2D U-velocity +Aout(idv2dD) == F ! vbar_detided detided 2D V-velocity +Aout(idFsuD) == F ! zeta_detided detided free-surface + +Aout(idTrcD) == F F ! temp_detided, ... detided temperature and salinity + +Aout(idHUav) == F ! Huon u-volume flux, Huon +Aout(idHVav) == F ! Hvom v-volume flux, Hvom +Aout(idUUav) == F ! uu quadratic term +Aout(idUVav) == F ! uv quadratic term +Aout(idVVav) == F ! vv quadratic term +Aout(idU2av) == F ! ubar2 quadratic term +Aout(idV2av) == F ! vbar2 quadratic term +Aout(idZZav) == F ! zeta2 quadratic term + +Aout(idTTav) == F F ! temp_2, ... quadratic tracer terms +Aout(idUTav) == F F ! u_temp, ... quadratic tracer terms +Aout(idVTav) == F F ! v_temp, ... quadratic tracer terms +Aout(iHUTav) == F F ! Huon_temp, ... tracer volume flux, +Aout(iHVTav) == F F ! Hvom_temp, ... tracer volume flux, + +! Logical switches (TRUE/FALSE) to activate writing of extra inert passive +! tracers other than biological and sediment tracers into the AVERAGE file. + + Aout(inert) == T ! dye_01, ... inert passive tracers + +! Logical switches (TRUE/FALSE) to activate writing of time-averaged, +! 2D momentum (ubar,vbar) diagnostic terms into DIAGNOSTIC output file. + +Dout(M2rate) == T ! ubar_accel, ... acceleration +Dout(M2pgrd) == T ! ubar_prsgrd, ... pressure gradient +Dout(M2fcor) == T ! ubar_cor, ... Coriolis force +Dout(M2hadv) == T ! ubar_hadv, ... horizontal total advection +Dout(M2xadv) == T ! ubar_xadv, ... horizontal XI-advection +Dout(M2yadv) == T ! ubar_yadv, ... horizontal ETA-advection +Dout(M2hrad) == T ! ubar_hrad, ... horizontal total radiation stress +Dout(M2hvis) == T ! ubar_hvisc, ... horizontal total viscosity +Dout(M2xvis) == T ! ubar_xvisc, ... horizontal XI-viscosity +Dout(M2yvis) == T ! ubar_yvisc, ... horizontal ETA-viscosity +Dout(M2sstr) == T ! ubar_sstr, ... surface stress +Dout(M2bstr) == T ! ubar_bstr, ... bottom stress + +! Logical switches (TRUE/FALSE) to activate writing of time-averaged, +! 3D momentum (u,v) diagnostic terms into DIAGNOSTIC output file. + +Dout(M3rate) == T ! u_accel, ... acceleration +Dout(M3pgrd) == T ! u_prsgrd, ... pressure gradient +Dout(M3fcor) == T ! u_cor, ... Coriolis force +Dout(M3hadv) == T ! u_hadv, ... horizontal total advection +Dout(M3xadv) == T ! u_xadv, ... horizontal XI-advection +Dout(M3yadv) == T ! u_yadv, ... horizontal ETA-advection +Dout(M3vadv) == T ! u_vadv, ... vertical advection +Dout(M3hrad) == T ! u_hrad, ... horizontal total radiation stress +Dout(M3vrad) == T ! u_vrad, ... vertical radiation stress +Dout(M3hvis) == T ! u_hvisc, ... horizontal total viscosity +Dout(M3xvis) == T ! u_xvisc, ... horizontal XI-viscosity +Dout(M3yvis) == T ! u_yvisc, ... horizontal ETA-viscosity +Dout(M3vvis) == T ! u_vvisc, ... vertical viscosity + +! Logical switches (TRUE/FALSE) to activate writing of time-averaged, +! active (temperature and salinity) and passive (inert) tracer diagnostic +! terms into DIAGNOSTIC output file: [1:NAT+NPT,Ngrids]. + +Dout(iTrate) == T T ! temp_rate, ... time rate of change +Dout(iThadv) == T T ! temp_hadv, ... horizontal total advection +Dout(iTxadv) == T T ! temp_xadv, ... horizontal XI-advection +Dout(iTyadv) == T T ! temp_yadv, ... horizontal ETA-advection +Dout(iTvadv) == T T ! temp_vadv, ... vertical advection +Dout(iThdif) == T T ! temp_hdiff, ... horizontal total diffusion +Dout(iTxdif) == T T ! temp_xdiff, ... horizontal XI-diffusion +Dout(iTydif) == T T ! temp_ydiff, ... horizontal ETA-diffusion +Dout(iTsdif) == T T ! temp_sdiff, ... horizontal S-diffusion +Dout(iTvdif) == T T ! temp_vdiff, ... vertical diffusion + +! Generic User parameters, [1:NUSER]. + + NUSER = 0 + USER = 0.d0 + +! Input and Output files processing library to use: +! +! [1] Standard NetCDF-3 or NetCDF-4 library +! [2] Serial or Parallel I/O with Parallel-IO (PIO) library (MPI only) + + INP_LIB = 1 + OUT_LIB = 1 + +! PIO library methods for reading/writing NetCDF files: +! +! [0] parallel read and write of PnetCDF (CDF-5, not recommended) +! [1] parallel read and write of NetCDF3 (64-bit offset) +! [2] serial read and write of NetCDF3 (64-bit offset) +! [3] parallel read and serial write of NetCDF4/HDF5 +! [4] parallel read and write of NETCDF4/HDF5 + + PIO_METHOD = 2 + +! PIO library MPI processes set-up: + + PIO_IOTASKS = 1 ! number of I/O tasks to define + PIO_STRIDE = 1 ! stride in the MPI-ran between I/O tasks + PIO_BASE = 0 ! offset for the first I/O task + PIO_AGGREG = 1 ! number of MPI-aggregators to use + +! PIO library rearranger methods for moving data between computational and I/O +! processes: +! +! [1] Box rearrangement +! [2] Subset rearrangement + + PIO_REARR = 1 + +! PIO library rearranger flag for MPI communications between computational +! and I/O processes: +! +! [0] Point-to-Point (low-level communications) +! [1] Collective (high-level grouped communications) + +PIO_REARRCOM = 0 + +! PIO library rearranger flow control direction flag for MPI communications +! between computational and I/O processes: +! +! [0] Enable computational to I/O processes, and vice versa +! [2] Enable computational to I/O processes only +! [3] Enable I/O to computational processes only +! [4] Disable flow control + +PIO_REARRDIR = 0 + +! PIO rearranger options for computational to I/O processes (C2I): + + PIO_C2I_HS = T ! Enable C2I handshake (T/F) +PIO_C2I_Send = T ! Enable C2I Isends (T/F) +PIO_C2I_Preq = 64 ! Maximum pending C2I requests + +! PIO rearranger options for I/O to computational processes (I2C): + + PIO_I2C_HS = T ! Enable I2C handshake (T/F) +PIO_I2C_Send = T ! Enable I2C Isends (T/F) +PIO_I2C_Preq = 65 ! Maximum pending I2C requests + +! If OUT_LIB=1, NetCDF-4/HDF5 compression parameters for output files. + + NC_SHUFFLE = 1 ! if non-zero, turn on shuffle filter + NC_DEFLATE = 1 ! if non-zero, turn on deflate filter + NC_DLEVEL = 1 ! deflate level [0-9] + +! Input NetCDF file names, [1:Ngrids]. + +! GRDNAME == __COMROT__/LO_data/grids/cas7/grid.nc +! ININAME == __COMROT__/LO_roms/cas7_t0_x4b/f2012.10.08/ocean_rst.nc + + GRDNAME == __COMROT__/LO_data/grids/cas7/grid.nc + ININAME == __ININAME__ + ITLNAME == roms_itl.nc + IRPNAME == roms_irp.nc + IADNAME == roms_iad.nc + FWDNAME == roms_fwd.nc + ADSNAME == roms_ads.nc + +! Input adjoint forcing NetCDF filenames for computing observations +! impacts during the analysis-forecast cycle. If the forecast error +! metric is defined in state-space, then FOInameA and FOInameB should +! be regular adjoint forcing files just like ADSname. If the forecast +! error metric is defined in observation space (OBS_SPACE is activated) +! then the forecast is initialized OIFnameA and OIFnameB (specified in +! s4dvar.in input script) will have the structure of a 4D-Var observation +! file. + + FOInameA == roms_foi_a.nc + FOInameB == roms_foi_b.nc + +! Input NetCDF filenames for the forecasts initialized from the analysis +! of the current 4D-Var cycle (FCTnameA) and initialized from the analysis +! of the previous 4D-Var cycle (FCTnameB). + + FCTnameA == roms_fct_a.nc + FCTnameB == roms_fct_b.nc + +! Nesting grids connectivity data: contact points information. This +! NetCDF file is special and complex. It is currently generated using +! the script "matlab/grid/contact.m" from the Matlab repository. + + NGCNAME = roms_ngc.nc + +! Input lateral boundary conditions file names. The USER has the option +! to separate the required lateral boundary variables into individual +! NetCDF files (NBCFILES > 1), as in the input surface forcing. Also, +! the USER may split input data time records into several NetCDF files +! (monthly, seasonal, or annual). See prologue instructions above. Use +! a single line per entry with a continuation (\) or a vertical bar (|) +! symbol after each entry, except the last one. + + NBCFILES == 1 ! number of boundary files + + BRYNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/ocn01/ocean_bry.nc + +! Input climatology file names. The USER has the option to separate the +! climatology variables into individual NetCDF files (NCLMFILES > 1), +! as in the input surface forcing. Also, the USER may split input data +! time records into several NetCDF files (monthly, seasonal, or annual). +! See prologue instructions above. Use a single line per entry with a +! continuation (\) or a vertical bar (|) symbol after each entry, except +! the last one. + + NCLMFILES == 1 ! number of climatology files + + CLMNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/ocn01/ocean_clm.nc + +! Input climatology nudging coefficients file name. + + NUDNAME == __COMROT__/LO_data/grids/cas7/nudgcoef.nc + +! Input Sources/Sinks forcing (like river runoff) file name. + + SSFNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/__TRAPSDIR__/rivers.nc + +! Input tidal forcing file name. + + TIDENAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/tide00/tides.nc + +! Input forcing NetCDF file name(s). +! +! The USER has the option to enter several sets of file names for each +! nested grid. For example, the USER may have different data for the +! wind products, heat fluxes, etc. Alternatively, if the all the forcing +! files are the same for nesting and the data is in its native resolution, +! we could enter only one set of files names and ROMS will replicate those +! files internally to the remaining grids using the plural KEYWORD protocol. +! +! The model will scan the files and will read the needed data from the first +! file in the list containing the forcing field. Therefore, the order of the +! filenames is critical. If using multiple forcing files per grid, first +! enter all the file names for grid one followed by two, and so on. It is +! also possible to split input data time records into several NetCDF files +! (see Prolog instructions above). Use a single line per entry with a +! continuation (\) or a vertical bar (|) symbol after each entry, except +! the last one. + + NFFILES == 8 ! number of unique forcing files + + FRCNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/lwrad_down.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/Pair.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/Qair.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/rain.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/swrad.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/Tair.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/Uwind.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/Vwind.nc + +! Output NetCDF file names, [1:Ngrids]. + + DAINAME == roms_dai.nc + GSTNAME == roms_gst.nc + RSTNAME == __COMROT__/LO_roms/cas7_t0_x4b/__FDATE__/ocean_rst.nc + HISNAME == __COMROT__/LO_roms/cas7_t0_x4b/__FDATE__/ocean_his.nc + QCKNAME == roms_qck.nc + TLMNAME == roms_tlm.nc + TLFNAME == roms_tlf.nc + ADJNAME == roms_adj.nc + AVGNAME == __COMROT__/LO_roms/cas7_t0_x4b/__FDATE__/ocean_avg.nc + HARNAME == roms_har.nc + DIANAME == __COMROT__/LO_roms/cas7_t0_x4b/__FDATE__/ocean_dia.nc + STANAME == roms_sta.nc + FLTNAME == roms_flt.nc + +! Input ASCII parameter filenames. + + APARNAM = __SAVE__/LiveOcean/LO_roms_source_git/ROMS/External/s4dvar.in + SPOSNAM = __SAVE__/LiveOcean/LO_roms_source_git/ROMS/External/stations.in + FPOSNAM = __SAVE__/LiveOcean/LO_roms_source_git/ROMS/External/floats.in + BPARNAM = __COMROT__/LO_roms/cas7_t0_x4b/__FDATE__/bio_Banas.in + SPARNAM = __SAVE__/LiveOcean/LO_roms_source_git/ROMS/External/sediment.in + USRNAME = __SAVE__/LiveOcean/LO_roms_source_git/ROMS/External/MyFile.dat + +! +! GLOSSARY: +! ========= +! +!------------------------------------------------------------------------------ +! Application title (string with a maximum of 80 characters) and +! C-preprocessing flag. +!------------------------------------------------------------------------------ +! +! TITLE Application title. +! +! MyAppCPP Application C-preprocessing option. +! +!------------------------------------------------------------------------------ +! Variable information filename (string with a maximum of 256 characters). +!------------------------------------------------------------------------------ +! +! VARNAME Input/Output variable information filename. This file needs to +! be processed first so all information arrays and indices can +! be initialized properly in "mod_ncparam.F". +! +!------------------------------------------------------------------------------ +! Nested grid parameters (processing order of these parameters is important). +!------------------------------------------------------------------------------ +! +! Ngrids Number of nested grids. It needs to be read before all other +! parameters in order to allocate all model variables. +! +! NestLayers Number of grid nesting layers. It is used to allow applications +! with both composite and refinement grid combinations, as shown +! in WikiROMS diagrams for the Refinement and Partial Boundary +! Composite Sub-Classes. See, +! +! https://www.myroms.org/wiki/index.php/Nested_Grids +! +! In non-nesting applications, set NestLayers = 1. +! +! GridsInLayer Number of grids in each nested layer, a vector of size +! [1:NestLayers]. Notice that, +! +! SUM(GridsInLayer) = Ngrids +! LENGHT(GridsInLayer) = NestLayers +! +! The order of grids and nesting layers is extremely important. +! It determines the order of the sequential solution at every +! sub-timestep. See WikiROMS nesting Sub-Classes diagrams. +! +! In non-nesting applications, set GridsInLayer = 1. +! +! NOTE: In main3d, we use these parameters to determine which +! ==== grid index, ng, to solve when calling the routines of +! the computational kernel: +! +! NEST_LAYER : DO nl=1,NestLayers +! ... +! STEP_LOOP : DO istep=1,Nsteps +! ... +! DO ig=1,GridsInLayer(nl) +! ng=GridNumber(ig,nl) +! ... +! END DO +! ... +! END DO STEP_LOOP +! END DO NEST_LAYER +! +! Here, the grid order "ng" for the computations is determined +! from array "GridNumber", which is computed at initialization +! in "read_phypar.F". It can be computed on the fly as: +! +! ng=Ngrids+1 +! DO j=NestLayers,nl,-1 +! DO i=GridsInLayer(j),1,-1 +! ng=ng-1 +! IF ((j.eq.nl).and.(i.eq.ig)) EXIT +! END DO +! END DO +! +! but it is too inefficient. This information is provided here +! to help you configure the order of nested grids. +! +!------------------------------------------------------------------------------ +! Grid dimension parameters. +!------------------------------------------------------------------------------ +! +! These parameters are very important since they determine the grid of the +! application to solve. They need to be read first in order to dynamically +! allocate all model variables. +! +! WARNING: It is trivial and possible to change these dimension parameters in +! ------- idealized applications via analytical expressions. However, in +! realistic applications any change to these parameters requires redoing all +! input NetCDF files. +! +! Lm Number of INTERIOR grid RHO-points in the XI-direction for +! each nested grid, [1:Ngrids]. If using NetCDF files as +! input, Lm=xi_rho-2 where "xi_rho" is the NetCDF file +! dimension of RHO-points. Recall that all RHO-point +! variables have a computational I-range of [0:Lm+1]. +! +! Mm Number of INTERIOR grid RHO-points in the ETA-direction for +! each nested grid, [1:Ngrids]. If using NetCDF files as +! input, Mm=eta_rho-2 where "eta_rho" is the NetCDF file +! dimension of RHO-points. Recall that all RHO-point +! variables have a computational J-range of [0:Mm+1]. +! +! N Number of vertical terrain-following levels at RHO-points, +! [1:Ngrids]. +! +! Nbed Number of sediment bed layers, [1:Ngrids]. This parameter +! is only relevant if CPP option SEDIMENT is activated. +! +! Mm+1 ___________________ _______ Kw = N +! | | | | +! Mm | _____________ | | | Kr = N +! | | | | |_______| +! | | | | | | +! Jr | | | | | | +! | | | | |_______| +! | | | | | | +! 1 | |_____________| | | | +! | | |_______| +! 0 |___________________| | | +! Ir | | 1 +! 0 1 Lm Lm+1 h(i,j) |_______| +! ::::::::: 0 +! ::::::::: +! ::::::::: Nbed-1 +! ::::::::: Nbed +! +! NAT Number of active tracer type variables. Usually, NAT=2 for +! potential temperature and salinity. +! +! NPT Number of inert (dyes, age, etc) passive tracer type variables +! to advect and diffuse only. This parameter is only relevant +! if CPP option T_PASSIVE is activated. +! +! NCS Number of cohesive (mud) sediment tracer type variables. This +! parameter is only relevant if CPP option SEDIMENT is +! activated. +! +! NNS Number of non-cohesive (sand) sediment tracer type variables. +! This parameter is only relevant if CPP option SEDIMENT is +! activated. +! +! The total number of sediment tracers is NST=NCS+NNS. Notice +! that NST must be greater than zero (NST>0). +! +!------------------------------------------------------------------------------ +! Domain tile partition parameters. +!------------------------------------------------------------------------------ +! +! Model tile decomposition parameters for serial and parallel configurations +! which are used to determine tile horizontal range indices (Istr,Iend and +! Jstr,Jend). In some computers, it is advantageous to have tile partitions +! in serial applications. +! +! NtileI Number of domain partitions in the I-direction (XI-coordinate). +! It must be equal to or greater than one. +! +! NtileJ Number of domain partitions in the J-direction (ETA-coordinate). +! It must be equal to or greater than one. +! +! WARNING: In shared-memory (OpenMP), the product of NtileI and NtileJ must +! be a MULTIPLE of the number of parallel threads specified with +! the OpenMP environmental variable OMP_NUM_THREADS. +! +! In distributed-memory (MPI), the product of NtileI and NtileJ +! must be EQUAL to the number of parallel nodes specified during +! execution with the "mprun" or "mpirun" command. +! +!------------------------------------------------------------------------------ +! Tracer advection scheme +!------------------------------------------------------------------------------ +! +! It is more advantageous to set the horizontal and vertical advection schemes +! for each tracer with switches instead of a single CPP flag for all of them. +! Positive-definite and monotonic algorithms (i.e., MPDATA and HSIMT) are +! appropriate and useful for positive fields like salinity, inert, biological, +! and sediment tracers. However, since the temperature has a dynamic range +! with negative and positive values in the ocean, other advection schemes are +! more appropriate. +! +! Currently, the following tracer advection schemes are available and are +! activated using the associated Keyword: +! +! Keyword Advection Algorithm +! +! A4 4th-order Akima (horizontal/vertical) +! C2 2nd-order centered differences (horizontal/vertical) +! C4 4th-order centered differences (horizontal/vertical) +! HSIMT 3th-order HSIMT with TVD limiter (horizontal/vertical) +! MPDATA recursive flux corrected MPDATA (horizontal/vertical) +! SPLINES parabolic splines reconstruction (only vertical) +! SU3 split third-order upstream (horizontal/vertical) +! U3 3rd-order upstresm-bias (only horizontal) +! +! The user has the option of specifying the full Keyword or the first +! two letters, regardless if using uppercase or lowercase. +! +! If using either HSIMT (Wu and Zhu, 2010) or MPDATA (Margolin and +! Smolarkiewicz, 1998) options, the user needs to set the same scheme +! for both horizontal and vertical advection to preserve monotonicity. +! +! Hadvection Horizontal advection for each active (temperature and +! salinity) and inert tracers, [1:NAT+NPT,Ngrids] +! values are expected. +! +! Vadvection Vertical advection for each active (temperature and +! salinity) and inert tracers, [1:NAT+NPT,Ngrids] +! values are expected. +! +! ad_Hadvection Horizontal advection for each active (temperature and +! salinity) and inert tracers in the adjoint-based +! algorithms, [1:NAT+NPT,Ngrids] values are expected. +! +! ad_Vadvection Vertical advection for each active (temperature and +! salinity) and inert tracers in the adjoint-based +! algorithms, [1:NAT+NPT,Ngrids] values are expected. +! +! Examples: +! +! Hadvection == A4 \ ! temperature +! MPDATA \ ! salinity +! HSIMT \ ! dye_01, inert(1) +! HSIMT ! dy2_02, inert(2) +! +! Vadvection == A4 \ ! temperature +! MPDATA \ ! salinity +! HSIMT \ ! dye_01, inert(1) +! HSIMT ! dye_02, inert(2) +! +! or in nested applications +! +! Hadvection == U3 \ ! temperature, Grid 1 +! HSIMT \ ! salinity, Grid 1 +! U3 \ ! temperature, Grid 2 +! HSIMT \ ! salinity, Grid 2 +! U3 \ ! temperature, Grid 3 +! HSIMT ! salinity, Grid 3 +! +! Vadvection == C4 \ ! temperature, Grid 1 +! HSIMT \ ! salinity, Grid 1 +! C4 \ ! temperature, Grid 2 +! HSIMT \ ! salinity, Grid 2 +! C4 \ ! temperature, Grid 3 +! HSIMT ! salinity, Grid 3 +! +!------------------------------------------------------------------------------ +! Lateral boundary conditions parameters. +!------------------------------------------------------------------------------ +! +! The lateral boundary conditions are now specified with logical switches +! instead of CPP flags to allow nested grid configurations. Their values are +! loaded into structured array: +! +! LBC(1:4, nLBCvar, Ngrids) +! +! where 1:4 are the number of boundary edges, nLBCvar are the number of LBC +! state variables, and Ngrids is the number of nested grids. For Example, to +! apply gradient boundary conditions we use: +! +! LBC(iwest, isFsur, ng) % gradient +! LBC(ieast, ... , ng) % gradient +! LBC(isouth, ... , ng) % gradient +! LBC(inorth, ... , ng) % gradient +! +! The lateral boundary conditions are entered with a keyword. This keyword +! is case insensitive and usually has three characters. However, it is +! possible to have compound keywords, if applicable. For example, the +! keyword "RadNud" implies radiation boundary condition with nudging. This +! combination is usually used in active/passive radiation conditions. +! +! Keyword Lateral Boundary Condition Type +! +! Cha Chapman_implicit (free-surface only) +! Che Chapman_explicit (free-surface only) +! Cla Clamped +! Clo Closed +! Fla Flather (2D momentum only) _____N_____ j=Mm +! Gra Gradient | 4 | +! Nes Nested (refinement only) | | +! Nud Nudging 1 W E 3 +! Per Periodic | | +! Rad Radiation |_____S_____| +! Red Reduced Physics (2D momentum only) 2 j=1 +! Shc Shchepetkin (2D momentum only) i=1 i=Lm +! +! LBC(isFsur) Free-surface, [1:4, Ngrids] values are expected. +! LBC(isUbar) 2D U-momentum, [1:4, Ngrids] values are expected. +! LBC(isVbar) 2D V-momentum, [1:4, Ngrids] values are expected. +! LBC(isUvel) 3D U-momentum, [1:4, Ngrids] values are expected. +! LBC(isVvel) 3D V-momentum, [1:4, Ngrids] values are expected. +! LBC(isMtke) Mixing TKE, [1:4, Ngrids] values are expected. +! LBC(isTvar) Tracers, [1:4, 1:NAT+NPT, Ngrids] values are expected. +! +! Similarly, the adjoint-based algorithms (ADM, TLM, RPM) can have different +! lateral boundary conditions keywords: +! +! ad_LBC(isFsur) Free-surface, [1:4, Ngrids] values are expected. +! ad_LBC(isUbar) 2D U-momentum, [1:4, Ngrids] values are expected. +! ad_LBC(isVbar) 2D V-momentum, [1:4, Ngrids] values are expected. +! ad_LBC(isUvel) 3D U-momentum, [1:4, Ngrids] values are expected. +! ad_LBC(isVvel) 3D V-momentum, [1:4, Ngrids] values are expected. +! ad_LBC(isMtke) Mixing TKE, [1:4, Ngrids] values are expected. +! ad_LBC(isTvar) Tracers, [1:4, 1:NAT+NPT, Ngrids] values are expected. +! +! Lateral open boundary edge volume conservation switch for nonlinear model +! and adjoint-based algorithm. Usually activated with radiation boundary +! conditions to enforce global mass conservation. Notice that these switches +! should not be activated if tidal forcing is enabled, [1:Ngrids] values are +! expected. +! +! VolCons(west) Western boundary volume conservation switch. +! VolCons(east) Eastern boundary volume conservation switch. +! VolCons(south) Southern boundary volume conservation switch. +! VolCons(north) Northern boundary volume conservation switch. +! +! ad_VolCons(west) Western boundary volume conservation switch. +! ad_VolCons(east) Eastern boundary volume conservation switch. +! ad_VolCons(south) Southern boundary volume conservation switch. +! ad_VolCons(north) Northern boundary volume conservation switch. +! +!------------------------------------------------------------------------------ +! Timestepping parameters. +!------------------------------------------------------------------------------ +! +! NTIMES Total number of timesteps in current run. If 3D configuration, +! NTIMES is the total of baroclinic timesteps. If only 2D +! configuration, NTIMES is the total of barotropic timesteps. +! +! DT TimeStep size in seconds. If 3D configuration, DT is the +! size of the baroclinic timestep. If only 2D configuration, +! DT is the size of the barotropic timestep. +! +! NDTFAST Number of barotropic timesteps between each baroclinic time +! step. If only 2D configuration, NDTFAST should be unity since +! there is no need to split timestepping. +! +! NTIMES_ANA Total number of timesteps for computing observations impacts +! interval during the analysis cycle. It is only used when +! RBL4DVAR_FCT_SENSITIVITY is activated. +! +! NTIMES_FCT Total number of timesteps for computing observations impacts +! interval during the forecast cycle. It is only used when +! RBL4DVAR_FCT_SENSITIVITY is activated. +! +!------------------------------------------------------------------------------ +! Model iteration loops parameters. +!------------------------------------------------------------------------------ +! +! ERstr Starting ensemble run (perturbation or iteration) number. +! +! ERend Ending ensemble run (perturbation or iteration) number. +! +! Nouter Maximum number of 4DVAR outer loop iterations. +! +! Ninner Maximum number of 4DVAR inner loop iterations. +! +! Nsaddle Number of kernel trajectory intervals for the solution of the +! Saddle-Point 4D-Var (SP4DVAR). It is used to accelerate +! 4D-Var by parallelizing the inner loops in time. The tangent +! linear and adjoint models are time-stepped concurrently over +! the short time integration windows. Make sure that +! +! MOD(NTIMES/NHIS, Nsaddle) = 0 +! +! for legal computations. +! +! Nintervals Number of time interval divisions for Stochastic Optimals +! computations. It must be a multiple of NTIMES. The tangent +! linear model (TLM) and the adjoint model (ADM) are integrated +! forward and backward at different intervals. For example, +! if Nintervals=3, +! +! 1 NTIMES/3 2*NTIMES/3 NTIMES +! +..................+..................+..................+ +! <========================================================> (1) +! <=====================================> (2) +! <==================> (3) +! +! In the first iteration (1), the TLM is integrated forward from +! 1 to NTIMES and the ADM is integrated backward from NTIMES to 1. +! In the second iteration (2), the TLM is integrated forward from +! NTIMES/3 to NTIMES and the ADM is integrated backward from +! NTIMES to NTIMES/3. And so on. +! +!------------------------------------------------------------------------------ +! Eigenproblem parameters. +!------------------------------------------------------------------------------ +! +! NEV Number of eigenvalues to compute for the Lanczos/Arnoldi +! problem. Notice that the model memory requirement increases +! substantially as NEV increases. The GST requires NEV+1 +! copies of the model state vector. The memory requirements +! are decreased in distributed-memory applications. +! +! NCV Number of eigenvectors to compute for the Lanczos/Arnoldi +! problem. NCV must be greater than NEV. +! +! At present, there is no apriori analysis to guide the selection of NCV +! relative to NEV. The only formal requirement is that NCV > NEV. However +! in optimal perturbations, it is recommended to have NCV greater than or +! equal to 2*NEV. In Finite Time Eigenmodes (FTE) and Adjoint Finite Time +! Eigenmodes (AFTE) the requirement is to have NCV greater than or equal to +! 2*NEV+1. +! +! The efficiency of calculations depends critically on the combination of +! NEV and NCV. If NEV is large (greater than 10 say), you can use NCV=2*NEV+1 +! but for NEV small (less than 6) it will be inefficient to use NCV=2*NEV+1. +! In complicated applications, you can start with NEV=2 and NCV=10. Otherwise, +! it will iterate for a very long time. +! +!------------------------------------------------------------------------------ +! Input/Output parameters. +!------------------------------------------------------------------------------ +! +! NRREC Switch to indicate re-start from a previous solution. Use +! NRREC=0 for new solutions. In a re-start solution, NRREC +! is the time index of the re-start NetCDF file assigned for +! initialization. If NRREC is negative (say NRREC=-1), the +! model will re-start from the most recent time record. That +! is, the initialization record is assigned internally. +! Notice that it is also possible to re-start from a history +! or time-averaged NetCDF file. If a history file is used +! for re-start, it must contains all the necessary primitive +! variables at all levels. +! +! LcycleRST Logical switch (T/F) used to recycle time records in output +! restart file. If TRUE, only the latest two re-start time +! records are maintained. If FALSE, all re-start fields are +! saved every NRST timesteps without recycling. The restart +! fields are written at all levels in double precision. +! +! NRST Number of timesteps between the writing of re-start fields. +! Set NRST=0 to suppress writing of RESTART file. +! +! NSTA Number of timesteps between writing data into STATIONS file. +! Station data is written at all levels. +! +! NFLT Number of timesteps between writing data into FLOATS file. +! +! NINFO Number of timesteps between the print of single line information +! to standard output. It also determines the interval between +! computation of global energy diagnostics. +! +!------------------------------------------------------------------------------ +! Output HISTORY, QUICKSAVE, AVERAGE and DIAGNOSTIC files parameters. +!------------------------------------------------------------------------------ +! +! Notice that it is possible to have two types of output NetCDF files for +! instantaneous fields: HISTORY and QUICKSAVE. The QUICKSAVE file can be used +! for writing fewer fields at shorter time intervals. For example, the User +! may just write 2D and surface fields frequently (hourly) to reduce file +! size and to time resolve fast dynamics. In conjunction, the User may write +! full HISTORY fields infrequently (daily, weekly, etc) to avoid creating +! large output files. This gives a lot of flexibility to manage ROMS output. +! +! +! LDEFOUT Logical switch (T/F) used to create new output files when +! initializing from a re-start file, abs(NRREC) > 0. If TRUE +! and applicable, a new HISTORY, QUICKSAVE, AVERAGE, DIAGNOSTIC +! and STATIONS files are created during the initialization +! stage. If FALSE and applicable, data is appended to existing +! HISTORY, QUICKSAVE, AVERAGE, DIAGNOSTIC and STATIONS files. +! See also parameters NDEFHIS, NDEFQCK, NDEFAVG and NDEFDIA +! below. +! +! NHIS Number of timesteps between writing fields into the HISTORY +! file. Set NHIS=0 to suppress writing of HISTORY file. +! +! NDEFHIS Number of timesteps between the creation of new HISTORY file. +! If NDEFHIS=0, the model will only process one HISTORY file. +! This feature is useful for extended simulations when HISTORY +! file get too large; it creates a new file every NDEFHIS +! timesteps. +! +! NQCK Number of timesteps between writing fields into QUICKSAVE file. +! Set NQCK=0 to suppress writing of QUICKSAVE file. +! +! NDEFQCK Number of timesteps between the creation of new QUICKSAVE file. +! If NDEFQCK=0, the model will only process one QUICKSAVE file. +! This feature is useful for extended simulations when QUICKSAVE +! file get too large; it creates a new file every NDEFQCK +! timesteps. +! +! NTSAVG Starting timestep for the accumulation of output time-averaged +! data. +! +! NAVG Number of timesteps between writing time-averaged data +! into AVERAGE file. Averaged date is written for all fields. +! Set NAVG=0 to suppress writing of AVERAGE file. +! +! NDEFAVG Number of timesteps between the creation of new AVERAGE +! file. If NDEFAVG=0, the model will only process one AVERAGE +! file. This feature is useful for extended simulations when +! AVERAGE file get too large; it creates a new file every +! NDEFAVG timesteps. +! +! NTSDIA Starting timestep for the accumulation of output time-averaged +! diagnostics data. +! +! NDIA Number of timesteps between writing time-averaged diagnostics +! data into DIAGNOSTIC file. Averaged date is written for all +! fields. Set NDIA=0 to suppress writing of DIAGNOSTIC file. +! +! NDEFDIA Number of timesteps between the creation of new time-averaged +! diagnostics file. If NDEFDIA=0, the model will only process +! one DIAGNOSTICS file. This feature is useful for long +! simulations when DIAGNOSTIC file get too large; it creates +! a new file every NDEFDIA timesteps. +! +!------------------------------------------------------------------------------ +! Output tangent linear and adjoint model parameters. +!------------------------------------------------------------------------------ +! +! LcycleTLM Logical switch (T/F) used to recycle time records in output +! tangent linear file. If TRUE, only the latest two time +! records are maintained. If FALSE, all tangent linear fields +! are saved every NTLM timesteps without recycling. +! +! NTLM Number of timesteps between writing fields into tangent linear +! model file. +! +! NDEFTLM Number of timesteps between the creation of new tangent linear +! file. If NDEFTLM=0, the model will only process one tangent +! linear file. This feature is useful for extended simulations +! when output NetCDF files get too large; it creates a new file +! every NDEFTLM timesteps. +! +! LcycleADJ Logical switch (T/F) used to recycle time records in output +! adjoint file. If TRUE, only the latest two time records are +! maintained. If FALSE, all tangent linear fields are saved +! every NADJ timesteps without recycling. +! +! NADJ Number of timesteps between writing fields into the adjoint +! model file. +! +! NDEFADJ Number of timesteps between the creation of the new adjoint +! file. If NDEFADJ=0, the model will only process one adjoint +! file. This feature is useful for extensive simulations when +! the output NetCDF files get too large; it creates a new file +! every NDEFADJ timesteps. +! +! NSFF Number of timesteps between 4DVAR adjustment of surface forcing +! fluxes. In strong constraint 4DVAR, it is possible to adjust +! surface forcing at other time intervals in addition to initial +! time. This parameter is used to store the appropriate number +! of surface forcing records in the output history NetCDF files: +! 1+NTIMES/NSFF records. NSFF must be a factor of NTIMES or +! greater than NTIMES. If NSFF > NTIMES, only one record is +! stored in the NetCDF files and the adjustment is for constant +! forcing with constant correction. This parameter is only +! relevant in 4DVAR when activating either ADJUST_STFLUX or +! ADJUST_WSTRESS. +! +! NOBC Number of timesteps between 4DVAR adjustment of open boundary +! fields. In strong constraint 4DVAR, it is possible to adjust +! open boundaries at other time intervals in addition to initial +! time. This parameter is used to store the appropriate number +! of open boundary records in the output history NetCDF files: +! 1+NTIMES/NOBC records. NOBC must be a factor of NTIMES or +! greater than NTIMES. If NOBC > NTIMES, only one record is +! stored in the NetCDF files and the adjustment is for constant +! forcing with constant correction. This parameter is only +! relevant in 4DVAR when activating ADJUST_BOUNDARY. +! +!------------------------------------------------------------------------------ +! Generalized Stability Theory (GST) analysis parameters. +!------------------------------------------------------------------------------ +! +! LmultiGST Logical switch (TRUE/FALSE) to write out one GST analysis +! eigenvector per history file. +! +! LrstGST Logical switch (TRUE/FALSE) to restart GST analysis. If TRUE, +! the check pointing data is read in from the GST restart NetCDF +! file. If FALSE and applicable, the checkpointing GST data is +! saved and overwritten every NGST iterations of the algorithm. +! +! MaxIterGST Maximum number of GST algorithm iterations. +! +! NGST Number of GST iterations between storing of check pointing +! data into NetCDF file. The restart data is always saved if +! MaxIterGST is reached without convergence. It is also saved +! when convergence is achieved. It is always a good idea to +! save the checkpointing data at regular intervals so there +! is a mechanism to recover from an unexpected interruption +! in this costly computation. The check pointing data can +! be used also to recompute the Ritz vectors by changing some +! of the parameters, like convergence criteria (Ritz_tol) +! and number of Arnoldi iterations (iparam(3)). +! +! Ritz_tol Relative accuracy of the Ritz values computed in the GST +! analysis. +! +!------------------------------------------------------------------------------ +! Harmonic/Biharmonic horizontal diffusion for active tracers and viscosity +! for momentum. +!------------------------------------------------------------------------------ +! +! TNU2 Nonlinear model lateral, harmonic, constant, mixing +! coefficient (m2/s) for active (NAT) and inert (NPT) tracer +! variables. If variable horizontal diffusion is activated, +! TNU2 is the mixing coefficient for the largest grid-cell +! in the domain. +! +! TNU4 Nonlinear model lateral, biharmonic, constant, mixing +! coefficient (m4/s) for active (NAT) and inert (NPT) tracer +! variables. If variable horizontal diffusion is activated, +! TNU4 is the mixing coefficient for the largest grid-cell +! in the domain. +! +! ad_TNU2 Adjoint-based algorithms lateral, harmonic, constant, mixing +! coefficient (m2/s) for active (NAT) and inert (NPT) tracer +! variables. If variable horizontal diffusion is activated, +! ad_TNU2 is the mixing coefficient for the largest grid-cell +! in the domain. In some applications, a larger value than +! that used in the nonlinear model (basic state) is necessary +! for stability. +! +! ad_TNU4 Adjoint-based algorithms lateral, biharmonic, constant, mixing +! coefficient (m4/s) for active (NAT) and inert (NPT) tracer +! variables. If variable horizontal diffusion is activated, +! ad_TNU4 is the mixing coefficient for the largest grid-cell +! in the domain. In some applications, a larger value than +! that used in the nonlinear model (basic state) is necessary +! for stability. +! +! VISC2 Nonlinear model lateral, harmonic, constant, mixing +! coefficient (m2/s) for momentum. If variable horizontal +! viscosity is activated, UVNU2 is the mixing coefficient +! for the largest grid-cell in the domain. +! +! VISC4 Nonlinear model lateral, biharmonic, constant mixing +! coefficient (m4/s) for momentum. If variable horizontal +! viscosity is activated, UVNU4 is the mixing coefficient +! for the largest grid-cell in the domain. +! +! ad_VISC2 Adjoint-based algorithms lateral, harmonic, constant, mixing +! coefficient (m2/s) for momentum. If variable horizontal +! viscosity is activated, ad_UVNU2 is the mixing coefficient +! for the largest grid-cell in the domain. In some applications, +! a larger value than that used in the nonlinear model (basic +! state) is necessary for stability. +! +! ad_VISC4 Adjoint-based algorithms lateral, biharmonic, constant mixing +! coefficient (m4/s) for momentum. If variable horizontal +! viscosity is activated, ad_UVNU4 is the mixing coefficient +! for the largest grid-cell in the domain. In some applications, +! a larger value than that used in the nonlinear model (basic +! state) is necessary for stability. +! +!------------------------------------------------------------------------------ +! Switches to activate sponge areas with enhanced horizontal mixing. +!------------------------------------------------------------------------------ +! +! LuvSponge Logical switch (TRUE/FALSE) to increase/decrease horizontal +! viscosity in specific areas of the domain. It can be used +! to specify sponge areas with larger horizontal mixing +! coefficients for damping of high frequency noise due to +! open boundary conditions or nesting. The CPP option SPONGE +! is now deprecated and replaced with this switch to facilitate +! or not sponge areas over a particular nested grid. +! +! The horizontal mixing distribution is specified in +! "ini_hmixcoef.F" as: +! +! visc2_r(i,j) = visc_factor(i,j) * visc2_r(i,j) +! visc4_r(i,j) = visc_factor(i,j) * visc4_r(i,j) +! +! The variable "visc_factor" can be read from the grid +! NetCDF file. Alternately, the horizontal viscosity in the +! sponge area can be set-up with analytical functions in +! "ana_sponge.h" using CPP ANA_SPONGE when the switch +! "LuvSponge" is turned ON for a particular grid. +! +! LtracerSponge Logical switch (TRUE/FALSE) to increase/decrease horizontal +! diffusivity in specific areas of the domain. It can be used +! to specify sponge areas with larger horizontal mixing +! coefficients for damping of high frequency noise due to +! open boundary conditions or nesting. The CPP option SPONGE +! is now deprecated and replaced with this switch to facilitate +! or not sponge areas over a particular nested grid. +! +! The horizontal mixing distribution is specified in +! "ini_hmixcoef.F" as: +! +! diff2(i,j,itrc) = diff_factor(i,j) * diff2(i,j,itrc) +! diff4(i,j,itrc) = diff_factor(i,j) * diff4(i,j,itrc) +! +! The variable "diff_factor" can be read from the grid +! NetCDF file. Alternately, the horizontal viscosity in the +! sponge area can be set-up with analytical functions in +! "ana_sponge.h" using CPP ANA_SPONGE when the switch +! "LuvSponge" is turned ON for a particular grid. +! +!------------------------------------------------------------------------------ +! Vertical mixing coefficients for active tracers. +!------------------------------------------------------------------------------ +! +! AKT_BAK Background vertical mixing coefficient (m2/s) for active +! (NAT) and inert (NPT) tracer variables. +! +! AKT_LIMIT Upper threshold values to limit vertical diffusion coefficients +! computed from vertical mixing parameterizations (GLS_MIXING, +! LMD_MIXING, MY25_MIXING). Sometimes, these parameterizations +! yield high mixing values and the threshold values are used as +! upper limiter when LIMIT_VDIFF is activated. +! +! ad_AKT_fac Adjoint-based algorithms vertical mixing, basic state, scale +! factor (nondimensional) for active (NAT) and inert (NPT) +! tracer variables. In some applications, smaller/larger +! values of vertical mixing are necessary for stability. It +! is only used when FORWARD_MIXING is activated. +! +!------------------------------------------------------------------------------ +! Vertical mixing coefficient for momentum. +!------------------------------------------------------------------------------ +! +! AKV_BAK Background vertical mixing coefficient (m2/s) for momentum. +! +! AKV_LIMIT Upper threshold value to limit vertical viscosity coefficient +! computed from vertical mixing parameterizations (GLS_MIXING, +! LMD_MIXING, MY25_MIXING). Sometimes, these parameterizations +! yield a high mixing value and the threshold value is used as +! upper limiter when LIMIT_VVISC is activated. +! +! ad_AKV_fac Adjoint-based algorithms vertical mixing, basic state, scale +! factor (nondimensional) for momentum. In some applications, +! smaller/larger values of vertical mixing are necessary for +! stability. It is only used when FORWARD_MIXING is activated. +! +!------------------------------------------------------------------------------ +! Turbulent closure parameters. +!------------------------------------------------------------------------------ +! +! AKK_BAK Background vertical mixing coefficient (m2/s) for turbulent +! kinetic energy. +! +! AKP_BAK Background vertical mixing coefficient (m2/s) for turbulent +! generic statistical field, "psi". +! +! TKENU2 Lateral, harmonic, constant, mixing coefficient (m2/s) for +! turbulent closure variables. +! +! TKENU4 Lateral, biharmonic, constant mixing coefficient (m4/s) for +! turbulent closure variables. +! +!------------------------------------------------------------------------------ +! Generic length-scale turbulence closure parameters. +!------------------------------------------------------------------------------ +! +! GLS_P Stability exponent (nondimensional). +! +! GLS_M Turbulent kinetic energy exponent (nondimensional). +! +! GLS_N Turbulent length scale exponent (nondimensional). +! +! GLS_Kmin Minimum value of specific turbulent kinetic energy +! +! GLS_Pmin Minimum Value of dissipation. +! +! Closure independent constraint parameters (nondimensional): +! +! GLS_CMU0 Stability coefficient. +! +! GLS_C1 Shear production coefficient. +! +! GLS_C2 Dissipation coefficient. +! +! GLS_C3M Buoyancy production coefficient (minus). +! +! GLS_C3P Buoyancy production coefficient (plus). +! +! GLS_SIGK Constant Schmidt number (nondimensional) for turbulent +! kinetic energy diffusivity. +! +! GLS_SIGP Constant Schmidt number (nondimensional) for turbulent +! generic statistical field, "psi". +! +! Suggested values for various parameterizations: +! +! k-kl k-epsilon k-omega gen +! +! GLS_P = 0.d0 3.0d0 -1.0d0 2.0d0 +! GLS_M = 1.d0 1.5d0 0.5d0 1.0d0 +! GLS_N = 1.d0 -1.0d0 -1.0d0 -0.67d0 +! GLS_Kmin = 5.0d-6 7.6d-6 7.6d-6 1.0d-8 +! GLS_Pmin = 5.0d-6 1.0d-12 1.0d-12 1.0d-8 +! +! GLS_CMU0 = 0.5544d0 0.5477d0 0.5477d0 0.5544d0 +! GLS_C1 = 0.9d0 1.44d0 0.555d0 1.00d0 +! GLS_C2 = 0.52d0 1.92d0 0.833d0 1.22d0 +! GLS_C3M = 2.5d0 -0.4d0 -0.6d0 0.1d0 +! GLS_C3P = 1.0d0 1.0d0 1.0d0 1.0d0 +! GLS_SIGK = 1.96d0 1.0d0 2.0d0 0.8d0 +! GLS_SIGP = 1.96d0 1.30d0 2.0d0 1.07d0 +! +!------------------------------------------------------------------------------ +! Constants used in the various formulations of surface turbulent kinetic +! energy flux in the GLS. +!------------------------------------------------------------------------------ +! +! CHARNOK_ALPHA Charnok surface roughness, +! Zos: (charnok_alpha * u_star**2) / g +! +! ZOS_HSIG_ALPHA Roughness from wave amplitude, +! Zos: zos_hsig_alpha * Hsig +! +! SZ_ALPHA Surface flux from wave dissipation, +! flux: dt * sz_alpha * Wave_dissip +! +! CRGBAN_CW Surface flux due to Craig and Banner wave breaking, +! flux: dt * crgban_cw * u_star**3 +! +!------------------------------------------------------------------------------ +! Constants used in the computation of momentum stress. +!------------------------------------------------------------------------------ +! +! RDRG Linear bottom drag coefficient (m/s). +! +! RDRG2 Quadratic bottom drag coefficient. +! +! Zob Bottom roughness (m). +! +! Zos Surface roughness (m). +! +!------------------------------------------------------------------------------ +! Height of atmospheric measurements for bulk fluxes parameterization. +!------------------------------------------------------------------------------ +! +! BLK_ZQ Height (m) of surface air humidity measurement. Usually, +! recorded at 10 m. +! +! BLK_ZT Height (m) of surface air temperature measurement. Usually, +! recorded at 2 or 10 m. +! +! BLK_ZW Height (m) of surface winds measurement. Usually, recorded +! at 10 m. +! +!------------------------------------------------------------------------------ +! Wetting and drying parameters. +!------------------------------------------------------------------------------ +! +! DCRIT Minimum depth (m) for wetting and drying. +! +!------------------------------------------------------------------------------ +! Jerlov Water type. +!------------------------------------------------------------------------------ +! +! WTYPE Jerlov water type array index used to model the light absorption +! with a double exponential function (Paulson and Simpson, +! 1977). The classification ranges from clear open ocean +! waters (type I) to dark turbulent coastal waters (type 7). +! +! Array Jerlov +! Index Water Type Examples +! ----- ---------- -------- +! +! 1 I Open Pacific +! 2 IA Eastern Mediterranean, Indian Ocean +! 3 IB Western Mediterranean, Open Atlantic +! 4 II Coastal waters, Azores +! 5 III Coastal waters, North Sea +! 6 1 Skagerrak Strait +! 7 3 Baltic +! 8 5 Black Sea +! 9 7 Dark coastal water +! +!------------------------------------------------------------------------------ +! Body-force parameters. Used when CPP option BODYFORCE is activated. +!------------------------------------------------------------------------------ +! +! LEVSFRC Deepest level to apply surface momentum stress as a body-force. +! +! LEVBFRC Shallowest level to apply bottom momentum stress as a body-force. +! +!------------------------------------------------------------------------------ +! Vertical S-coordinates parameters. +!------------------------------------------------------------------------------ +! +! The parameters below must be consistent in all input fields associated with +! the vertical grid. The same vertical grid transformation (depths) needs to +! be used when preparing initial conditions, boundary conditions, climatology, +! observations, and so on. Please check: +! +! https://www.myroms.org/wiki/index.php/Vertical_S-coordinate +! +! for details, rules and examples. +! +! +! Vtransform Vertical transformation equation: +! +! (1) Original formulation (Shchepetkin and McWilliams, 2005), +! Vtransform=1 (In ROMS since 1999) +! +! z(x,y,s,t)=Zo(x,y,s)+zeta(x,y,t)*[1+Zo(x,y,s)/h(x,y)] +! +! where +! +! Zo(x,y,s)=hc*s+[h(x,y)-hc]*C(s) +! +! (2) Improved formulation (A. Shchepetkin, 2005), +! Vtransform=2 +! +! z(x,y,s,t)=zeta(x,y,t)*[zeta(x,y,t)+h(x,y)]*Zo(x,y,s) +! +! where +! +! Zo(x,y,s)=[hc*s(k)+h(x,y)*C(k)]/[hc+h(x,y)] +! +! The true sigma-coordinate system is recovered as hc goes +! to INFINITY. This is useful when configuring applications +! with flat bathymetry and uniform level thickness. +! Practically, you can achieve this by setting: +! +! THETA_S = 0.0d0 +! THETA_B = 0.0d0 +! TCLINE = 1.0d+17 (a large number) +! +! +! Vstretching Vertical stretching function, C(s): +! +! (1) Original function (Song and Haidvogel, 1994), +! Vstretching=1 +! +! C(s)=(1-theta_b)*[SINH(s*theta_s)/SINH(theta_s)]+ +! theta_b*[-0.5+0.5*TANH(theta_s*(s+0.5))/ +! TANH(0.5*theta_s)] +! +! (2) A. Shchepetkin (2005) function, +! Vstretching=2 +! +! C(s)=Cweight*Csur(s)+(1-Cweight)*Cbot(s) +! +! where +! +! Csur(s)=[1-COSH(theta_s*s)]/[COSH(theta_s)-1] +! +! Cbot(s)=-1+[1-SINH(theta_b*(s+1))]/SINH(theta_b) +! +! Cweight=(s+1)**alpha* +! (1+(alpha/beta)*(1-(s+1)**beta)) +! +! (3) R. Geyer function for shallow sediment applications, +! Vstretching=3 +! +! C(s)=Cweight*Cbot(s)+(1-Cweight)*Csur(s) +! +! where +! +! Csur(s)=-LOG(COSH(Hscale*ABS(s)** alpha))/ +! LOG(COSH(Hscale)) +! +! Cbot(s)= LOG(COSH(Hscale*(s+1)** beta))/ +! LOG(COSH(Hscale))-1 +! +! Cweight=0.5*(1-TANH(Hscale*(s+0.5)) +! +! (4) A. Shchepetkin (2010) improved double stretching function, +! Vstretching=4 +! +! C(s)=[1-COSH(theta_s*s)]/[COSH(theta_s)-1] +! +! with bottom refinement +! +! C(s)=[EXP(theta_b*C(s))-1]/[1-EXP(-theta_b)] +! +! The resulting double transformation is continuous with +! respect control parameters theta_s and theta_b with a +! meaningful range of: +! +! 0 < theta_s <= 10.0 +! 0 <= theta_b <= 4.0 +! +! (5) Souza et al. (2015) quadratic Legendre polynomial function +! that allows higher resolution near the surface, +! Vstretching=5. It is similar to Vstretching=4, but the +! fractional stretched vertical coordinate (s) is re-defined +! as: +! +! s(k)=- [(k*k - 2*k*N + k + N*N - N) / (N*N - N)] +! - weight * [(k*k - k*N) / (1 - N)] +! +! at vertical W-points, k=0,...,N and weight=0.01. To get +! the equation at vertical RHO-points, replace k with k-0.5. +! +! Many other stretching functions (Vstretching>5) are possible +! provided that: +! +! * C(s) is a dimensionless, nonlinear, monotonic function. +! * C(s) is a continuous differentiable function, or +! a differentiable piecewise function with smooth transition. +! * The stretching vertical coordinate ,s, is constrained +! between -1 <= s <= 0, with s=0 corresponding to the +! free-surface and s=-1 corresponding to the bathymetry. +! * Similarly, the stretching function, C(s), is constrained +! between -1 <= C(s) <= 0, with C(0)=0 corresponding to the +! free-surface and C(-1)=-1 corresponding to the bathymetry. +! +! These functions are coded in routine "Utility/set_scoord.F". +! +! Due to its functionality and properties, the default and recommended vertical +! coordinates transformation is: +! +! Vtransform = 2 +! Vstretching = 4 +! +! +! THETA_S S-coordinate surface control parameter. The range of optimal +! values depends on the vertical stretching function, C(s). +! +! THETA_B S-coordinate bottom control parameter. The range of optimal +! values depends on the vertical stretching function, C(s). +! +! TCLINE Critical depth (hc) in meters (positive) controlling the +! stretching. It can be interpreted as the width of surface or +! bottom boundary layer in which higher vertical resolution +! (levels) is required during stretching. +! +!------------------------------------------------------------------------------ +! Mean Density and background Brunt-Vaisala frequency. +!------------------------------------------------------------------------------ +! +! RHO0 Mean density (Kg/m3) used when the Boussinesq approximation +! is inferred. +! +! BVF_BAK Background Brunt-Vaisala frequency squared (1/s2). Typical +! values for the ocean range (as a function of depth) from +! 1.0E-4 to 1.0E-6. +! +!------------------------------------------------------------------------------ +! Tide Genearting Forces (TGF) parameter. +!------------------------------------------------------------------------------ +! +! Lnodal Switch to account for the slow modulation of the equilibrium +! tides constituents due primarily to the 18.6-year lunar nodal +! cycle. +! +!------------------------------------------------------------------------------ +! Time Stamps. +!------------------------------------------------------------------------------ +! +! DSTART Time stamp assigned to model initialization (days). Usually +! a Calendar linear coordinate, like modified Julian Day. For +! Example: +! +! Julian Day = 1 for Nov 25, 00:00:00 4713 BCE +! modified Julian Day = 1 for May 24, 00:00:00 1968 GMT +! Days since Jan 1, 2000 = 988.5 for Sep 15, 12:00:00 2002 +! +! It is called truncated or modified Julian day because an +! offset of 2440000 needs to be added. +! +! TIDE_START Reference time origin for tidal forcing (days since application +! reference date, TIME_REF). It is defined as the time of phase +! zero when preparing the input forcing tidal boundary data. The +! tide reference time is important and often ignored parameter +! by the users. If TIDE_START=0.0, it implies that the date of +! zero phase is the same as the application date reference, +! TIME_REF. +! +! To avoid any ambiguity with the tide generating forcing in the +! pressure gradient, it is preferable if the "zero_phase_date" +! variable is available in the input tidal forcing NetCDF file. +! It is a floating-point variable of the form YYYYMMDD.dddd with +! the following metadata: +! +! double zero_phase_date +! zero_phase_date:long_name = "tidal reference date for zero phase" +! zero_phase_date:units = "days as %Y%m%d.%f" +! zero_phase_date:C_format = "%13.4f" +! zero_phase_date:FORTRAN_format = "(f13.4)" +! +! Use "forcing/add_tide_date.m" from the ROMS Matlab repository +! to add the "zero_phase_date" variable to your existing tidal +! forcing NetCDF file. It is highly recommended to use this +! approach. If such a variable is found, the TIDE_START value +! will overwritten during execution. +! +! Notice that it is possible to have different reference values +! for "zero_phase_date" and ROMS clock defined as seconds from +! reference date TIME_REF. If TIME_REF is earlier than variable +! "zero_phase_date", the frequencies (omega) to harmonic terms +! will be negative since they are computed as follows: +! +! tide_start = Rclock%tide_DateNumber(2) - +! Rclock%DateNumber(2)) +! omega = 2 * pi * (time - tide_start) / Tperiod +! +! TIME_REF Reference time (yyyymmdd.f) used to compute relative time: +! elapsed time interval since reference-time. The "units" +! attribute takes the form "time-unit since reference-time". +! This parameter also provides information about the calendar +! used: +! +! If TIME_REF = -2, model time and DSTART are in modified Julian +! days units. The "units" attribute is: +! +! 'time-units since 1968-05-23 00:00:00 GMT' (May 23, 1968) +! +! If TIME_REF = -1, model time and DSTART are in a calendar +! with 360 days in every year (30 days each month). The "units" +! attribute is: +! +! 'time-units since 0000-12-30 00:00:00' (Dec 30, 0000) +! +! If TIME_REF = 0, model time and DSTART are in a common year +! calendar with 365.25 days. The "units" attribute is: +! +! 'time-units since 0001-01-01 00:00:00' (Jan 1, 0001) +! +! If TIME_REF > 0, model time and DSTART are the elapsed time +! units since specified reference time. For example, +! TIME_REF=20020115.5 will yield the following attribute: +! +! 'time-units since 2002-01-15 12:00:00' (Jan 15, 2002) +! +!------------------------------------------------------------------------------ +! Nudging/relaxation time scales, inverse scales will be computed internally. +!------------------------------------------------------------------------------ +! +! When passive/active open boundary conditions are activated, these nudging +! values correspond to the passive (outflow) nudging time scales. +! +! TNUDG Nudging time scale (days) for active tracer variables. +! (1:NAT+NPT,1:Ngrids) values are expected. +! +! ZNUDG Nudging time scale (days) for free-surface. +! +! M2NUDG Nudging time scale (days) for 2D momentum. +! +! M3NUDG Nudging time scale (days) for 3D momentum. +! +! OBCFAC Factor between passive (outflow) and active (inflow) open +! boundary conditions. The nudging time scales for the +! active (inflow) conditions are obtained by multiplying +! the passive values by OBCFAC. If OBCFAC > 1, nudging on +! inflow is stronger than on outflow (recommended). +! +!------------------------------------------------------------------------------ +! Linear equation of State parameters. +!------------------------------------------------------------------------------ +! +! Ignoring pressure, the linear equation of state is: +! +! rho(:,:,:) = R0 - R0 * TCOEF * (t(:,:,:,:,itemp) - T0) +! + R0 * SCOEF * (t(:,:,:,:,isalt) - S0) +! +! Typical values: R0 = 1027.0 kg/m3 +! T0 = 10.0 Celsius +! S0 = 35.0 nondimensional +! TCOEF = 1.7d-4 1/Celsius +! SCOEF = 7.6d-4 1/nondimensional +! +! Notice that salinity has NO UNITS, it is nondimensional. Many +! people use PSU (Practical Salinity Unit). However, salinity +! has always been defined as a conductivity ratio and does not +! have physical units. For details, check the following forum +! post: www.myroms.org/forum/viewtopic.php?f=30&t=294 +! +! R0 Background density value (Kg/m3) used in Linear Equation of +! State. +! +! T0 Background potential temperature (Celsius) constant. +! +! S0 Background salinity (nondimensional) constant. +! +! TCOEF Thermal expansion coefficient in Linear Equation of State. +! +! SCOEF Saline contraction coefficient in Linear Equation of State. +! +!------------------------------------------------------------------------------ +! Slipperiness parameter. +!------------------------------------------------------------------------------ +! +! GAMMA2 Slipperiness variable, either 1.0 (free slip) or -1.0 (no slip). +! +!------------------------------------------------------------------------------ +! Point Sources/Sink sources activation switches. +!------------------------------------------------------------------------------ +! +! LuvSrc Logical switches (T/F) to activate momentum horizontal transport +! points Sources/Sinks. Usually it is used to turn on/off river +! runoff transport (u or v variables) in an application, +! [1:Ngrids]. +! +! In nesting applications, turn on only the grids that require +! activation and processing of momentum point Sources/Sinks. +! +! LwSrc Logical switches (T/F) to activate mass points Sources/Sinks. +! Usually, it is used to turn on/off volume vertical influx (w) +! in an application. +! +! In nesting applications, turn on only the grids that require +! activation and processing of mass influx point Sources/Sinks. +! +! LtracerSrc Logical switches (T/F) to activate tracer variables point +! Sources/Sinks. Only NAT active tracers (temperature, salinity) +! and NPT inert tracers are activated here: +! +! LtracerSrc(itemp,ng) for temperature (itemp=1) +! LtracerSrc(isalt,ng) for salinity (isalt=2) +! LtracerSrc(NAT+1,ng) for inert tracer 1 +! ... ... +! LtracerSrc(NAT+NPT,ng) for inert tracer NPT +! +! Other biological and sediment tracers switches are activated +! in their respective input scripts. +! +! In nesting applications, turn on only the grids that require +! activation and processing of tracers point Sources/Sinks. +! +! Recall that switches are usually activated to add river runoff +! as a point source. At minimum, it is necessary to specify both +! temperature and salinity for all rivers. The other tracers are +! optional. +! +! This logical switch REPLACES and ELIMINATES the need to have +! or read the variable "river_flag(river)" in the input rivers +! forcing NetCDF file: +! +! double river_flag(river) +! river_flag:long_name = "river runoff tracer flag" +! river_flag:option_0 = "all tracers are off" +! river_flag:option_1 = "only temperature" +! river_flag:option_2 = "only salinity" +! river_flag:option_3 = "both temperature and salinity" +! river_flag:units = "nondimensional" +! +! The above variable was too cumbersome and complicated when +! additional tracers are considered. However, this change is +! backward compatible. +! +! The LtracerSrc switch will be used to activate the reading of +! respective tracer variable from input river forcing NetCDF +! file. If you want to add other tracer variables (other than +! temperature and salinity) as a source for a particular +! river(s), you just need to specify such values on those +! river(s). Then, set the values to ZERO on the other river(s) +! that do NOT require such river forcing for that tracer. +! Recall that you need to specify the tracer values for all +! rivers, even if their values are zero. +! +!------------------------------------------------------------------------------ +! Logical switches to process climatology fields. The climatology fields are +! either read from a NetCDF file or set with analytical CPP options. +!------------------------------------------------------------------------------ +! +! LsshCLM Logical switch (T/F) to process sea-surface height climatology. +! The CPP option ZCLIMATOLOGY is now obsolete and replaced with +! this switch to facilitate nesting applications. Currently, +! the sea-surface height climatology, CLIMA(ng)%ssh, is NOT +! used but it is kept for future use. +! +! The nudging of SSH on the free-surface governing equation +! (vertically integrated continuity equation) is NOT allowed +! because it violates mass/volume conservation. Recall that +! the time rate of change of free-surface is computed from the +! divergence of "ubar" and "vbar". If such nudging term is +! required, it needs to be specified on the momentum equations +! for (u,v) and/or (ubar,vbar). If done on (u,v) only, its +! effects enter the 2D momentum equations via the residual +! vertically integrated forcing term. +! +! Lm2CLM Logical switch (T/F) to process 2D momentum (ubar, vbar) +! climatology. The CPP option M2CLIMATOLOGY is now obsolete +! and replaced with this switch to facilitate nesting +! applications. Currently, the CLIMA(ng)%ubarclm and +! CLIMA(ng)%vbarclm are used for sponges and nudging. If +! tidal forcing, the climatological values are adjusted to +! include tides. +! +! Lm3CLM Logical switch (T/F) to process 3D momentum climatology (u,v) +! The CPP option M3CLIMATOLOGY is now obsolete and replaced +! with this switch to facilitate nesting applications. +! Currently, the CLIMA(ng)%uclm and CLIMA(ng)%vclm are used +! for sponges and nudging. +! +! LtracerCLM Logical switches (T/F) to process active and inert tracer +! variables climatology. The CPP option TCLIMATOLOGY is now +! obsolete and replaced with these switches to facilitate +! nesting applications. Currently, the CLIMA(ng)%tclm is +! used for horizontal mixing, sponges, and nudging. +! +! Only NAT active tracers (temperature, salinity) and NPT inert +! tracers need to be specified here: +! +! LtracerCLM(itemp,ng) for temperature (itemp=1) +! LtracerCLM(isalt,ng) for salinity (isalt=2) +! LtracerCLM(NAT+1,ng) for inert tracer 1 +! ... ... +! LtracerCLM(NAT+NPT,ng) for inert tracer NPT +! +! Other biological and sediment tracers switches are specified +! in their respective input scripts. +! +! These switches also controls which climatology tracer fields +! (specially passive tracers) needs to be processed. So we +! may reduce the memory allocation for the CLIMA(ng)%tclm array. +! +!------------------------------------------------------------------------------ +! Logical switches for nudging to climatology fields. +!------------------------------------------------------------------------------ +! +! LnudgeM2CLM Logical switch (T/F) to activate the nudging of 2D momentum +! climatology. The CPP option M2CLM_NUDGING is now obsolete +! and replaced with this switch to facilitate nesting +! applications. Users also need to TURN ON the logical +! switch "Lm2CLM", described above, to process the required +! 2D momentum climatology data. This data can be set with +! analytical functions (ANA_M2CLIMA) or read from input +! climatology NetCDF file(s). +! +! The nudging coefficients CLIMA(ng)%M2nudgcof can be set +! with analytical functions in "ana_nudgcoef.h" using CPP +! option ANA_NUDGCOEF. Otherwise, it will be read from +! NetCDF file NUDNAME. +! +! LnudgeM3CLM Logical switch (T/F) to activate the nudging of 3D momentum +! climatology. The CPP option M3CLM_NUDGING is now obsolete +! and replaced with this switch to facilitate nesting +! applications. +! +! Users also need to TURN ON the logical switch "Lm3CLM", +! described above, to process the required 3D momentum +! climatology data. This data can be set with analytical +! functions (ANA_M3CLIMA) or read from input climatology +! NetCDF file(s). +! +! The nudging coefficients CLIMA(ng)%M3nudgcof can be set +! with analytical functions in "ana_nudgcoef.h" using CPP +! option ANA_NUDGCOEF. Otherwise, it will be read from +! NetCDF file NUDNAME. +! +! LnudgeTCLM Logical switches (T/F) to activate the nudging of active and +! inert tracer variables climatology. These switches also +! control which tracer variables to nudge. The CPP option +! TCLM_NUDGING is now obsolete and replaced with these +! switches to facilitate nesting applications. +! +! Only NAT active tracers (temperature, salinity) and NPT +! inert tracers need to be specified here: +! +! LnudgeTCLM(itemp,ng) for temperature (itemp=1) +! LnudgeTCLM(isalt,ng) for salinity (isalt=2) +! LnudgeTCLM(NAT+1,ng) for inert tracer 1 +! ... ... +! LnudgeTCLM(NAT+NPT,ng) for inert tracer NPT +! +! Other biological and sediment tracers switches are specified +! in their respective input scripts. +! +! User also needs to TURN ON the respective logical switches +! "LtracerCLM", described above, to process the required 3D +! tracer climatology data. This data can be set with analytical +! functions (ANA_TCLIMA) or read from input climatology +! NetCDF file(s). +! +! The nudging coefficients CLIMA(ng)%Tnudgcof can be set +! with analytical functions in "ana_nudgcoef.h" using CPP +! option ANA_NUDGCOEF. Otherwise, it will be read from +! NetCDF file NUDNAME. +! +!------------------------------------------------------------------------------ +! Adjoint sensitivity parameters. +!------------------------------------------------------------------------------ +! +! DstrS Starting day for adjoint sensitivity forcing. +! +! DendS Ending day for adjoint sensitivity forcing. +! +! The adjoint forcing is applied at every time step according +! to desired state functional stored in the adjoint sensitivity +! NetCDF file. DstrS must be less than or equal to DendS. If +! both values are zero, their values are reset internally to +! the full range of the adjoint integration. +! +! KstrS Starting vertical level of the 3D adjoint state variables whose +! sensitivity is required. +! +! KendS Ending vertical level of the 3D adjoint state variables whose +! sensitivity is required. +! +! Lstate Logical switches (TRUE/FALSE) to specify the adjoint state +! variables whose sensitivity is required. +! +! Lstate(isFsur): Free-surface +! Lstate(isUbar): 2D U-momentum +! Lstate(isVbar): 2D V-momentum +! Lstate(isUvel): 3D U-momentum +! Lstate(isVvel): 3D V-momentum +! Lstate(isWvel): 3D W-momentum +! Lstate(isTvar): Traces (NT values expected) +! +!------------------------------------------------------------------------------ +! Forcing Singular Vectors or Stochastic Optimals parameters. +!------------------------------------------------------------------------------ +! +! Fstate Logical switches (TRUE/FALSE) to specify state variables for +! which Forcing Singular Vectors or Stochastic Optimals is +! required. +! +! Fstate(isFsur): Free-surface +! Fstate(isUbar): 2D U-momentum +! Fstate(isVbar): 2D V-momentum +! Fstate(isUvel): 3D U-momentum +! Fstate(isVvel): 3D V-momentum +! Fstate(isTvar): Traces (NT values expected) +! +! Fstate(isUstr): surface U-stress +! Fstate(isVstr): surface V-stress +! Fstate(isTsur): surface tracers flux (NT values expected) +! +! SO_decay Stochastic Optimals time decorrelation scale (days) assumed +! for red noise processes. +! +! SO_sdev Stochastic Optimals surface forcing standard deviation for +! dimensionalization. +! +! SO_sdev(isFsur): Free-surface +! SO_sdev(isUbar): 2D U-momentum +! SO_sdev(isVbar): 2D V-momentum +! SO_sdev(isUvel): 3D U-momentum +! SO_sdev(isVvel): 3D V-momentum +! SO_sdev(isTvar): Traces (NT values expected) +! +! SO_sdev(isUstr): surface U-stress +! SO_sdev(isVstr): surface V-stress +! SO_sdev(isTsur): surface tracer flux (NT values expected) +! +!------------------------------------------------------------------------------ +! Logical switches (T/F) to activate writing of instantaneous fields into +! HISTORY file. +!------------------------------------------------------------------------------ +! +! Hout(idUvel) Write out 3D U-velocity component. +! Hout(idVvel) Write out 3D V-velocity component. +! Hout(idu3dE) Write out 3D Eastward velocity component at RHO-points. +! Hout(idv3dN) Write out 3D Northward velocity component at RHO-points. +! Hout(idWvel) Write out 3D W-velocity component. +! Hout(idOvel) Write out 3D omega vertical velocity. +! Hout(idUbar) Write out 2D U-velocity component. +! Hout(idVbar) Write out 2D V-velocity component. +! Hout(idu2dE) Write out 2D Eastward velocity component at RHO-points. +! Hout(idv2dN) Write out 2D Northward velocity component at RHO-points. +! Hout(idFsur) Write out free-surface. +! Hout(idBath) Write out time-dependent bathymetry. +! +! Hout(idTvar) Write out active (NAT) tracers: temperature and salinity. +! +! Hout(idpthR) Write out time-varying depths of RHO-points. +! Hout(idpthU) Write out time-varying depths of U-points. +! Hout(idpthV) Write out time-varying depths of V-points. +! Hout(idpthW) Write out time-varying depths of W-points. +! +! Hout(idUsms) Write out surface U-momentum stress. +! Hout(idVsms) Write out surface V-momentum stress. +! Hout(idUbms) Write out bottom U-momentum stress. +! Hout(idVbms) Write out bottom V-momentum stress. +! +! Hout(idUbrs) Write out current-induced, U-momentum stress. +! Hout(idVbrs) Write out current-induced, V-momentum stress. +! Hout(idUbws) Write out wind-induced, bottom U-wave stress. +! Hout(idVbws) Write out wind-induced, bottom V-wave stress. +! Hout(idUbcs) Write out bottom maximum wave and current U-stress. +! Hout(idVbcs) Write out bottom maximum wave and current V-stress. +! +! Hout(idUbot) Write out wind-induced, bed wave orbital U-velocity. +! Hout(idVbot) Write out wind-induced, bed wave orbital V-velocity. +! Hout(idUbur) Write out bottom U-velocity above bed. +! Hout(idVbvr) Write out bottom V-velocity above bed. +! +! Hout(idW2xx) Write out 2D radiation stress, Sxx component. +! Hout(idW2xy) Write out 2D radiation stress, Sxy component. +! Hout(idW2yy) Write out 2D radiation stress, Syy component. +! Hout(idU2rs) Write out 2D U-radiation stress. +! Hout(idV2rs) Write out 2D V-radiation stress. +! Hout(idU2Sd) Write out 2D U-Stokes velocity. +! Hout(idV2Sd) Write out 2D V-Stokes velocity. +! +! Hout(idW3xx) Write out 3D radiation stress, Sxx component. +! Hout(idW3xy) Write out 3D radiation stress, Sxy component. +! Hout(idW3yy) Write out 3D radiation stress, Syy component. +! Hout(idW3zx) Write out 3D radiation stress, Szx component. +! Hout(idW3zy) Write out 3D radiation stress, Szy component. +! Hout(idU3rs) Write out 3D U-radiation stress. +! Hout(idV3rs) Write out 3D V-radiation stress. +! Hout(idU3Sd) Write out 3D U-Stokes velocity. +! Hout(idV3Sd) Write out 3D V-Stokes velocity. +! +! Hout(idWamp) Write out wave height. +! Hout(idWlen) Write out wave length. +! Hout(idWdir) Write out wave direction. +! Hout(idWptp) Write out wave surface period. +! Hout(idWpbt) Write out wave bottom period. +! Hout(idWorb) Write out wave bottom orbital velocity. +! Hout(idWdis) Write out wave dissipation. +! +! Hout(idPair) Write out surface air pressure. +! Hout(idTair) Write out surface air temperature. +! Hout(idUair) Write out surface U-wind component. +! Hout(idVair) Write out surface V-wind component. +! +! Hout(idTsur) Write out surface net heat and salt flux +! Hout(idLhea) Write out latent heat flux. +! Hout(idShea) Write out sensible heat flux. +! Hout(idLrad) Write out long-wave radiation flux. +! Hout(idSrad) Write out short-wave radiation flux. +! Hout(idEmPf) Write out E-P flux. +! Hout(idevap) Write out evaporation rate. +! Hout(idrain) Write out precipitation rate. +! +! Hout(idDano) Write out density anomaly. +! Hout(idVvis) Write out vertical viscosity coefficient. +! Hout(idTdif) Write out vertical diffusion coefficient of temperature. +! Hout(idSdif) Write out vertical diffusion coefficient of salinity. +! Hout(idHsbl) Write out depth of oceanic surface boundary layer. +! Hout(idHbbl) Write out depth of oceanic bottom boundary layer. +! Hout(idMtke) Write out turbulent kinetic energy. +! Hout(idMtls) Write out turbulent kinetic energy times length scale. +! +! Hout(inert) Write out extra inert passive tracers. +! +!------------------------------------------------------------------------------ +! Logical switches (T/F) to activate writing of instantaneous fields into +! QUICKSAVE file. +!------------------------------------------------------------------------------ +! +! Qout(idUvel) Write out 3D U-velocity component. +! Qout(idVvel) Write out 3D V-velocity component. +! Qout(idu3dE) Write out 3D Eastward velocity component at RHO-points. +! Qout(idv3dN) Write out 3D Northward velocity component at RHO-points. +! Qout(idWvel) Write out 3D W-velocity component. +! Qout(idOvel) Write out 3D omega vertical velocity. +! Qout(idUbar) Write out 2D U-velocity component. +! Qout(idVbar) Write out 2D V-velocity component. +! Qout(idu2dE) Write out 2D Eastward velocity component at RHO-points. +! Qout(idv2dN) Write out 2D Northward velocity component at RHO-points. +! Qout(idFsur) Write out free-surface. +! Qout(idBath) Write out time-dependent bathymetry. +! +! Qout(idTvar) Write out active (NAT) tracers: temperature and salinity. +! +! Qout(idUsur) Write out surface U-velocity component. +! Qout(idVsur) Write out surface V-velocity component. +! Qout(idUsuE) Write out surface Eastward velocity component at RHO-points. +! Qout(idVsuN) Write out surface Northward velocity component at RHO-points. +! +! Qout(idsurT) Write out surface temperature and salinity +! +! Qout(idpthR) Write out time-varying depths of RHO-points. +! Qout(idpthU) Write out time-varying depths of U-points. +! Qout(idpthV) Write out time-varying depths of V-points. +! Qout(idpthW) Write out time-varying depths of W-points. +! +! Qout(idUsms) Write out surface U-momentum stress. +! Qout(idVsms) Write out surface V-momentum stress. +! Qout(idUbms) Write out bottom U-momentum stress. +! Qout(idVbms) Write out bottom V-momentum stress. +! +! Qout(idUbrs) Write out current-induced, U-momentum stress. +! Qout(idVbrs) Write out current-induced, V-momentum stress. +! Qout(idUbws) Write out wind-induced, bottom U-wave stress. +! Qout(idVbws) Write out wind-induced, bottom V-wave stress. +! Qout(idUbcs) Write out bottom maximum wave and current U-stress. +! Qout(idVbcs) Write out bottom maximum wave and current V-stress. +! +! Qout(idUbot) Write out wind-induced, bed wave orbital U-velocity. +! Qout(idVbot) Write out wind-induced, bed wave orbital V-velocity. +! Qout(idUbur) Write out bottom U-velocity above bed. +! Qout(idVbvr) Write out bottom V-velocity above bed. +! +! Qout(idW2xx) Write out 2D radiation stress, Sxx component. +! Qout(idW2xy) Write out 2D radiation stress, Sxy component. +! Qout(idW2yy) Write out 2D radiation stress, Syy component. +! Qout(idU2rs) Write out 2D U-radiation stress. +! Qout(idV2rs) Write out 2D V-radiation stress. +! Qout(idU2Sd) Write out 2D U-Stokes velocity. +! Qout(idV2Sd) Write out 2D V-Stokes velocity. +! +! Qout(idW3xx) Write out 3D radiation stress, Sxx component. +! Qout(idW3xy) Write out 3D radiation stress, Sxy component. +! Qout(idW3yy) Write out 3D radiation stress, Syy component. +! Qout(idW3zx) Write out 3D radiation stress, Szx component. +! Qout(idW3zy) Write out 3D radiation stress, Szy component. +! Qout(idU3rs) Write out 3D U-radiation stress. +! Qout(idV3rs) Write out 3D V-radiation stress. +! Qout(idU3Sd) Write out 3D U-Stokes velocity. +! Qout(idV3Sd) Write out 3D V-Stokes velocity. +! +! Qout(idWamp) Write out wave height. +! Qout(idWlen) Write out wave length. +! Qout(idWdir) Write out wave direction. +! Qout(idWptp) Write out wave surface period. +! Qout(idWpbt) Write out wave bottom period. +! Qout(idWorb) Write out wave bottom orbital velocity. +! Qout(idWdis) Write out wave dissipation. +! +! Qout(idPair) Write out surface air pressure. +! Qout(idTair) Write out surface air temperature. +! Qout(idUair) Write out surface U-wind component. +! Qout(idVair) Write out surface V-wind component. +! +! Qout(idTsur) Write out surface net heat and salt flux +! Qout(idLhea) Write out latent heat flux. +! Qout(idShea) Write out sensible heat flux. +! Qout(idLrad) Write out long-wave radiation flux. +! Qout(idSrad) Write out short-wave radiation flux. +! Qout(idEmPf) Write out E-P flux. +! Qout(idevap) Write out evaporation rate. +! Qout(idrain) Write out precipitation rate. +! +! Qout(idDano) Write out density anomaly. +! Qout(idVvis) Write out vertical viscosity coefficient. +! Qout(idTdif) Write out vertical diffusion coefficient of temperature. +! Qout(idSdif) Write out vertical diffusion coefficient of salinity. +! Qout(idHsbl) Write out depth of oceanic surface boundary layer. +! Qout(idHbbl) Write out depth of oceanic bottom boundary layer. +! Qout(idMtke) Write out turbulent kinetic energy. +! Qout(idMtls) Write out turbulent kinetic energy times length scale. +! +! Qout(inert) Write out inert passive tracers. +! Qout(Snert) Write out surface inert passive tracers. +! +!------------------------------------------------------------------------------ +! Logical switches (T/F) to activate writing of time-averaged fields into +! AVERAGE file. +!------------------------------------------------------------------------------ +! +! Aout(idUvel) Write out 3D U-velocity component. +! Aout(idVvel) Write out 3D V-velocity component. +! Aout(idu3dE) Write out 3D Eastward velocity component at RHO-points. +! Aout(idv3dN) Write out 3D Northward velocity component at RHO-points. +! Aout(idWvel) Write out 3D W-velocity component. +! Aout(idOvel) Write out 3D omega vertical velocity. +! Aout(idUbar) Write out 2D U-velocity component. +! Aout(idVbar) Write out 2D V-velocity component. +! Aout(idu2dE) Write out 2D Eastward velocity component at RHO-points. +! Aout(idv2dN) Write out 2D Northward velocity component at RHO-points. +! Aout(idFsur) Write out free-surface. +! +! Aout(idTvar) Write out active (NAT) tracers: temperature and salinity. +! +! Aout(idUsms) Write out surface U-momentum stress. +! Aout(idVsms) Write out surface V-momentum stress. +! Aout(idUbms) Write out bottom U-momentum stress. +! Aout(idVbms) Write out bottom V-momentum stress. +! +! Aout(idW2xx) Write out 2D radiation stress, Sxx component. +! Aout(idW2xy) Write out 2D radiation stress, Sxy component. +! Aout(idW2yy) Write out 2D radiation stress, Syy component. +! Aout(idU2rs) Write out 2D U-radiation stress. +! Aout(idV2rs) Write out 2D V-radiation stress. +! Aout(idU2Sd) Write out 2D U-Stokes velocity. +! Aout(idV2Sd) Write out 2D V-Stokes velocity. +! +! Aout(idW3xx) Write out 3D radiation stress, Sxx component. +! Aout(idW3xy) Write out 3D radiation stress, Sxy component. +! Aout(idW3yy) Write out 3D radiation stress, Syy component. +! Aout(idW3zx) Write out 3D radiation stress, Szx component. +! Aout(idW3zy) Write out 3D radiation stress, Szy component. +! Aout(idU3rs) Write out 3D U-radiation stress. +! Aout(idV3rs) Write out 3D V-radiation stress. +! Aout(idU3Sd) Write out 3D U-Stokes velocity. +! Aout(idV3Sd) Write out 3D V-Stokes velocity. +! +! Aout(idPair) Write out surface air pressure. +! Aout(idTair) Write out surface air temperature. +! Aout(idUair) Write out surface U-wind component. +! Aout(idVair) Write out surface V-wind component. +! +! Aout(idTsur) Write out surface net heat and salt flux +! Aout(idLhea) Write out latent heat flux. +! Aout(idShea) Write out sensible heat flux. +! Aout(idLrad) Write out long-wave radiation flux. +! Aout(idSrad) Write out short-wave radiation flux. +! Aout(idevap) Write out evaporation rate. +! Aout(idrain) Write out precipitation rate. +! +! Aout(idDano) Write out density anomaly. +! Aout(idVvis) Write out vertical viscosity coefficient. +! Aout(idTdif) Write out vertical diffusion coefficient of temperature. +! Aout(idSdif) Write out vertical diffusion coefficient of salinity. +! Aout(idHsbl) Write out depth of oceanic surface boundary layer. +! Aout(idHbbl) Write out depth of oceanic bottom boundary layer. +! +! Aout(id2dRV) Write out 2D relative vorticity (vertically integrated). +! Aout(id3dRV) Write out 3D relative vorticity. +! Aout(id2dPV) Write out 2D potential vorticity (shallow water). +! Aout(id3dPV) Write out 3D potential vorticity. +! +! Aout(idu3dD) Write out detided 3D U-velocity. +! Aout(idv3dD) Write out detided 3D V-velocity. +! Aout(idu2dD) Write out detided 2D U-velocity. +! Aout(idv2dD) Write out detided 2D V-velocity. +! Aout(idFsuD) Write out detided free-surface +! +! Aout(idTrcD) Write out detided temperature and salinity. +! +! Aout(idHUav) Write out u-volume flux, Huon. +! Aout(idHVav) Write out v-volume flux, Hvom. +! Aout(idUUav) Write out quadratic term. +! Aout(idUVav) Write out quadratic term. +! Aout(idVVav) Write out quadratic term. +! Aout(idU2av) Write out quadratic term. +! Aout(idV2av) Write out quadratic term. +! Aout(idZZav) Write out quadratic term. +! +! Aout(idTTav) Write out quadratic active and inert tracers terms. +! Aout(idUTav) Write out quadratic active and inert tracers terms. +! Aout(idVTav) Write out quadratic active and inert tracers terms. +! Aout(iHUTav) Write out active and inert tracer u-volume flux, . +! Aout(iHVTav) Write out active and inert tracer v-volume flux, . +! +! Aout(inert) Write out extra inert passive tracers. +! +!------------------------------------------------------------------------------ +! Logical switches (T/F) to activate writing of time-averaged fields into +! DIAGNOSTIC file. +!------------------------------------------------------------------------------ +! +! Time-averaged, 2D momentum (ubar,vbar) diagnostic terms: +! (if DIAGNOSTICS_UV) +! +! Dout(M2rate) Write out acceleration. +! Dout(M2pgrd) Write out pressure gradient. +! Dout(M2fcor) Write out Coriolis force, if UV_COR. +! Dout(M2hadv) Write out horizontal total advection, if UV_ADV. +! Dout(M2xadv) Write out horizontal XI-advection, if UV_ADV. +! Dout(M2yadv) Write out horizontal ETA-advection, if UV_ADV. +! Dout(M2hrad) Write out horizontal total radiation stress, NEARSHORE_MELLOR. +! Dout(M2hvis) Write out horizontal total viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M2xvis) Write out horizontal XI-viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M2yvis) Write out horizontal ETA-viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M2sstr) Write out surface stress. +! Dout(M2bstr) Write out bottom stress +! +! Time-averaged, 3D momentum (u,v) diagnostic terms: +! (if SOLVE3D and DIAGNOSTICS_UV) +! +! Dout(M3rate) Write out acceleration. +! Dout(M3pgrd) Write out pressure gradient. +! Dout(M3fcor) Write out Coriolis force, if UV_COR. +! Dout(M3hadv) Write out horizontal total advection, if UV_ADV. +! Dout(M3xadv) Write out horizontal XI-advection, if UV_ADV. +! Dout(M3yadv) Write out horizontal ETA-advection, if UV_ADV. +! Dout(M3hrad) Write out horizontal total radiation stress, NEARSHORE_MELLOR. +! Dout(M3vrad) Write out vertical radiation stress, if NEARSHORE_MELLOR. +! Dout(M3hvis) Write out horizontal total viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M3xvis) Write out horizontal XI-viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M3yvis) Write out horizontal ETA-viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M3yvis) Write out horizontal ETA-viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M3vvis) Write out vertical viscosity. +! +! Time-averaged, active (temperature and salinity) and passive (inert) tracer +! diagnostic terms, [1:NAT+NPT,Ngrids] values expected: +! (if SOLVE3D and DIAGNOSTICS_TS) +! +! Dout(iTrate) Write out time rate of change. +! Dout(iThadv) Write out horizontal total advection. +! Dout(iTxadv) Write out horizontal XI-advection. +! Dout(iTyadv) Write out horizontal ETA-advection. +! Dout(iTvadv) Write out vertical advection. +! Dout(iThdif) Write out horizontal total diffusion, if TS_DIF2 or TS_DIF4. +! Dout(iTxdif) Write out horizonta1 XI-diffusion, if TS_DIF2 or TS_DIF4. +! Dout(iTydif) Write out horizontal ETA-diffusion, if TS_DIF2 or TS_DIF4. +! Dout(iTsdif) Write out horizontal S-diffusion, if TS_DIF2 or TS_DIF4 and +! rotated tensor (MIX_GEO_TS or MIX_ISO_TS). +! Dout(iTvdif) Write out vertical diffusion. +! +!------------------------------------------------------------------------------ +! Generic User parameters. +!------------------------------------------------------------------------------ +! +! NUSER Number of User parameters to consider (integer). +! +! USER Vector containing user parameters (real array). This array +! is used with the SANITY_CHECK to test the correctness of +! the tangent linear adjoint models. It contains information +! of the model variable and grid point to perturb: +! +! INT(user(1)): tangent state variable to perturb +! INT(user(2)): adjoint state variable to perturb +! [isFsur=1] free-surface +! [isUbar=2] 2D U-momentum +! [isVbar=3] 2D V-momentum +! [isUvel=4] 3D U-momentum +! [isVvel=5] 3D V-momentum +! [isTvar=6] First tracer (temperature) +! [ ... ] +! [isTvar=?] Last tracer +! +! INT(user(3)): I-index of tangent variable to perturb +! INT(user(4)): I-index of adjoint variable to perturb +! INT(user(5)): J-index of tangent variable to perturb +! INT(user(6)): J-index of adjoint variable to perturb +! INT(user(7)): K-index of tangent variable to perturb, if 3D +! INT(user(8)): K-index of adjoint variable to perturb, if 3D +! +! Set tangent and adjoint parameters to the same values +! if perturbing and reporting the same variable. +! +!------------------------------------------------------------------------------ +! I/O options and parameters. A more complete description of the available +! options can be found in WikiROMS (https://myroms.org/wiki/IO). +!------------------------------------------------------------------------------ +! +! The ROMS input and output NetCDF files can be processed using the standard +! NetCDF library developed by UNIDATA, the Parallel-IO (PIO) library developed +! at NCAR, or the SCORPIO library available in E3SM (Sreepathi et al., 2013; +! doi:10.1109/HiPC.2013.6799128). The SCORPIO library was forked from the PIO +! library several years ago, and they have evolved separately. In addition to +! the standard NetCDF library, ROMS can be compiled with either the PIO or +! SCORPIO libraries. Check www.myroms.org/wiki/External_Libraries for more +! information on how to obtain and install these libraries. The user has the +! choice to select which library is used to process input and output NetCDF +! files. For parallel I/O, we recommend using the PIO library because it is +! more efficient than the SCORPIO library in our benchmark tests. +! +! The Parallel I/O using the PIO or SCORPIO libraries is restricted to +! distributed-memory applications because it uses MPI-IO implementations +! like ROMIO. +! +! * ROMS Input and Output NetCDF library to use flag: [1 or 2] +! +! [1] Standard NetCDF3 or NetCDF4 library (Unidata) +! [2] Serial/Parallel I/O using Paralle-IO (PIO) library (MPI applications) +! +! INP_LIB Reading library flag for input NetCDF files +! +! OUT_LIB Creation/writing library flag for output NetCDF files +! +! * PIO method flag for reading/writing NetCDF files: [0,1,2,3,4] +! +! [0] parallel read and write of PnetCDF files (CDF-5 type) +! [1] parallel read and write of PnetCDF files (NetCDF3 64-bit offset type) +! [2] serial read and write of NetCDF3 files (NetCDF3 64-bit offset type) +! [3] parallel read and serial write of NetCDF4/HDF5 files (NetCDF4 type) +! [4] parallel read and write of NETCDF4/HDF5 files (NetCDF4 type) +! +! PIO_METHOD PIO library file type for reading or writing. Depending on +! the build of the PIO library, not all the I/O types are +! available. If NetCDF library does not support parallel I/O, +! PIO_METHOD=3,4 are not available. Notice that we can create +! CDF-5 type PnetCDF files (PIO_METHOD=0), but it is not +! recommended because portability and post-processing +! constraints. Currently, NetCDF4/HDF5 data compression is +! possible with PIO_METHOD=3 during serial write. +! +! * PIO library processes set-up: +! +! PIO_IOTASKS Number of MPI processors used for I/O. If I/O decomposition is +! identical to the computational decomposition, PIO_IOTASK is +! equal to NtileI*NtileJ. Typically, it is advantageous and +! highly recommended to define the I/O decomposition in smaller +! number of processes for efficiency and to avoid MPI +! communication bottlenecks. +! +! PIO_STRIDE Stride step in the MPI-rank between I/O tasks. +! +! PIO_BASE Offset for the first I/O task (usually, PIO_BASE=1). +! +! PIO_AGGREG Number of MPI-aggregators to use in intra-communication mode to +! improve MPI collective I/O performance. +! +! In intra-communications mode, all processors in OCN_COMM_WORLD +! are involved in computations. A subset or all processors does +! I/O (and also computations). The PIO_IOTASKS and PIO_STRIDE +! parameters specify the total number of I/O tasks and the stride +! between them with respect to the ROMS MPI-communicator object, +! OCN_COMM_WORLD. The optional PIO_BASE parameter is used to shift +! the first I/O task away from the first computational task. This +! is often desirable because the application's first computational +! task usually has higher memory requirements than other processes. +! If the MPI-processes are spread over several hardware nodes, it +! is highly recommended to use a value for PIO_STRIDE that scatters +! the I/O processes over all nodes. Avoid all the I/O processes +! occupying the same node. +! +! In the inter-communications (asynchronous) mode, the I/O tasks +! are a disjointed set of dedicated I/O processes and do not +! perform computations. It is possible to have several groups of +! computational units running separate models (coupling) where +! all the I/O data are sent to dedicated processes. Asynchronous +! I/O is still under development and not recommended for use at +! this time. +! +! +! * PIO rearranger methods for moving data between computational and I/O +! processes: +! +! [1] Box rearrangement +! [2] Subset rearrangement +! +! PIO_REARR Rearrangement method between computational and I/O processes. It +! provides the ability to rearrange data between computational +! and parallel I/O decompositions. +! +! In the box method, data is rearranged from computational to I/O +! processes in a continuous manner to the data ordering in the +! file. Since the ordering of data between computational and I/O +! partitions may be different, the rearrangement will require +! all-to-all MPI communications. Also, notice that each computing +! tile may transfer data to one or more I/O processes. +! +! In the subset method, each I/O process is associated with a +! subset of computing processes. The computing tile sends its data +! to a unique I/O process. The data on I/O processes may be more +! fragmented to the ordering on disk, which may increase the +! communications to the storage medium. However, the rearrangement +! scales better since all-to-all MPI communications are not +! required. +! +! * PIO rearranger MPI communication flag: +! +! [0] Point-to-Point (basic send/receive individual operations) +! [1] Collective (high-level gather/scatter grouped operations) +! +! PIO_REARRCOM Type of communications between computational to I/O processes. +! In some systems with a generic MPI library implementation, the +! Point-to-Point communications are more efficient. +! +! * PIO rearranger MPI communications direction control flag: +! +! [0] Enable computational to I/O processes, and vice versa +! [1] Enable computational to I/O processes only +! [2] Enable I/O to computational processes only +! [3] Disable flow control +! +! PIO_REARRDIR Flow control algorithm between computational and I/O processes: +! +! Optimally, MPI communications should be designed to send a modest +! number messages evenly distributed across a number of processes. +! An excessive number of messages to a single MPI-process can +! exhaust the buffer space which can affect efficiency or failure +! due to the slowdown in the retransmitting of dropped messages. +! PIO only send messages (Isend) when the receiver is ready and +! has sufficient resources. +! +! * PIO rearranger options for communications from computational to I/O +! processes (C2I): +! +! PIO_C2I_HS Logical switch (T/F) to enable C2I exchange handshake +! PIO_C2I_Send Logical switch (T/F) to enable C2I MPI-Isends +! PIO_C2I_Preq Maximum pending C2I requests +! +! * PIO rearranger options for communications from I/O to computational +! processes (I2C): +! +! PIO_I2C_HS Logical switch (T/F) to enable I2C exchange handshake +! PIO_I2C_Send Logical switch (T/F) to enable I2C MPI-Isends +! PIO_I2C_Preq Maximum pending I2C requests +! +! * NetCDF-4/HDF5 compression parameters for output files: +! +! This capability is used when both HDF5 and DEFLATE C-preprocessing +! options are activated. The user needs to compile with the NetCDF-4 +! (HDF5) and MPI libraries. File deflation cannot be used in parallel +! I/O for writing because the compression makes it impossible for the +! HDF5 library to exactly map the data to the disk location. For more +! information, check NetCDF official website: +! +! www.unidata.ucar.edu/software/netcdf +! +! NC_SHUFFLE Shuffle filter integer flag. If non-zero, turn on shuffle +! filter. +! +! NC_DEFLATE Deflate filter integer flag, If non-zero, turn on deflate +! filter at the level specified by the NC_DLEVEL parameter. +! +! NC_DLEVEL Deflate filter level parameter (integer). If NC_DEFLATE is +! non-zero, set the deflate level to this value. Must be +! between 0 and 9. +! +!------------------------------------------------------------------------------ +! Input/output NetCDF filenames (string with a maximum of 256 characters). +!------------------------------------------------------------------------------ +! +! Input filenames: +! +! GRDNAME Input grid filename. +! +! ININAME Input nonlinear initial conditions filename. It can be a +! re-start file. +! +! ITLNAME Input tangent linear model initial conditions filename. +! +! IRPNAME Input representer model initial conditions filename. +! +! IADNAME Input adjoint model initial conditions filename. +! +! FWDNAME Input forward solution fields filename. +! +! ADSNAME Input adjoint sensitivity functional filename. +! +! +! Input adjoint forcing filenames for computing observations impacts +! during the analysis-forecast cycle when RBL4DVAR_FCT_SENSITIVITY is +! activated. The files FOInameA and FOInameB are used when the forecast +! metric is defined in state-space (CPP option OBS_SPACE is off). Both +! are regular adjoint forcing files just like ADSname. +! +! (See www.myroms.org/wiki/Analysis-Forecast_Cycle_Observation_Impacts) +! +! FOInameA Forecast initialized with 4D-Var analysis (red curve) +! +! FOInameB Forecast initialized with 4D_Var background (blue curve) +! +! +! Input NetCDF filenames for the forecasts initialized from the 4D-Var +! analysis files: +! +! FCTnameA Current 4D-Var analysis cycle (red curve) +! +! FCTnameB Previous 4D-Var analysis cycle (blue curve) +! +! +! Nesting grids connectivity data: +! +! NGCNAME Input nested grids contact points information filename. This +! NetCDF file is currently generated using script: +! +! matlab/grid/contact.m +! +! from the ROMS Matlab repository. The nesting information +! is not trivial and this Matlab scripts is quite complex. See +! +! https://www.myroms.org/wiki/index.php/Nested_Grids +! https://www.myroms.org/wiki/index.php/Grid_Processing_Scripts +! +! for more information. +! +! +! Input lateral boundary conditions file(s) name: +! +! NBCFILES Number of unique boundary files per nested grid. +! +! BRYNAME Input open boundary data filename(s) per nested grid. +! +! The USER has the option to enter several filenames for the lateral +! boundary conditions variables and or split input data time records for +! each nested grid. For example, the USER may have different files for +! physical, biology, and sediment state variables. The model will scan +! the file list and will read the needed data from the first file in the +! list containing the lateral boundary variable. Therefore, the order of +! the filenames is critical. It is also possible to split input data +! time records into several NetCDF files. +! +! NBCFILES == 2 ! number of boundary files +! +! BRYNAME == my_physics_bry_year1.nc | ! physical kernel variables +! my_physics_bry_year2.nc \ +! my_biology_bry_year1.nc | ! biological tracers +! my_biology_bry_year2.nc +! +! +! Input climatology file(s) name: +! +! NCLMFILES Number of unique climatology files per nested grid. +! +! CLMNAME Input climatology data filename(s) per nested grid. +! +! The USER has the option to enter several filenames for the climatology +! variables and or split input data time records for each nested grid. +! For example, the USER may have different files for physical, biology, +! and sediment state variables. The model will scan the file list and +! will read the needed data from the first file in the list containing +! the lateral climatology variable. Therefore, the order of the filenames +! is critical. It is also possible to split input data time records into +! several NetCDF files. +! +! NCLMFILES == 2 ! number of climatology files +! +! CLMNAME == my_physics_clm_year1.nc | ! physical kernel variables +! my_physics_bry_year2.nc \ +! my_biology_bry_year1.nc | ! biological tracers +! my_biology_bry_year2.nc +! +! +! Input nudging coefficients filename: +! +! NUDNAME Input nudging coefficients filename. +! +! +! Input Sources/Sinks forcing filename: +! +! SSFNAME River runoff data. This file is now separated from the +! regular forcing files to allow manipulations over nested +! grids. A particular nesting grid may or may not have +! Sources/Sinks forcing. +! +! For example, in an application with 3 nested grids but +! with river forcing in grids 1 and 3 we would have: +! +! LuvSrc == T F T +! LtracerSrc == 2*T 2*F 2*T +! +! SSFNAME == my_rivers_grid1.nc \ +! my_rivers_grid2.nc \ +! my_rivers_grid3.nc +! +! Here, "my_rivers_grid2.nc" is a dummy name that will never +! be processed in ROMS because of the logical switches are +! FALSE the second grid. +! +! +! Input/output tidal forcing filename: +! +! TIDENAME Tidal constituents period, phase, elevation, and current data. +! This data is needed when SSH_TIDES, UV_TIDES, or both are +! activated to force tides at the open boundaries. Currently, +! in nested applications, the tidal forcing is used in the +! coarser/larger grid (ng=1). If AVERAGES_DETIDE is activated, +! several least-squares time-accumulated harmonic variables +! are written into this NetCDF file to facilitate restart for +! during long fitting simulations. +! +! +! Input forcing file(s) name: +! +! NFFILES Number of unique forcing files per nested grid. +! +! FRCNAME Input forcing fields filename per nested grid. +! +! The USER has the option to enter several filenames for forcing fields +! and or split input data time records for each nested grid. For example, +! the USER may have different files for wind products, heat fluxes, etc. +! The model will scan the file list and will read the needed data from +! the first file in the list containing the forcing field. Therefore, +! the order of the filenames is essential. It is also possible to split +! input data time records into several NetCDF files. +! +! Use a single line per entry with a continuation (\) or vertical bar (|) +! symbol after each entry, except the last one: +! +! NFFILES == 6 ! number of unique forcing files +! +! FRCNAME == my_lwrad_year1.nc | ! net longwave radiation flux +! my_lwrad_year2.nc \ +! my_swrad_year1.nc | ! solar shortwave radiation flux +! my_swrad_year2.nc \ +! my_winds_year1.nc | ! surface winds +! my_winds_year2.nc \ +! my_Pair_year1.nc | ! surface air pressure +! my_Pair_year2.nc \ +! my_Qair_year1.nc | ! surface air relative humidity +! my_Qair_year2.nc \ +! my_Tair_year1.nc | ! surface air temperature +! my_Tair_year2.nc +! +! +! Output filenames: +! +! DAINAME Output data assimilation next cycle initial conditions (4D-Var +! analysis) or restart (Ensemble Kalman Filter, EnKF) filename. +! GSTNAME Output GST analysis re-start filename. +! RSTNAME Output re-start filename. +! HISNAME Output history filename. +! QCKNAME Output quicksave filename. +! TLFNAME Output impulse forcing for tangent linear (TLM and RPM) models. +! TLMNAME Output tangent linear filename. +! ADJNAME Output adjoint filename. +! AVGNAME Output averages filename. +! HARNAME Output least-squares detiding harmonics filename. +! DIANAME Output diagnostics filename. +! STANAME Output stations filename. +! FLTNAME Output floats filename. +! +!------------------------------------------------------------------------------ +! Input ASCII parameters filenames. +!------------------------------------------------------------------------------ +! +! APARNAM Input assimilation parameters filename. +! SPOSNAM Input stations positions filename. +! FPOSNAM Input initial drifters positions filename. +! BPARNAM Input biological parameters filename. +! SPARNAM Input sediment transport parameters filename. +! USRNAME USER's input generic filename. +! diff --git a/cloudflow/job/templates/liveocean.cas7_t0_x4b-dt30.in b/cloudflow/job/templates/liveocean.cas7_t0_x4b-dt30.in index c2482ec..0146b1f 100644 --- a/cloudflow/job/templates/liveocean.cas7_t0_x4b-dt30.in +++ b/cloudflow/job/templates/liveocean.cas7_t0_x4b-dt30.in @@ -1034,7 +1034,7 @@ PIO_I2C_Preq = 65 ! Maximum pending I2C requests ! Input Sources/Sinks forcing (like river runoff) file name. - SSFNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/traps00/rivers.nc + SSFNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/__TRAPSDIR__/rivers.nc ! Input tidal forcing file name. diff --git a/cloudflow/job/templates/liveocean.cas7_t0_x4b-dt40.in b/cloudflow/job/templates/liveocean.cas7_t0_x4b-dt40.in index d2d97db..d45b732 100644 --- a/cloudflow/job/templates/liveocean.cas7_t0_x4b-dt40.in +++ b/cloudflow/job/templates/liveocean.cas7_t0_x4b-dt40.in @@ -1033,7 +1033,7 @@ PIO_I2C_Preq = 65 ! Maximum pending I2C requests ! Input Sources/Sinks forcing (like river runoff) file name. - SSFNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/traps00/rivers.nc + SSFNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/__TRAPSDIR__/rivers.nc ! Input tidal forcing file name. diff --git a/cloudflow/job/templates/liveocean.cas7_t0_x4b.in b/cloudflow/job/templates/liveocean.cas7_t0_x4b.in index d2d97db..d45b732 100644 --- a/cloudflow/job/templates/liveocean.cas7_t0_x4b.in +++ b/cloudflow/job/templates/liveocean.cas7_t0_x4b.in @@ -1033,7 +1033,7 @@ PIO_I2C_Preq = 65 ! Maximum pending I2C requests ! Input Sources/Sinks forcing (like river runoff) file name. - SSFNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/traps00/rivers.nc + SSFNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/__TRAPSDIR__/rivers.nc ! Input tidal forcing file name. diff --git a/cloudflow/job/templates/liveocean.cas7_t0_x4b.saved b/cloudflow/job/templates/liveocean.cas7_t0_x4b.saved new file mode 100644 index 0000000..85982b1 --- /dev/null +++ b/cloudflow/job/templates/liveocean.cas7_t0_x4b.saved @@ -0,0 +1,3274 @@ +! +! ROMS/TOMS Standard Input parameters. +! +!svn $Id: roms_upwelling.in 1087 2021-09-10 01:11:17Z arango $ +!========================================================= Hernan G. Arango === +! Copyright (c) 2002-2021 The ROMS/TOMS Group ! +! Licensed under a MIT/X style license ! +! See License_ROMS.txt ! +!============================================================================== +! ! +! Input parameters can be entered in ANY order, provided that the parameter ! +! KEYWORD (usually, upper case) is typed correctly followed by "=" or "==" ! +! symbols. Any comment lines are allowed and must begin with an exclamation ! +! mark (!) in column one. Comments may appear to the right of a parameter ! +! specification to improve documentation. Comments are ignored during ! +! reading. Blank lines are also allowed and ignored. Continuation lines in ! +! a parameter specification are allowed if preceded by a backslash (\). In ! +! some instances, more than one value is required for a parameter. If fewer ! +! values are provided, the last value is assigned for the entire parameter ! +! array. The multiplication symbol (*), without blank spaces in between, ! +! is allowed for a parameter specification. For example, in two grids nested ! +! application: ! +! ! +! AKT_BAK == 2*1.0d-6 2*5.0d-6 ! m2/s ! +! ! +! indicates that the first two entries of array AKT_BAK, in fortran column- ! +! major order, will have the same value of "1.0d-6" for grid 1, whereas the ! +! next two entries will have the same value of "5.0d-6" for grid 2. ! +! ! +! In multiple levels of nesting or multiple connected domains step-ups, ! +! "Ngrids" entries are expected for some of these parameters. In such case, ! +! the order of the entries for a parameter is critical. It must follow the ! +! same order (1:Ngrids) as in the state variable declaration. The USER may ! +! follow the above guidelines for specifying his/her values. These parameters ! +! are marked by "==" plural symbol after the KEYWORD. ! +! ! +! Multiple NetCDF files are allowed for input field(s). It is useful when ! +! splitting input data (climatology, boundary, forcing) time records into ! +! several files (say monthly, annual, etc.). In this case, each multiple ! +! filename entry lines need to end with the vertical bar (|) symbol. For ! +! example: ! +! ! +! NFFILES == 6 ! number of forcing files ! +! ! +! FRCNAME == my_lwrad_year1.nc | ! +! my_lwrad_year2.nc \ ! +! my_swrad_year1.nc | ! +! my_swrad_year2.nc \ ! +! my_winds_year1.nc | ! +! my_winds_year2.nc \ ! +! my_Pair_year1.nc | ! +! my_Pair_year2.nc \ ! +! my_Qair_year1.nc | ! +! my_Qair_year2.nc \ ! +! my_Tair_year1.nc | ! +! my_Tair_year2.nc ! +! ! +! Notice that NFFILES is 6 and not 12. There are 6 uniquely different fields ! +! in the file list, we DO NOT count file entries followed by the vertical ! +! bar symbol. This is because multiple file entries are processed in ROMS ! +! with derived type structures. ! +! ! +!============================================================================== +! +! Application title. + + TITLE = LiveOcean input file + +! C-preprocessing Flag. + + MyAppCPP = X4B + +! Input variable information file name. This file needs to be processed +! first so all information arrays can be initialized properly. + + VARNAME = __SAVE__/LiveOcean/LO_roms_source_git/ROMS/External/varinfo.yaml + +! Number of nested grids. + + Ngrids = 1 + +! Number of grid nesting layers. This parameter is used to allow refinement +! and composite grid combinations. + + NestLayers = 1 + +! Number of grids in each nesting layer [1:NestLayers]. + +GridsInLayer = 1 + +! Grid dimension parameters. See notes below in the Glossary for how to set +! these parameters correctly. + + Lm == 661 ! Number of I-direction INTERIOR RHO-points + Mm == 1300 ! Number of J-direction INTERIOR RHO-points + N == 30 ! Number of vertical levels + + Nbed = 0 ! Number of sediment bed layers + + NAT = 2 ! Number of active tracers (usually, 2) + NPT = 0 ! Number of inactive passive tracers + NCS = 0 ! Number of cohesive (mud) sediment tracers + NNS = 0 ! Number of non-cohesive (sand) sediment tracers + +! Domain decomposition parameters for serial, distributed-memory or +! shared-memory configurations used to determine tile horizontal range +! indices (Istr,Iend) and (Jstr,Jend), [1:Ngrids]. + + NtileI == __NTILEI__ + NtileJ == __NTILEJ__ + +! NtileI == 10 ! I-direction partition +! NtileJ == 20 ! J-direction partition + +! Set horizontal and vertical advection schemes for active and inert +! tracers. A different advection scheme is allowed for each tracer. +! For example, a positive-definite (monotonic) algorithm can be activated +! for salinity and inert tracers, while a different one is set for +! temperature. [1:NAT+NPT,Ngrids] values are expected. +! +! Keyword Advection Algorithm +! +! A4 4th-order Akima (horizontal/vertical) +! C2 2nd-order centered differences (horizontal/vertical) +! C4 4th-order centered differences (horizontal/vertical) +! HSIMT 3th-order HSIMT-TVD (horizontal/vertical) +! MPDATA recursive flux corrected MPDATA (horizontal/vertical) +! SPLINES parabolic splines (only vertical) +! SU3 split third-order upstream (horizontal/vertical) +! U3 3rd-order upstream-biased (only horizontal) +! +! The user has the option of specifying the full Keyword or the first +! two letters, regardless if using uppercase or lowercase. If nested +! grids, specify values for each grid (see glossary below). + + Hadvection == MPDATA \ ! temperature + MPDATA ! salinity + + Vadvection == MPDATA \ ! temperature + MPDATA ! salinity + +! Adjoint-based algorithms can have different horizontal and schemes +! for active and inert tracers. + +ad_Hadvection == U3 \ ! temperature + U3 ! salinity + +ad_Vadvection == C4 \ ! temperature + C4 ! salinity + +! Set lateral boundary conditions keyword. Notice that a value is expected +! for each boundary segment per nested grid for each state variable. +! +! Each tracer variable requires [1:4,1:NAT+NPT,Ngrids] values. Otherwise, +! [1:4,1:Ngrids] values are expected for other variables. The boundary +! order is: 1=west, 2=south, 3=east, and 4=north. That is, anticlockwise +! starting at the western boundary. +! +! The keyword is case insensitive and usually has three characters. However, +! it is possible to have compound keywords, if applicable. For example, the +! keyword "RadNud" implies radiation boundary condition with nudging. This +! combination is usually used in active/passive radiation conditions. +! +! Keyword Lateral Boundary Condition Type +! +! Cha Chapman_implicit (free-surface) +! Che Chapman_explicit (free-surface) +! Cla Clamped +! Clo Closed +! Fla Flather (2D momentum) _____N_____ j=Mm +! Gra Gradient | 4 | +! Nes Nested (refinement) | | +! Nud Nudging 1 W E 3 +! Per Periodic | | +! Rad Radiation |_____S_____| +! Red Reduced Physics (2D momentum) 2 j=1 +! Shc Shchepetkin (2D momentum) i=1 i=Lm +! +! W S E N +! e o a o +! s u s r +! t t t t +! h h +! +! 1 2 3 4 + + LBC(isFsur) == Cha Cha Clo Cha ! free-surface + LBC(isUbar) == Fla Fla Clo Fla ! 2D U-momentum + LBC(isVbar) == Fla Fla Clo Fla ! 2D V-momentum + LBC(isUvel) == RadNud RadNud Clo RadNud ! 3D U-momentum + LBC(isVvel) == RadNud RadNud Clo RadNud ! 3D V-momentum + LBC(isMtke) == RadNud RadNud Clo RadNud ! mixing TKE + + LBC(isTvar) == RadNud RadNud Clo RadNud \ ! temperature + RadNud RadNud Clo RadNud ! salinity + +! Adjoint-based algorithms can have different lateral boundary +! conditions keywords. + +ad_LBC(isFsur) == Per Clo Per Clo ! free-surface +ad_LBC(isUbar) == Per Clo Per Clo ! 2D U-momentum +ad_LBC(isVbar) == Per Clo Per Clo ! 2D V-momentum +ad_LBC(isUvel) == Per Clo Per Clo ! 3D U-momentum +ad_LBC(isVvel) == Per Clo Per Clo ! 3D V-momentum +ad_LBC(isMtke) == Per Clo Per Clo ! mixing TKE + +ad_LBC(isTvar) == Per Clo Per Clo \ ! temperature + Per Clo Per Clo ! salinity + +! Set lateral open boundary edge volume conservation switch for +! nonlinear model and adjoint-based algorithms. Usually activated +! with radiation boundary conditions to enforce global mass +! conservation, except if tidal forcing is enabled. [1:Ngrids]. + + VolCons(west) == F ! western boundary + VolCons(east) == F ! eastern boundary + VolCons(south) == F ! southern boundary + VolCons(north) == F ! northern boundary + +ad_VolCons(west) == F ! western boundary +ad_VolCons(east) == F ! eastern boundary +ad_VolCons(south) == F ! southern boundary +ad_VolCons(north) == F ! northern boundary + +! Time-Stepping parameters. + + NTIMES == __NTIMES__ +! NTIMES == 2160 + DT == 30.0d0 + NDTFAST == 20 + +! Number of timesteps for computing observation impacts during the +! analysis-forecast cycle. + + NTIMES_ANA == 1440 ! analysis interval + NTIMES_FCT == 1440 ! forecast interval + +! Model iteration loops parameters. + + ERstr = 1 + ERend = 1 + Nouter = 1 + Ninner = 1 + Nsaddle = 1 + Nintervals = 1 + +! Number of eigenvalues (NEV) and eigenvectors (NCV) to compute for the +! Lanczos/Arnoldi problem in the Generalized Stability Theory (GST) +! analysis. NCV must be greater than NEV (see documentation below). + + NEV = 2 ! Number of eigenvalues + NCV = 10 ! Number of eigenvectors + +! Input/Output parameters. + + NRREC == -1 + LcycleRST == T + NRST == 2880 + NSTA == 1 + NFLT == 1 + NINFO == 120 + +! Output history, quicksave, average, and diagnostic files parameters. + + LDEFOUT == T + NHIS == 120 + NDEFHIS == 120 + NQCK == 0 + NDEFQCK == 0 + NTSAVG == 1 + NAVG == 90 + NDEFAVG == 90 + NTSDIA == 1 + NDIA == 90 + NDEFDIA == 90 + +! Output tangent linear and adjoint models parameters. + + LcycleTLM == F + NTLM == 72 + NDEFTLM == 0 + LcycleADJ == F + NADJ == 72 + NDEFADJ == 0 + NSFF == 72 + NOBC == 72 + +! GST output and check pointing restart parameters. + + LmultiGST = F ! one eigenvector per file + LrstGST = F ! GST restart switch + MaxIterGST = 500 ! maximum number of iterations + NGST = 10 ! check pointing interval + +! Relative accuracy of the Ritz values computed in the GST analysis. + + Ritz_tol = 1.0d-15 + +! Harmonic/biharmonic horizontal diffusion of tracer for nonlinear model +! and adjoint-based algorithms: [1:NAT+NPT,Ngrids]. + + TNU2 == 2*0.0d0 ! m2/s + TNU4 == 2*0.0d0 ! m4/s + + ad_TNU2 == 0.0d0 0.0d0 ! m2/s + ad_TNU4 == 0.0d0 0.0d0 ! m4/s + +! Harmonic/biharmonic, horizontal viscosity coefficient for nonlinear model +! and adjoint-based algorithms: [Ngrids]. + + VISC2 == 0.0d0 ! m2/s + VISC4 == 0.0d0 ! m4/s + + ad_VISC2 == 0.0d0 ! m2/s + ad_VISC4 == 0.0d0 ! m4/s + +! Logical switches (TRUE/FALSE) to increase/decrease horizontal viscosity +! and/or diffusivity in specific areas of the application domain (like +! sponge areas) for the desired application grid. + + LuvSponge == F ! horizontal momentum +LtracerSponge == F F ! temperature, salinity, inert + +! Vertical mixing coefficients for tracers in nonlinear model and +! basic state scale factor in adjoint-based algorithms: [1:NAT+NPT,Ngrids] + + AKT_BAK == 2*5.0d-6 ! m2/s + + ad_AKT_fac == 1.0d0 1.0d0 ! nondimensional + +! Vertical mixing coefficient for momentum for nonlinear model and +! basic state scale factor in adjoint-based algorithms: [Ngrids]. + + AKV_BAK == 5.0d-6 ! m2/s + + ad_AKV_fac == 1.0d0 ! nondimensional + +! Upper threshold values to limit vertical mixing coefficients computed +! from vertical mixing parameterizations. Although this is an engineering +! fix, the vertical mixing values inferred from ocean observations are +! rarely higher than this upper limit value. + + AKT_LIMIT == 1.0d-3 1.0d-3 ! m2/s + + AKV_LIMIT == 1.0d-3 ! m2/s + +! Turbulent closure parameters. + + AKK_BAK == 5.0d-6 ! m2/s + AKP_BAK == 5.0d-6 ! m2/s + TKENU2 == 0.0d0 ! m2/s + TKENU4 == 0.0d0 ! m4/s + +! Generic length-scale turbulence closure parameters. + + GLS_P == 3.0d0 ! K-epsilon + GLS_M == 1.5d0 + GLS_N == -1.0d0 + GLS_Kmin == 7.6d-6 + GLS_Pmin == 1.0d-12 + + GLS_CMU0 == 0.5477d0 + GLS_C1 == 1.44d0 + GLS_C2 == 1.92d0 + GLS_C3M == -0.4d0 + GLS_C3P == 1.0d0 + GLS_SIGK == 1.0d0 + GLS_SIGP == 1.30d0 + +! Constants used in surface turbulent kinetic energy flux computation. + + CHARNOK_ALPHA == 1400.0d0 ! Charnok surface roughness + ZOS_HSIG_ALPHA == 0.5d0 ! roughness from wave amplitude + SZ_ALPHA == 0.25d0 ! roughness from wave dissipation + CRGBAN_CW == 100.0d0 ! Craig and Banner wave breaking + +! Constants used in momentum stress computation. + + RDRG == 3.0d-04 ! m/s + RDRG2 == 3.0d-03 ! nondimensional + Zob == 0.02d0 ! m + Zos == 0.02d0 ! m + +! Height (m) of atmospheric measurements for Bulk fluxes parameterization. + + BLK_ZQ == 2.0d0 ! air humidity + BLK_ZT == 2.0d0 ! air temperature + BLK_ZW == 10.0d0 ! winds + +! Minimum depth for wetting and drying. + + DCRIT == 0.10d0 ! m + +! Various parameters. + + WTYPE == 5 + LEVSFRC == 15 + LEVBFRC == 1 + +! Set vertical, terrain-following coordinates transformation equation and +! stretching function (see below for details), [1:Ngrids]. + + Vtransform == 2 ! transformation equation + Vstretching == 4 ! stretching function + +! Vertical S-coordinates parameters (see below for details), [1:Ngrids]. + + THETA_S == 4.0d0 ! surface stretching parameter + THETA_B == 2.0d0 ! bottom stretching parameter + TCLINE == 10.0d0 ! critical depth (m) + +! Mean Density and Brunt-Vaisala frequency. + + RHO0 = 1023.7d0 ! kg/m3 + BVF_BAK = 1.0d-5 ! 1/s2 + +! If tide generating forces, set switch (T/F) to apply a 18.6-year lunar +! nodal correction to equilibrium tide constituents. + + Lnodal = T + +! Time-stamp assigned for model initialization, reference time +! origin for tidal forcing, and model reference time for output +! NetCDF units attribute. + +! DSTART = 15622.0d0 ! days + DSTART = __DSTART__ + + TIDE_START = 8035.0d0 ! days +! PM Note: TIDE_START is days from TIME_REF to 1/1/1992 + TIME_REF = 19700101.0d0 ! yyyymmdd.dd + +! Nudging/relaxation time scales, inverse scales will be computed +! internally, [1:Ngrids]. + + TNUDG == 3.0d0 3.0d0 ! days + ZNUDG == 3.0d0 ! days + M2NUDG == 3.0d0 ! days + M3NUDG == 3.0d0 ! days + +! Factor between passive (outflow) and active (inflow) open boundary +! conditions, [1:Ngrids]. If OBCFAC > 1, nudging on inflow is stronger +! than on outflow (recommended). + + OBCFAC == 4.0d0 ! nondimensional + +! Linear equation of State parameters: + + R0 == 1027.0d0 ! kg/m3 + T0 == 14.0d0 ! Celsius + S0 == 35.0d0 ! nondimensional + TCOEF == 1.7d-4 ! 1/Celsius + SCOEF == 0.0d0 ! nondimensional + +! Slipperiness parameter: 1.0 (free slip) or -1.0 (no slip) + + GAMMA2 == -1.0d0 + +! Logical switches (TRUE/FALSE) to activate horizontal momentum transport +! point Sources/Sinks (like river runoff transport) and mass point +! Sources/Sinks (like volume vertical influx), [1:Ngrids]. + + LuvSrc == T ! horizontal momentum transport + LwSrc == T ! volume vertical influx + +! Logical switches (TRUE/FALSE) to activate tracers point Sources/Sinks +! (like river runoff) and to specify which tracer variables to consider: +! [1:NAT+NPT,Ngrids]. See glossary below for details. + + LtracerSrc == T T ! temperature, salinity, inert + +! Logical switches (TRUE/FALSE) to read and process climatology fields. +! See glossary below for details. + + LsshCLM == T ! sea-surface height + Lm2CLM == T ! 2D momentum + Lm3CLM == T ! 3D momentum + + LtracerCLM == T T ! temperature, salinity, inert + +! Logical switches (TRUE/FALSE) to nudge the desired climatology field(s). +! If not analytical climatology fields, users need to turn ON the logical +! switches above to process the fields from the climatology NetCDF file +! that are needed for nudging. See glossary below for details. + + LnudgeM2CLM == T ! 2D momentum + LnudgeM3CLM == T ! 3D momentum + + LnudgeTCLM == T T ! temperature, salinity, inert + +! Starting (DstrS) and ending (DendS) day for adjoint sensitivity forcing. +! DstrS must be less or equal to DendS. If both values are zero, their +! values are reset internally to the full range of the adjoint integration. + + DstrS == 0.0d0 ! starting day + DendS == 0.0d0 ! ending day + +! Starting and ending vertical levels of the 3D adjoint state variables +! whose sensitivity is required. + + KstrS == 1 ! starting level + KendS == 1 ! ending level + +! Logical switches (TRUE/FALSE) to specify the adjoint state variables +! whose sensitivity is required. + +Lstate(isFsur) == F ! free-surface +Lstate(isUbar) == F ! 2D U-momentum +Lstate(isVbar) == F ! 2D V-momentum +Lstate(isUvel) == F ! 3D U-momentum +Lstate(isVvel) == F ! 3D V-momentum +Lstate(isWvel) == F ! 3D W-momentum + +Lstate(isTvar) == F F ! NT tracers + +! Logical switches (TRUE/FALSE) to specify the state variables for +! which Forcing Singular Vectors or Stochastic Optimals is required. + +Fstate(isFsur) == F ! free-surface +Fstate(isUbar) == F ! 2D U-momentum +Fstate(isVbar) == F ! 2D V-momentum +Fstate(isUvel) == F ! 3D U-momentum +Fstate(isVvel) == F ! 3D V-momentum +Fstate(isTvar) == F F ! NT tracers + +Fstate(isUstr) == T ! surface U-stress +Fstate(isVstr) == T ! surface V-stress +Fstate(isTsur) == F F ! NT surface tracers flux + +! Stochastic Optimals time decorrelation scale (days) assumed for +! red noise processes. + + SO_decay == 2.0d0 ! days + +! Stochastic Optimals surface forcing standard deviation for +! dimensionalization. + +SO_sdev(isFsur) == 1.0d0 ! free-surface +SO_sdev(isUbar) == 1.0d0 ! 2D U-momentum +SO_sdev(isVbar) == 1.0d0 ! 2D V-momentum +SO_sdev(isUvel) == 1.0d0 ! 3D U-momentum +SO_sdev(isVvel) == 1.0d0 ! 3D V-momentum +SO_sdev(isTvar) == 1.0d0 1.0d0 ! NT tracers + +SO_sdev(isUstr) == 1.0d0 ! surface U-stress +SO_sdev(isVstr) == 1.0d0 ! surface V-stress +SO_sdev(isTsur) == 1.0d0 1.0d0 ! NT surface tracers flux + +! Logical switches (TRUE/FALSE) to activate writing of fields into +! HISTORY output file. + +Hout(idUvel) == T ! u 3D U-velocity +Hout(idVvel) == T ! v 3D V-velocity +Hout(idu3dE) == F ! u_eastward 3D U-eastward at RHO-points +Hout(idv3dN) == F ! v_northward 3D V-northward at RHO-points +Hout(idWvel) == T ! w 3D W-velocity +Hout(idOvel) == F ! omega omega vertical velocity +Hout(idUbar) == T ! ubar 2D U-velocity +Hout(idVbar) == T ! vbar 2D V-velocity +Hout(idu2dE) == F ! ubar_eastward 2D U-eastward at RHO-points +Hout(idv2dN) == F ! vbar_northward 2D V-northward at RHO-points +Hout(idFsur) == T ! zeta free-surface +Hout(idBath) == F ! bath time-dependent bathymetry + +Hout(idTvar) == T T ! temp, salt temperature and salinity + +Hout(idpthR) == F ! z_rho time-varying depths of RHO-points +Hout(idpthU) == F ! z_u time-varying depths of U-points +Hout(idpthV) == F ! z_v time-varying depths of V-points +Hout(idpthW) == F ! z_w time-varying depths of W-points + +Hout(idUsms) == T ! sustr surface U-stress +Hout(idVsms) == T ! svstr surface V-stress +Hout(idUbms) == T ! bustr bottom U-stress +Hout(idVbms) == T ! bvstr bottom V-stress + +Hout(idUbrs) == F ! bustrc bottom U-current stress +Hout(idVbrs) == F ! bvstrc bottom V-current stress +Hout(idUbws) == F ! bustrw bottom U-wave stress +Hout(idVbws) == F ! bvstrw bottom V-wave stress +Hout(idUbcs) == F ! bustrcwmax bottom max wave-current U-stress +Hout(idVbcs) == F ! bvstrcwmax bottom max wave-current V-stress + +Hout(idUbot) == F ! Ubot bed wave orbital U-velocity +Hout(idVbot) == F ! Vbot bed wave orbital V-velocity +Hout(idUbur) == F ! Ur bottom U-velocity above bed +Hout(idVbvr) == F ! Vr bottom V-velocity above bed + +Hout(idW2xx) == F ! Sxx_bar 2D radiation stress, Sxx component +Hout(idW2xy) == F ! Sxy_bar 2D radiation stress, Sxy component +Hout(idW2yy) == F ! Syy_bar 2D radiation stress, Syy component +Hout(idU2rs) == F ! Ubar_Rstress 2D radiation U-stress +Hout(idV2rs) == F ! Vbar_Rstress 2D radiation V-stress +Hout(idU2Sd) == F ! ubar_stokes 2D U-Stokes velocity +Hout(idV2Sd) == F ! vbar_stokes 2D V-Stokes velocity + +Hout(idW3xx) == F ! Sxx 3D radiation stress, Sxx component +Hout(idW3xy) == F ! Sxy 3D radiation stress, Sxy component +Hout(idW3yy) == F ! Syy 3D radiation stress, Syy component +Hout(idW3zx) == F ! Szx 3D radiation stress, Szx component +Hout(idW3zy) == F ! Szy 3D radiation stress, Szy component +Hout(idU3rs) == F ! u_Rstress 3D U-radiation stress +Hout(idV3rs) == F ! v_Rstress 3D V-radiation stress +Hout(idU3Sd) == F ! u_stokes 3D U-Stokes velocity +Hout(idV3Sd) == F ! v_stokes 3D V-Stokes velocity + +Hout(idWamp) == F ! Hwave wave height +Hout(idWlen) == F ! Lwave wave length +Hout(idWdir) == F ! Dwave wave direction +Hout(idWptp) == F ! Pwave_top wave surface period +Hout(idWpbt) == F ! Pwave_bot wave bottom period +Hout(idWorb) == F ! Ub_swan wave bottom orbital velocity +Hout(idWdis) == F ! Wave_dissip wave dissipation + +Hout(idPair) == T ! Pair surface air pressure +Hout(idTair) == T ! Tair surface air temperature +Hout(idUair) == T ! Uair surface U-wind component +Hout(idVair) == T ! Vair surface V-wind component + +Hout(idTsur) == T T ! shflux, ssflux surface net heat and salt flux +Hout(idLhea) == T ! latent latent heat flux +Hout(idShea) == T ! sensible sensible heat flux +Hout(idLrad) == T ! lwrad longwave radiation flux +Hout(idSrad) == T ! swrad shortwave radiation flux +Hout(idEmPf) == T ! EminusP E-P flux +Hout(idevap) == T ! evaporation evaporation rate +Hout(idrain) == T ! rain precipitation rate + +Hout(idDano) == F ! rho density anomaly +Hout(idVvis) == T ! AKv vertical viscosity +Hout(idTdif) == F ! AKt vertical T-diffusion +Hout(idSdif) == T ! AKs vertical Salinity diffusion +Hout(idHsbl) == F ! Hsbl depth of surface boundary layer +Hout(idHbbl) == F ! Hbbl depth of bottom boundary layer +Hout(idMtke) == F ! tke turbulent kinetic energy +Hout(idMtls) == F ! gls turbulent length scale + +! Logical switches (TRUE/FALSE) to activate writing of extra inert passive +! tracers other than biological and sediment tracers into the HISTORY +! output file. An inert passive tracer is one that it is only advected and +! diffused. Other processes are ignored. These tracers include, for example, +! dyes, pollutants, oil spills, etc. NPT values are expected. However, these +! switches can be activated using compact parameter specification. + + Hout(inert) == F ! dye_01, ... inert passive tracers + +! Logical switches (TRUE/FALSE) to activate writing of fields into +! QUICKSAVE output file. + +Qout(idUvel) == F ! u 3D U-velocity +Qout(idVvel) == F ! v 3D V-velocity +Qout(idu3dE) == F ! u_eastward 3D U-eastward at RHO-points +Qout(idv3dN) == F ! v_northward 3D V-northward at RHO-points +Qout(idWvel) == F ! w 3D W-velocity +Qout(idOvel) == F ! omega omega vertical velocity +Qout(idUbar) == T ! ubar 2D U-velocity +Qout(idVbar) == T ! vbar 2D V-velocity +Qout(idu2dE) == T ! ubar_eastward 2D U-eastward at RHO-points +Qout(idv2dN) == T ! vbar_northward 2D V-northward at RHO-points +Qout(idFsur) == T ! zeta free-surface +Qout(idBath) == T ! bath time-dependent bathymetry + +Qout(idTvar) == F F ! temp, salt temperature and salinity + +Qout(idUsur) == T ! u_sur surface U-velocity +Qout(idVsur) == T ! v_sur surface V-velocity +Qout(idUsuE) == T ! u_sur_eastward surface U-eastward velocity +Qout(idVsuN) == T ! v_sur_northward surface V-northward velocity + +Qout(idsurT) == T T ! temp_sur, salt_sur surface temperature and salinity + +Qout(idpthR) == F ! z_rho time-varying depths of RHO-points +Qout(idpthU) == F ! z_u time-varying depths of U-points +Qout(idpthV) == F ! z_v time-varying depths of V-points +Qout(idpthW) == F ! z_w time-varying depths of W-points + +Qout(idUsms) == F ! sustr surface U-stress +Qout(idVsms) == F ! svstr surface V-stress +Qout(idUbms) == F ! bustr bottom U-stress +Qout(idVbms) == F ! bvstr bottom V-stress + +Qout(idUbrs) == F ! bustrc bottom U-current stress +Qout(idVbrs) == F ! bvstrc bottom V-current stress +Qout(idUbws) == F ! bustrw bottom U-wave stress +Qout(idVbws) == F ! bvstrw bottom V-wave stress +Qout(idUbcs) == F ! bustrcwmax bottom max wave-current U-stress +Qout(idVbcs) == F ! bvstrcwmax bottom max wave-current V-stress + +Qout(idUbot) == F ! Ubot bed wave orbital U-velocity +Qout(idVbot) == F ! Vbot bed wave orbital V-velocity +Qout(idUbur) == F ! Ur bottom U-velocity above bed +Qout(idVbvr) == F ! Vr bottom V-velocity above bed + +Qout(idW2xx) == F ! Sxx_bar 2D radiation stress, Sxx component +Qout(idW2xy) == F ! Sxy_bar 2D radiation stress, Sxy component +Qout(idW2yy) == F ! Syy_bar 2D radiation stress, Syy component +Qout(idU2rs) == F ! Ubar_Rstress 2D radiation U-stress +Qout(idV2rs) == F ! Vbar_Rstress 2D radiation V-stress +Qout(idU2Sd) == F ! ubar_stokes 2D U-Stokes velocity +Qout(idV2Sd) == F ! vbar_stokes 2D V-Stokes velocity + +Qout(idW3xx) == F ! Sxx 3D radiation stress, Sxx component +Qout(idW3xy) == F ! Sxy 3D radiation stress, Sxy component +Qout(idW3yy) == F ! Syy 3D radiation stress, Syy component +Qout(idW3zx) == F ! Szx 3D radiation stress, Szx component +Qout(idW3zy) == F ! Szy 3D radiation stress, Szy component +Qout(idU3rs) == F ! u_Rstress 3D U-radiation stress +Qout(idV3rs) == F ! v_Rstress 3D V-radiation stress +Qout(idU3Sd) == F ! u_stokes 3D U-Stokes velocity +Qout(idV3Sd) == F ! v_stokes 3D V-Stokes velocity + +Qout(idWamp) == F ! Hwave wave height +Qout(idWlen) == F ! Lwave wave length +Qout(idWdir) == F ! Dwave wave direction +Qout(idWptp) == F ! Pwave_top wave surface period +Qout(idWpbt) == F ! Pwave_bot wave bottom period +Qout(idWorb) == F ! Ub_swan wave bottom orbital velocity +Qout(idWdis) == F ! Wave_dissip wave dissipation + +Qout(idPair) == F ! Pair surface air pressure +Qout(idTair) == F ! Tair surface air temperature +Qout(idUair) == F ! Uair surface U-wind component +Qout(idVair) == F ! Vair surface V-wind component + +Qout(idTsur) == F F ! shflux, ssflux surface net heat and salt flux +Qout(idLhea) == F ! latent latent heat flux +Qout(idShea) == F ! sensible sensible heat flux +Qout(idLrad) == F ! lwrad longwave radiation flux +Qout(idSrad) == F ! swrad shortwave radiation flux +Qout(idEmPf) == F ! EminusP E-P flux +Qout(idevap) == F ! evaporation evaporation rate +Qout(idrain) == F ! rain precipitation rate + +Qout(idDano) == F ! rho density anomaly +Qout(idVvis) == F ! AKv vertical viscosity +Qout(idTdif) == F ! AKt vertical T-diffusion +Qout(idSdif) == F ! AKs vertical Salinity diffusion +Qout(idHsbl) == F ! Hsbl depth of surface boundary layer +Qout(idHbbl) == F ! Hbbl depth of bottom boundary layer +Qout(idMtke) == F ! tke turbulent kinetic energy +Qout(idMtls) == F ! gls turbulent length scale + +! Logical switches (TRUE/FALSE) to activate writing of extra inert passive +! tracers other than biological and sediment tracers into the QUICKSAVE +! output file. An inert passive tracer is one that it is only advected and +! diffused. Other processes are ignored. These tracers include, for example, +! dyes, pollutants, oil spills, etc. NPT values are expected. However, these +! switches can be activated using compact parameter specification. + + Qout(inert) == F ! dye_01, ... inert passive tracers + Qout(Snert) == F ! dye_01_sur, ... surface inert passive tracers + +! Logical switches (TRUE/FALSE) to activate writing of time-averaged +! fields into AVERAGE output file. + +Aout(idUvel) == T ! u 3D U-velocity +Aout(idVvel) == T ! v 3D V-velocity +Aout(idu3dE) == F ! u_eastward 3D U-eastward at RHO-points +Aout(idv3dN) == F ! v_northward 3D V-northward at RHO-points +Aout(idWvel) == T ! w 3D W-velocity +Aout(idOvel) == T ! omega omega vertical velocity +Aout(idUbar) == T ! ubar 2D U-velocity +Aout(idVbar) == T ! vbar 2D V-velocity +Aout(idu2dE) == F ! ubar_eastward 2D U-eastward at RHO-points +Aout(idv2dN) == F ! vbar_northward 2D V-northward at RHO-points +Aout(idFsur) == T ! zeta free-surface + +Aout(idTvar) == T T ! temp, salt temperature and salinity + +Aout(idUsms) == F ! sustr surface U-stress +Aout(idVsms) == F ! svstr surface V-stress +Aout(idUbms) == F ! bustr bottom U-stress +Aout(idVbms) == F ! bvstr bottom V-stress + +Aout(idW2xx) == F ! Sxx_bar 2D radiation stress, Sxx component +Aout(idW2xy) == F ! Sxy_bar 2D radiation stress, Sxy component +Aout(idW2yy) == F ! Syy_bar 2D radiation stress, Syy component +Aout(idU2rs) == F ! Ubar_Rstress 2D radiation U-stress +Aout(idV2rs) == F ! Vbar_Rstress 2D radiation V-stress +Aout(idU2Sd) == F ! ubar_stokes 2D U-Stokes velocity +Aout(idV2Sd) == F ! vbar_stokes 2D V-Stokes velocity + +Aout(idW3xx) == F ! Sxx 3D radiation stress, Sxx component +Aout(idW3xy) == F ! Sxy 3D radiation stress, Sxy component +Aout(idW3yy) == F ! Syy 3D radiation stress, Syy component +Aout(idW3zx) == F ! Szx 3D radiation stress, Szx component +Aout(idW3zy) == F ! Szy 3D radiation stress, Szy component +Aout(idU3rs) == F ! u_Rstress 3D U-radiation stress +Aout(idV3rs) == F ! v_Rstress 3D V-radiation stress +Aout(idU3Sd) == F ! u_stokes 3D U-Stokes velocity +Aout(idV3Sd) == F ! v_stokes 3D V-Stokes velocity + +Aout(idPair) == F ! Pair surface air pressure +Aout(idTair) == F ! Tair surface air temperature +Aout(idUair) == F ! Uair surface U-wind component +Aout(idVair) == F ! Vair surface V-wind component + +Aout(idTsur) == F F ! shflux, ssflux surface net heat and salt flux +Aout(idLhea) == F ! latent latent heat flux +Aout(idShea) == F ! sensible sensible heat flux +Aout(idLrad) == F ! lwrad longwave radiation flux +Aout(idSrad) == F ! swrad shortwave radiation flux +Aout(idevap) == F ! evaporation evaporation rate +Aout(idrain) == F ! rain precipitation rate + +Aout(idDano) == F ! rho density anomaly +Aout(idVvis) == F ! AKv vertical viscosity +Aout(idTdif) == F ! AKt vertical T-diffusion +Aout(idSdif) == F ! AKs vertical Salinity diffusion +Aout(idHsbl) == F ! Hsbl depth of surface boundary layer +Aout(idHbbl) == F ! Hbbl depth of bottom boundary layer + +Aout(id2dRV) == F ! pvorticity_bar 2D relative vorticity +Aout(id3dRV) == F ! pvorticity 3D relative vorticity +Aout(id2dPV) == F ! rvorticity_bar 2D potential vorticity +Aout(id3dPV) == F ! rvorticity 3D potential vorticity + +Aout(idu3dD) == F ! u_detided detided 3D U-velocity +Aout(idv3dD) == F ! v_detided detided 3D V-velocity +Aout(idu2dD) == F ! ubar_detided detided 2D U-velocity +Aout(idv2dD) == F ! vbar_detided detided 2D V-velocity +Aout(idFsuD) == F ! zeta_detided detided free-surface + +Aout(idTrcD) == F F ! temp_detided, ... detided temperature and salinity + +Aout(idHUav) == F ! Huon u-volume flux, Huon +Aout(idHVav) == F ! Hvom v-volume flux, Hvom +Aout(idUUav) == F ! uu quadratic term +Aout(idUVav) == F ! uv quadratic term +Aout(idVVav) == F ! vv quadratic term +Aout(idU2av) == F ! ubar2 quadratic term +Aout(idV2av) == F ! vbar2 quadratic term +Aout(idZZav) == F ! zeta2 quadratic term + +Aout(idTTav) == F F ! temp_2, ... quadratic tracer terms +Aout(idUTav) == F F ! u_temp, ... quadratic tracer terms +Aout(idVTav) == F F ! v_temp, ... quadratic tracer terms +Aout(iHUTav) == F F ! Huon_temp, ... tracer volume flux, +Aout(iHVTav) == F F ! Hvom_temp, ... tracer volume flux, + +! Logical switches (TRUE/FALSE) to activate writing of extra inert passive +! tracers other than biological and sediment tracers into the AVERAGE file. + + Aout(inert) == T ! dye_01, ... inert passive tracers + +! Logical switches (TRUE/FALSE) to activate writing of time-averaged, +! 2D momentum (ubar,vbar) diagnostic terms into DIAGNOSTIC output file. + +Dout(M2rate) == T ! ubar_accel, ... acceleration +Dout(M2pgrd) == T ! ubar_prsgrd, ... pressure gradient +Dout(M2fcor) == T ! ubar_cor, ... Coriolis force +Dout(M2hadv) == T ! ubar_hadv, ... horizontal total advection +Dout(M2xadv) == T ! ubar_xadv, ... horizontal XI-advection +Dout(M2yadv) == T ! ubar_yadv, ... horizontal ETA-advection +Dout(M2hrad) == T ! ubar_hrad, ... horizontal total radiation stress +Dout(M2hvis) == T ! ubar_hvisc, ... horizontal total viscosity +Dout(M2xvis) == T ! ubar_xvisc, ... horizontal XI-viscosity +Dout(M2yvis) == T ! ubar_yvisc, ... horizontal ETA-viscosity +Dout(M2sstr) == T ! ubar_sstr, ... surface stress +Dout(M2bstr) == T ! ubar_bstr, ... bottom stress + +! Logical switches (TRUE/FALSE) to activate writing of time-averaged, +! 3D momentum (u,v) diagnostic terms into DIAGNOSTIC output file. + +Dout(M3rate) == T ! u_accel, ... acceleration +Dout(M3pgrd) == T ! u_prsgrd, ... pressure gradient +Dout(M3fcor) == T ! u_cor, ... Coriolis force +Dout(M3hadv) == T ! u_hadv, ... horizontal total advection +Dout(M3xadv) == T ! u_xadv, ... horizontal XI-advection +Dout(M3yadv) == T ! u_yadv, ... horizontal ETA-advection +Dout(M3vadv) == T ! u_vadv, ... vertical advection +Dout(M3hrad) == T ! u_hrad, ... horizontal total radiation stress +Dout(M3vrad) == T ! u_vrad, ... vertical radiation stress +Dout(M3hvis) == T ! u_hvisc, ... horizontal total viscosity +Dout(M3xvis) == T ! u_xvisc, ... horizontal XI-viscosity +Dout(M3yvis) == T ! u_yvisc, ... horizontal ETA-viscosity +Dout(M3vvis) == T ! u_vvisc, ... vertical viscosity + +! Logical switches (TRUE/FALSE) to activate writing of time-averaged, +! active (temperature and salinity) and passive (inert) tracer diagnostic +! terms into DIAGNOSTIC output file: [1:NAT+NPT,Ngrids]. + +Dout(iTrate) == T T ! temp_rate, ... time rate of change +Dout(iThadv) == T T ! temp_hadv, ... horizontal total advection +Dout(iTxadv) == T T ! temp_xadv, ... horizontal XI-advection +Dout(iTyadv) == T T ! temp_yadv, ... horizontal ETA-advection +Dout(iTvadv) == T T ! temp_vadv, ... vertical advection +Dout(iThdif) == T T ! temp_hdiff, ... horizontal total diffusion +Dout(iTxdif) == T T ! temp_xdiff, ... horizontal XI-diffusion +Dout(iTydif) == T T ! temp_ydiff, ... horizontal ETA-diffusion +Dout(iTsdif) == T T ! temp_sdiff, ... horizontal S-diffusion +Dout(iTvdif) == T T ! temp_vdiff, ... vertical diffusion + +! Generic User parameters, [1:NUSER]. + + NUSER = 0 + USER = 0.d0 + +! Input and Output files processing library to use: +! +! [1] Standard NetCDF-3 or NetCDF-4 library +! [2] Serial or Parallel I/O with Parallel-IO (PIO) library (MPI only) + + INP_LIB = 1 + OUT_LIB = 1 + +! PIO library methods for reading/writing NetCDF files: +! +! [0] parallel read and write of PnetCDF (CDF-5, not recommended) +! [1] parallel read and write of NetCDF3 (64-bit offset) +! [2] serial read and write of NetCDF3 (64-bit offset) +! [3] parallel read and serial write of NetCDF4/HDF5 +! [4] parallel read and write of NETCDF4/HDF5 + + PIO_METHOD = 2 + +! PIO library MPI processes set-up: + + PIO_IOTASKS = 1 ! number of I/O tasks to define + PIO_STRIDE = 1 ! stride in the MPI-ran between I/O tasks + PIO_BASE = 0 ! offset for the first I/O task + PIO_AGGREG = 1 ! number of MPI-aggregators to use + +! PIO library rearranger methods for moving data between computational and I/O +! processes: +! +! [1] Box rearrangement +! [2] Subset rearrangement + + PIO_REARR = 1 + +! PIO library rearranger flag for MPI communications between computational +! and I/O processes: +! +! [0] Point-to-Point (low-level communications) +! [1] Collective (high-level grouped communications) + +PIO_REARRCOM = 0 + +! PIO library rearranger flow control direction flag for MPI communications +! between computational and I/O processes: +! +! [0] Enable computational to I/O processes, and vice versa +! [2] Enable computational to I/O processes only +! [3] Enable I/O to computational processes only +! [4] Disable flow control + +PIO_REARRDIR = 0 + +! PIO rearranger options for computational to I/O processes (C2I): + + PIO_C2I_HS = T ! Enable C2I handshake (T/F) +PIO_C2I_Send = T ! Enable C2I Isends (T/F) +PIO_C2I_Preq = 64 ! Maximum pending C2I requests + +! PIO rearranger options for I/O to computational processes (I2C): + + PIO_I2C_HS = T ! Enable I2C handshake (T/F) +PIO_I2C_Send = T ! Enable I2C Isends (T/F) +PIO_I2C_Preq = 65 ! Maximum pending I2C requests + +! If OUT_LIB=1, NetCDF-4/HDF5 compression parameters for output files. + + NC_SHUFFLE = 1 ! if non-zero, turn on shuffle filter + NC_DEFLATE = 1 ! if non-zero, turn on deflate filter + NC_DLEVEL = 1 ! deflate level [0-9] + +! Input NetCDF file names, [1:Ngrids]. + +! GRDNAME == __COMROT__/LO_data/grids/cas7/grid.nc +! ININAME == __COMROT__/LO_roms/cas7_t0_x4b/f2012.10.08/ocean_rst.nc + + GRDNAME == __COMROT__/LO_data/grids/cas7/grid.nc + ININAME == __ININAME__ + ITLNAME == roms_itl.nc + IRPNAME == roms_irp.nc + IADNAME == roms_iad.nc + FWDNAME == roms_fwd.nc + ADSNAME == roms_ads.nc + +! Input adjoint forcing NetCDF filenames for computing observations +! impacts during the analysis-forecast cycle. If the forecast error +! metric is defined in state-space, then FOInameA and FOInameB should +! be regular adjoint forcing files just like ADSname. If the forecast +! error metric is defined in observation space (OBS_SPACE is activated) +! then the forecast is initialized OIFnameA and OIFnameB (specified in +! s4dvar.in input script) will have the structure of a 4D-Var observation +! file. + + FOInameA == roms_foi_a.nc + FOInameB == roms_foi_b.nc + +! Input NetCDF filenames for the forecasts initialized from the analysis +! of the current 4D-Var cycle (FCTnameA) and initialized from the analysis +! of the previous 4D-Var cycle (FCTnameB). + + FCTnameA == roms_fct_a.nc + FCTnameB == roms_fct_b.nc + +! Nesting grids connectivity data: contact points information. This +! NetCDF file is special and complex. It is currently generated using +! the script "matlab/grid/contact.m" from the Matlab repository. + + NGCNAME = roms_ngc.nc + +! Input lateral boundary conditions file names. The USER has the option +! to separate the required lateral boundary variables into individual +! NetCDF files (NBCFILES > 1), as in the input surface forcing. Also, +! the USER may split input data time records into several NetCDF files +! (monthly, seasonal, or annual). See prologue instructions above. Use +! a single line per entry with a continuation (\) or a vertical bar (|) +! symbol after each entry, except the last one. + + NBCFILES == 1 ! number of boundary files + + BRYNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/ocn01/ocean_bry.nc + +! Input climatology file names. The USER has the option to separate the +! climatology variables into individual NetCDF files (NCLMFILES > 1), +! as in the input surface forcing. Also, the USER may split input data +! time records into several NetCDF files (monthly, seasonal, or annual). +! See prologue instructions above. Use a single line per entry with a +! continuation (\) or a vertical bar (|) symbol after each entry, except +! the last one. + + NCLMFILES == 1 ! number of climatology files + + CLMNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/ocn01/ocean_clm.nc + +! Input climatology nudging coefficients file name. + + NUDNAME == __COMROT__/LO_data/grids/cas7/nudgcoef.nc + +! Input Sources/Sinks forcing (like river runoff) file name. + + SSFNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/__TRAPSDIR__/rivers.nc + +! Input tidal forcing file name. + + TIDENAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/tide00/tides.nc + +! Input forcing NetCDF file name(s). +! +! The USER has the option to enter several sets of file names for each +! nested grid. For example, the USER may have different data for the +! wind products, heat fluxes, etc. Alternatively, if the all the forcing +! files are the same for nesting and the data is in its native resolution, +! we could enter only one set of files names and ROMS will replicate those +! files internally to the remaining grids using the plural KEYWORD protocol. +! +! The model will scan the files and will read the needed data from the first +! file in the list containing the forcing field. Therefore, the order of the +! filenames is critical. If using multiple forcing files per grid, first +! enter all the file names for grid one followed by two, and so on. It is +! also possible to split input data time records into several NetCDF files +! (see Prolog instructions above). Use a single line per entry with a +! continuation (\) or a vertical bar (|) symbol after each entry, except +! the last one. + + NFFILES == 8 ! number of unique forcing files + + FRCNAME == __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/lwrad_down.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/Pair.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/Qair.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/rain.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/swrad.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/Tair.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/Uwind.nc \ + __COMROT__/LO_output/forcing/cas7/__FDATE__/atm00/Vwind.nc + +! Output NetCDF file names, [1:Ngrids]. + + DAINAME == roms_dai.nc + GSTNAME == roms_gst.nc + RSTNAME == __COMROT__/LO_roms/cas7_t0_x4b/__FDATE__/ocean_rst.nc + HISNAME == __COMROT__/LO_roms/cas7_t0_x4b/__FDATE__/ocean_his.nc + QCKNAME == roms_qck.nc + TLMNAME == roms_tlm.nc + TLFNAME == roms_tlf.nc + ADJNAME == roms_adj.nc + AVGNAME == __COMROT__/LO_roms/cas7_t0_x4b/__FDATE__/ocean_avg.nc + HARNAME == roms_har.nc + DIANAME == __COMROT__/LO_roms/cas7_t0_x4b/__FDATE__/ocean_dia.nc + STANAME == roms_sta.nc + FLTNAME == roms_flt.nc + +! Input ASCII parameter filenames. + + APARNAM = __SAVE__/LiveOcean/LO_roms_source_git/ROMS/External/s4dvar.in + SPOSNAM = __SAVE__/LiveOcean/LO_roms_source_git/ROMS/External/stations.in + FPOSNAM = __SAVE__/LiveOcean/LO_roms_source_git/ROMS/External/floats.in + BPARNAM = __COMROT__/LO_roms/cas7_t0_x4b/__FDATE__/bio_Banas.in + SPARNAM = __SAVE__/LiveOcean/LO_roms_source_git/ROMS/External/sediment.in + USRNAME = __SAVE__/LiveOcean/LO_roms_source_git/ROMS/External/MyFile.dat + +! +! GLOSSARY: +! ========= +! +!------------------------------------------------------------------------------ +! Application title (string with a maximum of 80 characters) and +! C-preprocessing flag. +!------------------------------------------------------------------------------ +! +! TITLE Application title. +! +! MyAppCPP Application C-preprocessing option. +! +!------------------------------------------------------------------------------ +! Variable information filename (string with a maximum of 256 characters). +!------------------------------------------------------------------------------ +! +! VARNAME Input/Output variable information filename. This file needs to +! be processed first so all information arrays and indices can +! be initialized properly in "mod_ncparam.F". +! +!------------------------------------------------------------------------------ +! Nested grid parameters (processing order of these parameters is important). +!------------------------------------------------------------------------------ +! +! Ngrids Number of nested grids. It needs to be read before all other +! parameters in order to allocate all model variables. +! +! NestLayers Number of grid nesting layers. It is used to allow applications +! with both composite and refinement grid combinations, as shown +! in WikiROMS diagrams for the Refinement and Partial Boundary +! Composite Sub-Classes. See, +! +! https://www.myroms.org/wiki/index.php/Nested_Grids +! +! In non-nesting applications, set NestLayers = 1. +! +! GridsInLayer Number of grids in each nested layer, a vector of size +! [1:NestLayers]. Notice that, +! +! SUM(GridsInLayer) = Ngrids +! LENGHT(GridsInLayer) = NestLayers +! +! The order of grids and nesting layers is extremely important. +! It determines the order of the sequential solution at every +! sub-timestep. See WikiROMS nesting Sub-Classes diagrams. +! +! In non-nesting applications, set GridsInLayer = 1. +! +! NOTE: In main3d, we use these parameters to determine which +! ==== grid index, ng, to solve when calling the routines of +! the computational kernel: +! +! NEST_LAYER : DO nl=1,NestLayers +! ... +! STEP_LOOP : DO istep=1,Nsteps +! ... +! DO ig=1,GridsInLayer(nl) +! ng=GridNumber(ig,nl) +! ... +! END DO +! ... +! END DO STEP_LOOP +! END DO NEST_LAYER +! +! Here, the grid order "ng" for the computations is determined +! from array "GridNumber", which is computed at initialization +! in "read_phypar.F". It can be computed on the fly as: +! +! ng=Ngrids+1 +! DO j=NestLayers,nl,-1 +! DO i=GridsInLayer(j),1,-1 +! ng=ng-1 +! IF ((j.eq.nl).and.(i.eq.ig)) EXIT +! END DO +! END DO +! +! but it is too inefficient. This information is provided here +! to help you configure the order of nested grids. +! +!------------------------------------------------------------------------------ +! Grid dimension parameters. +!------------------------------------------------------------------------------ +! +! These parameters are very important since they determine the grid of the +! application to solve. They need to be read first in order to dynamically +! allocate all model variables. +! +! WARNING: It is trivial and possible to change these dimension parameters in +! ------- idealized applications via analytical expressions. However, in +! realistic applications any change to these parameters requires redoing all +! input NetCDF files. +! +! Lm Number of INTERIOR grid RHO-points in the XI-direction for +! each nested grid, [1:Ngrids]. If using NetCDF files as +! input, Lm=xi_rho-2 where "xi_rho" is the NetCDF file +! dimension of RHO-points. Recall that all RHO-point +! variables have a computational I-range of [0:Lm+1]. +! +! Mm Number of INTERIOR grid RHO-points in the ETA-direction for +! each nested grid, [1:Ngrids]. If using NetCDF files as +! input, Mm=eta_rho-2 where "eta_rho" is the NetCDF file +! dimension of RHO-points. Recall that all RHO-point +! variables have a computational J-range of [0:Mm+1]. +! +! N Number of vertical terrain-following levels at RHO-points, +! [1:Ngrids]. +! +! Nbed Number of sediment bed layers, [1:Ngrids]. This parameter +! is only relevant if CPP option SEDIMENT is activated. +! +! Mm+1 ___________________ _______ Kw = N +! | | | | +! Mm | _____________ | | | Kr = N +! | | | | |_______| +! | | | | | | +! Jr | | | | | | +! | | | | |_______| +! | | | | | | +! 1 | |_____________| | | | +! | | |_______| +! 0 |___________________| | | +! Ir | | 1 +! 0 1 Lm Lm+1 h(i,j) |_______| +! ::::::::: 0 +! ::::::::: +! ::::::::: Nbed-1 +! ::::::::: Nbed +! +! NAT Number of active tracer type variables. Usually, NAT=2 for +! potential temperature and salinity. +! +! NPT Number of inert (dyes, age, etc) passive tracer type variables +! to advect and diffuse only. This parameter is only relevant +! if CPP option T_PASSIVE is activated. +! +! NCS Number of cohesive (mud) sediment tracer type variables. This +! parameter is only relevant if CPP option SEDIMENT is +! activated. +! +! NNS Number of non-cohesive (sand) sediment tracer type variables. +! This parameter is only relevant if CPP option SEDIMENT is +! activated. +! +! The total number of sediment tracers is NST=NCS+NNS. Notice +! that NST must be greater than zero (NST>0). +! +!------------------------------------------------------------------------------ +! Domain tile partition parameters. +!------------------------------------------------------------------------------ +! +! Model tile decomposition parameters for serial and parallel configurations +! which are used to determine tile horizontal range indices (Istr,Iend and +! Jstr,Jend). In some computers, it is advantageous to have tile partitions +! in serial applications. +! +! NtileI Number of domain partitions in the I-direction (XI-coordinate). +! It must be equal to or greater than one. +! +! NtileJ Number of domain partitions in the J-direction (ETA-coordinate). +! It must be equal to or greater than one. +! +! WARNING: In shared-memory (OpenMP), the product of NtileI and NtileJ must +! be a MULTIPLE of the number of parallel threads specified with +! the OpenMP environmental variable OMP_NUM_THREADS. +! +! In distributed-memory (MPI), the product of NtileI and NtileJ +! must be EQUAL to the number of parallel nodes specified during +! execution with the "mprun" or "mpirun" command. +! +!------------------------------------------------------------------------------ +! Tracer advection scheme +!------------------------------------------------------------------------------ +! +! It is more advantageous to set the horizontal and vertical advection schemes +! for each tracer with switches instead of a single CPP flag for all of them. +! Positive-definite and monotonic algorithms (i.e., MPDATA and HSIMT) are +! appropriate and useful for positive fields like salinity, inert, biological, +! and sediment tracers. However, since the temperature has a dynamic range +! with negative and positive values in the ocean, other advection schemes are +! more appropriate. +! +! Currently, the following tracer advection schemes are available and are +! activated using the associated Keyword: +! +! Keyword Advection Algorithm +! +! A4 4th-order Akima (horizontal/vertical) +! C2 2nd-order centered differences (horizontal/vertical) +! C4 4th-order centered differences (horizontal/vertical) +! HSIMT 3th-order HSIMT with TVD limiter (horizontal/vertical) +! MPDATA recursive flux corrected MPDATA (horizontal/vertical) +! SPLINES parabolic splines reconstruction (only vertical) +! SU3 split third-order upstream (horizontal/vertical) +! U3 3rd-order upstresm-bias (only horizontal) +! +! The user has the option of specifying the full Keyword or the first +! two letters, regardless if using uppercase or lowercase. +! +! If using either HSIMT (Wu and Zhu, 2010) or MPDATA (Margolin and +! Smolarkiewicz, 1998) options, the user needs to set the same scheme +! for both horizontal and vertical advection to preserve monotonicity. +! +! Hadvection Horizontal advection for each active (temperature and +! salinity) and inert tracers, [1:NAT+NPT,Ngrids] +! values are expected. +! +! Vadvection Vertical advection for each active (temperature and +! salinity) and inert tracers, [1:NAT+NPT,Ngrids] +! values are expected. +! +! ad_Hadvection Horizontal advection for each active (temperature and +! salinity) and inert tracers in the adjoint-based +! algorithms, [1:NAT+NPT,Ngrids] values are expected. +! +! ad_Vadvection Vertical advection for each active (temperature and +! salinity) and inert tracers in the adjoint-based +! algorithms, [1:NAT+NPT,Ngrids] values are expected. +! +! Examples: +! +! Hadvection == A4 \ ! temperature +! MPDATA \ ! salinity +! HSIMT \ ! dye_01, inert(1) +! HSIMT ! dy2_02, inert(2) +! +! Vadvection == A4 \ ! temperature +! MPDATA \ ! salinity +! HSIMT \ ! dye_01, inert(1) +! HSIMT ! dye_02, inert(2) +! +! or in nested applications +! +! Hadvection == U3 \ ! temperature, Grid 1 +! HSIMT \ ! salinity, Grid 1 +! U3 \ ! temperature, Grid 2 +! HSIMT \ ! salinity, Grid 2 +! U3 \ ! temperature, Grid 3 +! HSIMT ! salinity, Grid 3 +! +! Vadvection == C4 \ ! temperature, Grid 1 +! HSIMT \ ! salinity, Grid 1 +! C4 \ ! temperature, Grid 2 +! HSIMT \ ! salinity, Grid 2 +! C4 \ ! temperature, Grid 3 +! HSIMT ! salinity, Grid 3 +! +!------------------------------------------------------------------------------ +! Lateral boundary conditions parameters. +!------------------------------------------------------------------------------ +! +! The lateral boundary conditions are now specified with logical switches +! instead of CPP flags to allow nested grid configurations. Their values are +! loaded into structured array: +! +! LBC(1:4, nLBCvar, Ngrids) +! +! where 1:4 are the number of boundary edges, nLBCvar are the number of LBC +! state variables, and Ngrids is the number of nested grids. For Example, to +! apply gradient boundary conditions we use: +! +! LBC(iwest, isFsur, ng) % gradient +! LBC(ieast, ... , ng) % gradient +! LBC(isouth, ... , ng) % gradient +! LBC(inorth, ... , ng) % gradient +! +! The lateral boundary conditions are entered with a keyword. This keyword +! is case insensitive and usually has three characters. However, it is +! possible to have compound keywords, if applicable. For example, the +! keyword "RadNud" implies radiation boundary condition with nudging. This +! combination is usually used in active/passive radiation conditions. +! +! Keyword Lateral Boundary Condition Type +! +! Cha Chapman_implicit (free-surface only) +! Che Chapman_explicit (free-surface only) +! Cla Clamped +! Clo Closed +! Fla Flather (2D momentum only) _____N_____ j=Mm +! Gra Gradient | 4 | +! Nes Nested (refinement only) | | +! Nud Nudging 1 W E 3 +! Per Periodic | | +! Rad Radiation |_____S_____| +! Red Reduced Physics (2D momentum only) 2 j=1 +! Shc Shchepetkin (2D momentum only) i=1 i=Lm +! +! LBC(isFsur) Free-surface, [1:4, Ngrids] values are expected. +! LBC(isUbar) 2D U-momentum, [1:4, Ngrids] values are expected. +! LBC(isVbar) 2D V-momentum, [1:4, Ngrids] values are expected. +! LBC(isUvel) 3D U-momentum, [1:4, Ngrids] values are expected. +! LBC(isVvel) 3D V-momentum, [1:4, Ngrids] values are expected. +! LBC(isMtke) Mixing TKE, [1:4, Ngrids] values are expected. +! LBC(isTvar) Tracers, [1:4, 1:NAT+NPT, Ngrids] values are expected. +! +! Similarly, the adjoint-based algorithms (ADM, TLM, RPM) can have different +! lateral boundary conditions keywords: +! +! ad_LBC(isFsur) Free-surface, [1:4, Ngrids] values are expected. +! ad_LBC(isUbar) 2D U-momentum, [1:4, Ngrids] values are expected. +! ad_LBC(isVbar) 2D V-momentum, [1:4, Ngrids] values are expected. +! ad_LBC(isUvel) 3D U-momentum, [1:4, Ngrids] values are expected. +! ad_LBC(isVvel) 3D V-momentum, [1:4, Ngrids] values are expected. +! ad_LBC(isMtke) Mixing TKE, [1:4, Ngrids] values are expected. +! ad_LBC(isTvar) Tracers, [1:4, 1:NAT+NPT, Ngrids] values are expected. +! +! Lateral open boundary edge volume conservation switch for nonlinear model +! and adjoint-based algorithm. Usually activated with radiation boundary +! conditions to enforce global mass conservation. Notice that these switches +! should not be activated if tidal forcing is enabled, [1:Ngrids] values are +! expected. +! +! VolCons(west) Western boundary volume conservation switch. +! VolCons(east) Eastern boundary volume conservation switch. +! VolCons(south) Southern boundary volume conservation switch. +! VolCons(north) Northern boundary volume conservation switch. +! +! ad_VolCons(west) Western boundary volume conservation switch. +! ad_VolCons(east) Eastern boundary volume conservation switch. +! ad_VolCons(south) Southern boundary volume conservation switch. +! ad_VolCons(north) Northern boundary volume conservation switch. +! +!------------------------------------------------------------------------------ +! Timestepping parameters. +!------------------------------------------------------------------------------ +! +! NTIMES Total number of timesteps in current run. If 3D configuration, +! NTIMES is the total of baroclinic timesteps. If only 2D +! configuration, NTIMES is the total of barotropic timesteps. +! +! DT TimeStep size in seconds. If 3D configuration, DT is the +! size of the baroclinic timestep. If only 2D configuration, +! DT is the size of the barotropic timestep. +! +! NDTFAST Number of barotropic timesteps between each baroclinic time +! step. If only 2D configuration, NDTFAST should be unity since +! there is no need to split timestepping. +! +! NTIMES_ANA Total number of timesteps for computing observations impacts +! interval during the analysis cycle. It is only used when +! RBL4DVAR_FCT_SENSITIVITY is activated. +! +! NTIMES_FCT Total number of timesteps for computing observations impacts +! interval during the forecast cycle. It is only used when +! RBL4DVAR_FCT_SENSITIVITY is activated. +! +!------------------------------------------------------------------------------ +! Model iteration loops parameters. +!------------------------------------------------------------------------------ +! +! ERstr Starting ensemble run (perturbation or iteration) number. +! +! ERend Ending ensemble run (perturbation or iteration) number. +! +! Nouter Maximum number of 4DVAR outer loop iterations. +! +! Ninner Maximum number of 4DVAR inner loop iterations. +! +! Nsaddle Number of kernel trajectory intervals for the solution of the +! Saddle-Point 4D-Var (SP4DVAR). It is used to accelerate +! 4D-Var by parallelizing the inner loops in time. The tangent +! linear and adjoint models are time-stepped concurrently over +! the short time integration windows. Make sure that +! +! MOD(NTIMES/NHIS, Nsaddle) = 0 +! +! for legal computations. +! +! Nintervals Number of time interval divisions for Stochastic Optimals +! computations. It must be a multiple of NTIMES. The tangent +! linear model (TLM) and the adjoint model (ADM) are integrated +! forward and backward at different intervals. For example, +! if Nintervals=3, +! +! 1 NTIMES/3 2*NTIMES/3 NTIMES +! +..................+..................+..................+ +! <========================================================> (1) +! <=====================================> (2) +! <==================> (3) +! +! In the first iteration (1), the TLM is integrated forward from +! 1 to NTIMES and the ADM is integrated backward from NTIMES to 1. +! In the second iteration (2), the TLM is integrated forward from +! NTIMES/3 to NTIMES and the ADM is integrated backward from +! NTIMES to NTIMES/3. And so on. +! +!------------------------------------------------------------------------------ +! Eigenproblem parameters. +!------------------------------------------------------------------------------ +! +! NEV Number of eigenvalues to compute for the Lanczos/Arnoldi +! problem. Notice that the model memory requirement increases +! substantially as NEV increases. The GST requires NEV+1 +! copies of the model state vector. The memory requirements +! are decreased in distributed-memory applications. +! +! NCV Number of eigenvectors to compute for the Lanczos/Arnoldi +! problem. NCV must be greater than NEV. +! +! At present, there is no apriori analysis to guide the selection of NCV +! relative to NEV. The only formal requirement is that NCV > NEV. However +! in optimal perturbations, it is recommended to have NCV greater than or +! equal to 2*NEV. In Finite Time Eigenmodes (FTE) and Adjoint Finite Time +! Eigenmodes (AFTE) the requirement is to have NCV greater than or equal to +! 2*NEV+1. +! +! The efficiency of calculations depends critically on the combination of +! NEV and NCV. If NEV is large (greater than 10 say), you can use NCV=2*NEV+1 +! but for NEV small (less than 6) it will be inefficient to use NCV=2*NEV+1. +! In complicated applications, you can start with NEV=2 and NCV=10. Otherwise, +! it will iterate for a very long time. +! +!------------------------------------------------------------------------------ +! Input/Output parameters. +!------------------------------------------------------------------------------ +! +! NRREC Switch to indicate re-start from a previous solution. Use +! NRREC=0 for new solutions. In a re-start solution, NRREC +! is the time index of the re-start NetCDF file assigned for +! initialization. If NRREC is negative (say NRREC=-1), the +! model will re-start from the most recent time record. That +! is, the initialization record is assigned internally. +! Notice that it is also possible to re-start from a history +! or time-averaged NetCDF file. If a history file is used +! for re-start, it must contains all the necessary primitive +! variables at all levels. +! +! LcycleRST Logical switch (T/F) used to recycle time records in output +! restart file. If TRUE, only the latest two re-start time +! records are maintained. If FALSE, all re-start fields are +! saved every NRST timesteps without recycling. The restart +! fields are written at all levels in double precision. +! +! NRST Number of timesteps between the writing of re-start fields. +! Set NRST=0 to suppress writing of RESTART file. +! +! NSTA Number of timesteps between writing data into STATIONS file. +! Station data is written at all levels. +! +! NFLT Number of timesteps between writing data into FLOATS file. +! +! NINFO Number of timesteps between the print of single line information +! to standard output. It also determines the interval between +! computation of global energy diagnostics. +! +!------------------------------------------------------------------------------ +! Output HISTORY, QUICKSAVE, AVERAGE and DIAGNOSTIC files parameters. +!------------------------------------------------------------------------------ +! +! Notice that it is possible to have two types of output NetCDF files for +! instantaneous fields: HISTORY and QUICKSAVE. The QUICKSAVE file can be used +! for writing fewer fields at shorter time intervals. For example, the User +! may just write 2D and surface fields frequently (hourly) to reduce file +! size and to time resolve fast dynamics. In conjunction, the User may write +! full HISTORY fields infrequently (daily, weekly, etc) to avoid creating +! large output files. This gives a lot of flexibility to manage ROMS output. +! +! +! LDEFOUT Logical switch (T/F) used to create new output files when +! initializing from a re-start file, abs(NRREC) > 0. If TRUE +! and applicable, a new HISTORY, QUICKSAVE, AVERAGE, DIAGNOSTIC +! and STATIONS files are created during the initialization +! stage. If FALSE and applicable, data is appended to existing +! HISTORY, QUICKSAVE, AVERAGE, DIAGNOSTIC and STATIONS files. +! See also parameters NDEFHIS, NDEFQCK, NDEFAVG and NDEFDIA +! below. +! +! NHIS Number of timesteps between writing fields into the HISTORY +! file. Set NHIS=0 to suppress writing of HISTORY file. +! +! NDEFHIS Number of timesteps between the creation of new HISTORY file. +! If NDEFHIS=0, the model will only process one HISTORY file. +! This feature is useful for extended simulations when HISTORY +! file get too large; it creates a new file every NDEFHIS +! timesteps. +! +! NQCK Number of timesteps between writing fields into QUICKSAVE file. +! Set NQCK=0 to suppress writing of QUICKSAVE file. +! +! NDEFQCK Number of timesteps between the creation of new QUICKSAVE file. +! If NDEFQCK=0, the model will only process one QUICKSAVE file. +! This feature is useful for extended simulations when QUICKSAVE +! file get too large; it creates a new file every NDEFQCK +! timesteps. +! +! NTSAVG Starting timestep for the accumulation of output time-averaged +! data. +! +! NAVG Number of timesteps between writing time-averaged data +! into AVERAGE file. Averaged date is written for all fields. +! Set NAVG=0 to suppress writing of AVERAGE file. +! +! NDEFAVG Number of timesteps between the creation of new AVERAGE +! file. If NDEFAVG=0, the model will only process one AVERAGE +! file. This feature is useful for extended simulations when +! AVERAGE file get too large; it creates a new file every +! NDEFAVG timesteps. +! +! NTSDIA Starting timestep for the accumulation of output time-averaged +! diagnostics data. +! +! NDIA Number of timesteps between writing time-averaged diagnostics +! data into DIAGNOSTIC file. Averaged date is written for all +! fields. Set NDIA=0 to suppress writing of DIAGNOSTIC file. +! +! NDEFDIA Number of timesteps between the creation of new time-averaged +! diagnostics file. If NDEFDIA=0, the model will only process +! one DIAGNOSTICS file. This feature is useful for long +! simulations when DIAGNOSTIC file get too large; it creates +! a new file every NDEFDIA timesteps. +! +!------------------------------------------------------------------------------ +! Output tangent linear and adjoint model parameters. +!------------------------------------------------------------------------------ +! +! LcycleTLM Logical switch (T/F) used to recycle time records in output +! tangent linear file. If TRUE, only the latest two time +! records are maintained. If FALSE, all tangent linear fields +! are saved every NTLM timesteps without recycling. +! +! NTLM Number of timesteps between writing fields into tangent linear +! model file. +! +! NDEFTLM Number of timesteps between the creation of new tangent linear +! file. If NDEFTLM=0, the model will only process one tangent +! linear file. This feature is useful for extended simulations +! when output NetCDF files get too large; it creates a new file +! every NDEFTLM timesteps. +! +! LcycleADJ Logical switch (T/F) used to recycle time records in output +! adjoint file. If TRUE, only the latest two time records are +! maintained. If FALSE, all tangent linear fields are saved +! every NADJ timesteps without recycling. +! +! NADJ Number of timesteps between writing fields into the adjoint +! model file. +! +! NDEFADJ Number of timesteps between the creation of the new adjoint +! file. If NDEFADJ=0, the model will only process one adjoint +! file. This feature is useful for extensive simulations when +! the output NetCDF files get too large; it creates a new file +! every NDEFADJ timesteps. +! +! NSFF Number of timesteps between 4DVAR adjustment of surface forcing +! fluxes. In strong constraint 4DVAR, it is possible to adjust +! surface forcing at other time intervals in addition to initial +! time. This parameter is used to store the appropriate number +! of surface forcing records in the output history NetCDF files: +! 1+NTIMES/NSFF records. NSFF must be a factor of NTIMES or +! greater than NTIMES. If NSFF > NTIMES, only one record is +! stored in the NetCDF files and the adjustment is for constant +! forcing with constant correction. This parameter is only +! relevant in 4DVAR when activating either ADJUST_STFLUX or +! ADJUST_WSTRESS. +! +! NOBC Number of timesteps between 4DVAR adjustment of open boundary +! fields. In strong constraint 4DVAR, it is possible to adjust +! open boundaries at other time intervals in addition to initial +! time. This parameter is used to store the appropriate number +! of open boundary records in the output history NetCDF files: +! 1+NTIMES/NOBC records. NOBC must be a factor of NTIMES or +! greater than NTIMES. If NOBC > NTIMES, only one record is +! stored in the NetCDF files and the adjustment is for constant +! forcing with constant correction. This parameter is only +! relevant in 4DVAR when activating ADJUST_BOUNDARY. +! +!------------------------------------------------------------------------------ +! Generalized Stability Theory (GST) analysis parameters. +!------------------------------------------------------------------------------ +! +! LmultiGST Logical switch (TRUE/FALSE) to write out one GST analysis +! eigenvector per history file. +! +! LrstGST Logical switch (TRUE/FALSE) to restart GST analysis. If TRUE, +! the check pointing data is read in from the GST restart NetCDF +! file. If FALSE and applicable, the checkpointing GST data is +! saved and overwritten every NGST iterations of the algorithm. +! +! MaxIterGST Maximum number of GST algorithm iterations. +! +! NGST Number of GST iterations between storing of check pointing +! data into NetCDF file. The restart data is always saved if +! MaxIterGST is reached without convergence. It is also saved +! when convergence is achieved. It is always a good idea to +! save the checkpointing data at regular intervals so there +! is a mechanism to recover from an unexpected interruption +! in this costly computation. The check pointing data can +! be used also to recompute the Ritz vectors by changing some +! of the parameters, like convergence criteria (Ritz_tol) +! and number of Arnoldi iterations (iparam(3)). +! +! Ritz_tol Relative accuracy of the Ritz values computed in the GST +! analysis. +! +!------------------------------------------------------------------------------ +! Harmonic/Biharmonic horizontal diffusion for active tracers and viscosity +! for momentum. +!------------------------------------------------------------------------------ +! +! TNU2 Nonlinear model lateral, harmonic, constant, mixing +! coefficient (m2/s) for active (NAT) and inert (NPT) tracer +! variables. If variable horizontal diffusion is activated, +! TNU2 is the mixing coefficient for the largest grid-cell +! in the domain. +! +! TNU4 Nonlinear model lateral, biharmonic, constant, mixing +! coefficient (m4/s) for active (NAT) and inert (NPT) tracer +! variables. If variable horizontal diffusion is activated, +! TNU4 is the mixing coefficient for the largest grid-cell +! in the domain. +! +! ad_TNU2 Adjoint-based algorithms lateral, harmonic, constant, mixing +! coefficient (m2/s) for active (NAT) and inert (NPT) tracer +! variables. If variable horizontal diffusion is activated, +! ad_TNU2 is the mixing coefficient for the largest grid-cell +! in the domain. In some applications, a larger value than +! that used in the nonlinear model (basic state) is necessary +! for stability. +! +! ad_TNU4 Adjoint-based algorithms lateral, biharmonic, constant, mixing +! coefficient (m4/s) for active (NAT) and inert (NPT) tracer +! variables. If variable horizontal diffusion is activated, +! ad_TNU4 is the mixing coefficient for the largest grid-cell +! in the domain. In some applications, a larger value than +! that used in the nonlinear model (basic state) is necessary +! for stability. +! +! VISC2 Nonlinear model lateral, harmonic, constant, mixing +! coefficient (m2/s) for momentum. If variable horizontal +! viscosity is activated, UVNU2 is the mixing coefficient +! for the largest grid-cell in the domain. +! +! VISC4 Nonlinear model lateral, biharmonic, constant mixing +! coefficient (m4/s) for momentum. If variable horizontal +! viscosity is activated, UVNU4 is the mixing coefficient +! for the largest grid-cell in the domain. +! +! ad_VISC2 Adjoint-based algorithms lateral, harmonic, constant, mixing +! coefficient (m2/s) for momentum. If variable horizontal +! viscosity is activated, ad_UVNU2 is the mixing coefficient +! for the largest grid-cell in the domain. In some applications, +! a larger value than that used in the nonlinear model (basic +! state) is necessary for stability. +! +! ad_VISC4 Adjoint-based algorithms lateral, biharmonic, constant mixing +! coefficient (m4/s) for momentum. If variable horizontal +! viscosity is activated, ad_UVNU4 is the mixing coefficient +! for the largest grid-cell in the domain. In some applications, +! a larger value than that used in the nonlinear model (basic +! state) is necessary for stability. +! +!------------------------------------------------------------------------------ +! Switches to activate sponge areas with enhanced horizontal mixing. +!------------------------------------------------------------------------------ +! +! LuvSponge Logical switch (TRUE/FALSE) to increase/decrease horizontal +! viscosity in specific areas of the domain. It can be used +! to specify sponge areas with larger horizontal mixing +! coefficients for damping of high frequency noise due to +! open boundary conditions or nesting. The CPP option SPONGE +! is now deprecated and replaced with this switch to facilitate +! or not sponge areas over a particular nested grid. +! +! The horizontal mixing distribution is specified in +! "ini_hmixcoef.F" as: +! +! visc2_r(i,j) = visc_factor(i,j) * visc2_r(i,j) +! visc4_r(i,j) = visc_factor(i,j) * visc4_r(i,j) +! +! The variable "visc_factor" can be read from the grid +! NetCDF file. Alternately, the horizontal viscosity in the +! sponge area can be set-up with analytical functions in +! "ana_sponge.h" using CPP ANA_SPONGE when the switch +! "LuvSponge" is turned ON for a particular grid. +! +! LtracerSponge Logical switch (TRUE/FALSE) to increase/decrease horizontal +! diffusivity in specific areas of the domain. It can be used +! to specify sponge areas with larger horizontal mixing +! coefficients for damping of high frequency noise due to +! open boundary conditions or nesting. The CPP option SPONGE +! is now deprecated and replaced with this switch to facilitate +! or not sponge areas over a particular nested grid. +! +! The horizontal mixing distribution is specified in +! "ini_hmixcoef.F" as: +! +! diff2(i,j,itrc) = diff_factor(i,j) * diff2(i,j,itrc) +! diff4(i,j,itrc) = diff_factor(i,j) * diff4(i,j,itrc) +! +! The variable "diff_factor" can be read from the grid +! NetCDF file. Alternately, the horizontal viscosity in the +! sponge area can be set-up with analytical functions in +! "ana_sponge.h" using CPP ANA_SPONGE when the switch +! "LuvSponge" is turned ON for a particular grid. +! +!------------------------------------------------------------------------------ +! Vertical mixing coefficients for active tracers. +!------------------------------------------------------------------------------ +! +! AKT_BAK Background vertical mixing coefficient (m2/s) for active +! (NAT) and inert (NPT) tracer variables. +! +! AKT_LIMIT Upper threshold values to limit vertical diffusion coefficients +! computed from vertical mixing parameterizations (GLS_MIXING, +! LMD_MIXING, MY25_MIXING). Sometimes, these parameterizations +! yield high mixing values and the threshold values are used as +! upper limiter when LIMIT_VDIFF is activated. +! +! ad_AKT_fac Adjoint-based algorithms vertical mixing, basic state, scale +! factor (nondimensional) for active (NAT) and inert (NPT) +! tracer variables. In some applications, smaller/larger +! values of vertical mixing are necessary for stability. It +! is only used when FORWARD_MIXING is activated. +! +!------------------------------------------------------------------------------ +! Vertical mixing coefficient for momentum. +!------------------------------------------------------------------------------ +! +! AKV_BAK Background vertical mixing coefficient (m2/s) for momentum. +! +! AKV_LIMIT Upper threshold value to limit vertical viscosity coefficient +! computed from vertical mixing parameterizations (GLS_MIXING, +! LMD_MIXING, MY25_MIXING). Sometimes, these parameterizations +! yield a high mixing value and the threshold value is used as +! upper limiter when LIMIT_VVISC is activated. +! +! ad_AKV_fac Adjoint-based algorithms vertical mixing, basic state, scale +! factor (nondimensional) for momentum. In some applications, +! smaller/larger values of vertical mixing are necessary for +! stability. It is only used when FORWARD_MIXING is activated. +! +!------------------------------------------------------------------------------ +! Turbulent closure parameters. +!------------------------------------------------------------------------------ +! +! AKK_BAK Background vertical mixing coefficient (m2/s) for turbulent +! kinetic energy. +! +! AKP_BAK Background vertical mixing coefficient (m2/s) for turbulent +! generic statistical field, "psi". +! +! TKENU2 Lateral, harmonic, constant, mixing coefficient (m2/s) for +! turbulent closure variables. +! +! TKENU4 Lateral, biharmonic, constant mixing coefficient (m4/s) for +! turbulent closure variables. +! +!------------------------------------------------------------------------------ +! Generic length-scale turbulence closure parameters. +!------------------------------------------------------------------------------ +! +! GLS_P Stability exponent (nondimensional). +! +! GLS_M Turbulent kinetic energy exponent (nondimensional). +! +! GLS_N Turbulent length scale exponent (nondimensional). +! +! GLS_Kmin Minimum value of specific turbulent kinetic energy +! +! GLS_Pmin Minimum Value of dissipation. +! +! Closure independent constraint parameters (nondimensional): +! +! GLS_CMU0 Stability coefficient. +! +! GLS_C1 Shear production coefficient. +! +! GLS_C2 Dissipation coefficient. +! +! GLS_C3M Buoyancy production coefficient (minus). +! +! GLS_C3P Buoyancy production coefficient (plus). +! +! GLS_SIGK Constant Schmidt number (nondimensional) for turbulent +! kinetic energy diffusivity. +! +! GLS_SIGP Constant Schmidt number (nondimensional) for turbulent +! generic statistical field, "psi". +! +! Suggested values for various parameterizations: +! +! k-kl k-epsilon k-omega gen +! +! GLS_P = 0.d0 3.0d0 -1.0d0 2.0d0 +! GLS_M = 1.d0 1.5d0 0.5d0 1.0d0 +! GLS_N = 1.d0 -1.0d0 -1.0d0 -0.67d0 +! GLS_Kmin = 5.0d-6 7.6d-6 7.6d-6 1.0d-8 +! GLS_Pmin = 5.0d-6 1.0d-12 1.0d-12 1.0d-8 +! +! GLS_CMU0 = 0.5544d0 0.5477d0 0.5477d0 0.5544d0 +! GLS_C1 = 0.9d0 1.44d0 0.555d0 1.00d0 +! GLS_C2 = 0.52d0 1.92d0 0.833d0 1.22d0 +! GLS_C3M = 2.5d0 -0.4d0 -0.6d0 0.1d0 +! GLS_C3P = 1.0d0 1.0d0 1.0d0 1.0d0 +! GLS_SIGK = 1.96d0 1.0d0 2.0d0 0.8d0 +! GLS_SIGP = 1.96d0 1.30d0 2.0d0 1.07d0 +! +!------------------------------------------------------------------------------ +! Constants used in the various formulations of surface turbulent kinetic +! energy flux in the GLS. +!------------------------------------------------------------------------------ +! +! CHARNOK_ALPHA Charnok surface roughness, +! Zos: (charnok_alpha * u_star**2) / g +! +! ZOS_HSIG_ALPHA Roughness from wave amplitude, +! Zos: zos_hsig_alpha * Hsig +! +! SZ_ALPHA Surface flux from wave dissipation, +! flux: dt * sz_alpha * Wave_dissip +! +! CRGBAN_CW Surface flux due to Craig and Banner wave breaking, +! flux: dt * crgban_cw * u_star**3 +! +!------------------------------------------------------------------------------ +! Constants used in the computation of momentum stress. +!------------------------------------------------------------------------------ +! +! RDRG Linear bottom drag coefficient (m/s). +! +! RDRG2 Quadratic bottom drag coefficient. +! +! Zob Bottom roughness (m). +! +! Zos Surface roughness (m). +! +!------------------------------------------------------------------------------ +! Height of atmospheric measurements for bulk fluxes parameterization. +!------------------------------------------------------------------------------ +! +! BLK_ZQ Height (m) of surface air humidity measurement. Usually, +! recorded at 10 m. +! +! BLK_ZT Height (m) of surface air temperature measurement. Usually, +! recorded at 2 or 10 m. +! +! BLK_ZW Height (m) of surface winds measurement. Usually, recorded +! at 10 m. +! +!------------------------------------------------------------------------------ +! Wetting and drying parameters. +!------------------------------------------------------------------------------ +! +! DCRIT Minimum depth (m) for wetting and drying. +! +!------------------------------------------------------------------------------ +! Jerlov Water type. +!------------------------------------------------------------------------------ +! +! WTYPE Jerlov water type array index used to model the light absorption +! with a double exponential function (Paulson and Simpson, +! 1977). The classification ranges from clear open ocean +! waters (type I) to dark turbulent coastal waters (type 7). +! +! Array Jerlov +! Index Water Type Examples +! ----- ---------- -------- +! +! 1 I Open Pacific +! 2 IA Eastern Mediterranean, Indian Ocean +! 3 IB Western Mediterranean, Open Atlantic +! 4 II Coastal waters, Azores +! 5 III Coastal waters, North Sea +! 6 1 Skagerrak Strait +! 7 3 Baltic +! 8 5 Black Sea +! 9 7 Dark coastal water +! +!------------------------------------------------------------------------------ +! Body-force parameters. Used when CPP option BODYFORCE is activated. +!------------------------------------------------------------------------------ +! +! LEVSFRC Deepest level to apply surface momentum stress as a body-force. +! +! LEVBFRC Shallowest level to apply bottom momentum stress as a body-force. +! +!------------------------------------------------------------------------------ +! Vertical S-coordinates parameters. +!------------------------------------------------------------------------------ +! +! The parameters below must be consistent in all input fields associated with +! the vertical grid. The same vertical grid transformation (depths) needs to +! be used when preparing initial conditions, boundary conditions, climatology, +! observations, and so on. Please check: +! +! https://www.myroms.org/wiki/index.php/Vertical_S-coordinate +! +! for details, rules and examples. +! +! +! Vtransform Vertical transformation equation: +! +! (1) Original formulation (Shchepetkin and McWilliams, 2005), +! Vtransform=1 (In ROMS since 1999) +! +! z(x,y,s,t)=Zo(x,y,s)+zeta(x,y,t)*[1+Zo(x,y,s)/h(x,y)] +! +! where +! +! Zo(x,y,s)=hc*s+[h(x,y)-hc]*C(s) +! +! (2) Improved formulation (A. Shchepetkin, 2005), +! Vtransform=2 +! +! z(x,y,s,t)=zeta(x,y,t)*[zeta(x,y,t)+h(x,y)]*Zo(x,y,s) +! +! where +! +! Zo(x,y,s)=[hc*s(k)+h(x,y)*C(k)]/[hc+h(x,y)] +! +! The true sigma-coordinate system is recovered as hc goes +! to INFINITY. This is useful when configuring applications +! with flat bathymetry and uniform level thickness. +! Practically, you can achieve this by setting: +! +! THETA_S = 0.0d0 +! THETA_B = 0.0d0 +! TCLINE = 1.0d+17 (a large number) +! +! +! Vstretching Vertical stretching function, C(s): +! +! (1) Original function (Song and Haidvogel, 1994), +! Vstretching=1 +! +! C(s)=(1-theta_b)*[SINH(s*theta_s)/SINH(theta_s)]+ +! theta_b*[-0.5+0.5*TANH(theta_s*(s+0.5))/ +! TANH(0.5*theta_s)] +! +! (2) A. Shchepetkin (2005) function, +! Vstretching=2 +! +! C(s)=Cweight*Csur(s)+(1-Cweight)*Cbot(s) +! +! where +! +! Csur(s)=[1-COSH(theta_s*s)]/[COSH(theta_s)-1] +! +! Cbot(s)=-1+[1-SINH(theta_b*(s+1))]/SINH(theta_b) +! +! Cweight=(s+1)**alpha* +! (1+(alpha/beta)*(1-(s+1)**beta)) +! +! (3) R. Geyer function for shallow sediment applications, +! Vstretching=3 +! +! C(s)=Cweight*Cbot(s)+(1-Cweight)*Csur(s) +! +! where +! +! Csur(s)=-LOG(COSH(Hscale*ABS(s)** alpha))/ +! LOG(COSH(Hscale)) +! +! Cbot(s)= LOG(COSH(Hscale*(s+1)** beta))/ +! LOG(COSH(Hscale))-1 +! +! Cweight=0.5*(1-TANH(Hscale*(s+0.5)) +! +! (4) A. Shchepetkin (2010) improved double stretching function, +! Vstretching=4 +! +! C(s)=[1-COSH(theta_s*s)]/[COSH(theta_s)-1] +! +! with bottom refinement +! +! C(s)=[EXP(theta_b*C(s))-1]/[1-EXP(-theta_b)] +! +! The resulting double transformation is continuous with +! respect control parameters theta_s and theta_b with a +! meaningful range of: +! +! 0 < theta_s <= 10.0 +! 0 <= theta_b <= 4.0 +! +! (5) Souza et al. (2015) quadratic Legendre polynomial function +! that allows higher resolution near the surface, +! Vstretching=5. It is similar to Vstretching=4, but the +! fractional stretched vertical coordinate (s) is re-defined +! as: +! +! s(k)=- [(k*k - 2*k*N + k + N*N - N) / (N*N - N)] +! - weight * [(k*k - k*N) / (1 - N)] +! +! at vertical W-points, k=0,...,N and weight=0.01. To get +! the equation at vertical RHO-points, replace k with k-0.5. +! +! Many other stretching functions (Vstretching>5) are possible +! provided that: +! +! * C(s) is a dimensionless, nonlinear, monotonic function. +! * C(s) is a continuous differentiable function, or +! a differentiable piecewise function with smooth transition. +! * The stretching vertical coordinate ,s, is constrained +! between -1 <= s <= 0, with s=0 corresponding to the +! free-surface and s=-1 corresponding to the bathymetry. +! * Similarly, the stretching function, C(s), is constrained +! between -1 <= C(s) <= 0, with C(0)=0 corresponding to the +! free-surface and C(-1)=-1 corresponding to the bathymetry. +! +! These functions are coded in routine "Utility/set_scoord.F". +! +! Due to its functionality and properties, the default and recommended vertical +! coordinates transformation is: +! +! Vtransform = 2 +! Vstretching = 4 +! +! +! THETA_S S-coordinate surface control parameter. The range of optimal +! values depends on the vertical stretching function, C(s). +! +! THETA_B S-coordinate bottom control parameter. The range of optimal +! values depends on the vertical stretching function, C(s). +! +! TCLINE Critical depth (hc) in meters (positive) controlling the +! stretching. It can be interpreted as the width of surface or +! bottom boundary layer in which higher vertical resolution +! (levels) is required during stretching. +! +!------------------------------------------------------------------------------ +! Mean Density and background Brunt-Vaisala frequency. +!------------------------------------------------------------------------------ +! +! RHO0 Mean density (Kg/m3) used when the Boussinesq approximation +! is inferred. +! +! BVF_BAK Background Brunt-Vaisala frequency squared (1/s2). Typical +! values for the ocean range (as a function of depth) from +! 1.0E-4 to 1.0E-6. +! +!------------------------------------------------------------------------------ +! Tide Genearting Forces (TGF) parameter. +!------------------------------------------------------------------------------ +! +! Lnodal Switch to account for the slow modulation of the equilibrium +! tides constituents due primarily to the 18.6-year lunar nodal +! cycle. +! +!------------------------------------------------------------------------------ +! Time Stamps. +!------------------------------------------------------------------------------ +! +! DSTART Time stamp assigned to model initialization (days). Usually +! a Calendar linear coordinate, like modified Julian Day. For +! Example: +! +! Julian Day = 1 for Nov 25, 00:00:00 4713 BCE +! modified Julian Day = 1 for May 24, 00:00:00 1968 GMT +! Days since Jan 1, 2000 = 988.5 for Sep 15, 12:00:00 2002 +! +! It is called truncated or modified Julian day because an +! offset of 2440000 needs to be added. +! +! TIDE_START Reference time origin for tidal forcing (days since application +! reference date, TIME_REF). It is defined as the time of phase +! zero when preparing the input forcing tidal boundary data. The +! tide reference time is important and often ignored parameter +! by the users. If TIDE_START=0.0, it implies that the date of +! zero phase is the same as the application date reference, +! TIME_REF. +! +! To avoid any ambiguity with the tide generating forcing in the +! pressure gradient, it is preferable if the "zero_phase_date" +! variable is available in the input tidal forcing NetCDF file. +! It is a floating-point variable of the form YYYYMMDD.dddd with +! the following metadata: +! +! double zero_phase_date +! zero_phase_date:long_name = "tidal reference date for zero phase" +! zero_phase_date:units = "days as %Y%m%d.%f" +! zero_phase_date:C_format = "%13.4f" +! zero_phase_date:FORTRAN_format = "(f13.4)" +! +! Use "forcing/add_tide_date.m" from the ROMS Matlab repository +! to add the "zero_phase_date" variable to your existing tidal +! forcing NetCDF file. It is highly recommended to use this +! approach. If such a variable is found, the TIDE_START value +! will overwritten during execution. +! +! Notice that it is possible to have different reference values +! for "zero_phase_date" and ROMS clock defined as seconds from +! reference date TIME_REF. If TIME_REF is earlier than variable +! "zero_phase_date", the frequencies (omega) to harmonic terms +! will be negative since they are computed as follows: +! +! tide_start = Rclock%tide_DateNumber(2) - +! Rclock%DateNumber(2)) +! omega = 2 * pi * (time - tide_start) / Tperiod +! +! TIME_REF Reference time (yyyymmdd.f) used to compute relative time: +! elapsed time interval since reference-time. The "units" +! attribute takes the form "time-unit since reference-time". +! This parameter also provides information about the calendar +! used: +! +! If TIME_REF = -2, model time and DSTART are in modified Julian +! days units. The "units" attribute is: +! +! 'time-units since 1968-05-23 00:00:00 GMT' (May 23, 1968) +! +! If TIME_REF = -1, model time and DSTART are in a calendar +! with 360 days in every year (30 days each month). The "units" +! attribute is: +! +! 'time-units since 0000-12-30 00:00:00' (Dec 30, 0000) +! +! If TIME_REF = 0, model time and DSTART are in a common year +! calendar with 365.25 days. The "units" attribute is: +! +! 'time-units since 0001-01-01 00:00:00' (Jan 1, 0001) +! +! If TIME_REF > 0, model time and DSTART are the elapsed time +! units since specified reference time. For example, +! TIME_REF=20020115.5 will yield the following attribute: +! +! 'time-units since 2002-01-15 12:00:00' (Jan 15, 2002) +! +!------------------------------------------------------------------------------ +! Nudging/relaxation time scales, inverse scales will be computed internally. +!------------------------------------------------------------------------------ +! +! When passive/active open boundary conditions are activated, these nudging +! values correspond to the passive (outflow) nudging time scales. +! +! TNUDG Nudging time scale (days) for active tracer variables. +! (1:NAT+NPT,1:Ngrids) values are expected. +! +! ZNUDG Nudging time scale (days) for free-surface. +! +! M2NUDG Nudging time scale (days) for 2D momentum. +! +! M3NUDG Nudging time scale (days) for 3D momentum. +! +! OBCFAC Factor between passive (outflow) and active (inflow) open +! boundary conditions. The nudging time scales for the +! active (inflow) conditions are obtained by multiplying +! the passive values by OBCFAC. If OBCFAC > 1, nudging on +! inflow is stronger than on outflow (recommended). +! +!------------------------------------------------------------------------------ +! Linear equation of State parameters. +!------------------------------------------------------------------------------ +! +! Ignoring pressure, the linear equation of state is: +! +! rho(:,:,:) = R0 - R0 * TCOEF * (t(:,:,:,:,itemp) - T0) +! + R0 * SCOEF * (t(:,:,:,:,isalt) - S0) +! +! Typical values: R0 = 1027.0 kg/m3 +! T0 = 10.0 Celsius +! S0 = 35.0 nondimensional +! TCOEF = 1.7d-4 1/Celsius +! SCOEF = 7.6d-4 1/nondimensional +! +! Notice that salinity has NO UNITS, it is nondimensional. Many +! people use PSU (Practical Salinity Unit). However, salinity +! has always been defined as a conductivity ratio and does not +! have physical units. For details, check the following forum +! post: www.myroms.org/forum/viewtopic.php?f=30&t=294 +! +! R0 Background density value (Kg/m3) used in Linear Equation of +! State. +! +! T0 Background potential temperature (Celsius) constant. +! +! S0 Background salinity (nondimensional) constant. +! +! TCOEF Thermal expansion coefficient in Linear Equation of State. +! +! SCOEF Saline contraction coefficient in Linear Equation of State. +! +!------------------------------------------------------------------------------ +! Slipperiness parameter. +!------------------------------------------------------------------------------ +! +! GAMMA2 Slipperiness variable, either 1.0 (free slip) or -1.0 (no slip). +! +!------------------------------------------------------------------------------ +! Point Sources/Sink sources activation switches. +!------------------------------------------------------------------------------ +! +! LuvSrc Logical switches (T/F) to activate momentum horizontal transport +! points Sources/Sinks. Usually it is used to turn on/off river +! runoff transport (u or v variables) in an application, +! [1:Ngrids]. +! +! In nesting applications, turn on only the grids that require +! activation and processing of momentum point Sources/Sinks. +! +! LwSrc Logical switches (T/F) to activate mass points Sources/Sinks. +! Usually, it is used to turn on/off volume vertical influx (w) +! in an application. +! +! In nesting applications, turn on only the grids that require +! activation and processing of mass influx point Sources/Sinks. +! +! LtracerSrc Logical switches (T/F) to activate tracer variables point +! Sources/Sinks. Only NAT active tracers (temperature, salinity) +! and NPT inert tracers are activated here: +! +! LtracerSrc(itemp,ng) for temperature (itemp=1) +! LtracerSrc(isalt,ng) for salinity (isalt=2) +! LtracerSrc(NAT+1,ng) for inert tracer 1 +! ... ... +! LtracerSrc(NAT+NPT,ng) for inert tracer NPT +! +! Other biological and sediment tracers switches are activated +! in their respective input scripts. +! +! In nesting applications, turn on only the grids that require +! activation and processing of tracers point Sources/Sinks. +! +! Recall that switches are usually activated to add river runoff +! as a point source. At minimum, it is necessary to specify both +! temperature and salinity for all rivers. The other tracers are +! optional. +! +! This logical switch REPLACES and ELIMINATES the need to have +! or read the variable "river_flag(river)" in the input rivers +! forcing NetCDF file: +! +! double river_flag(river) +! river_flag:long_name = "river runoff tracer flag" +! river_flag:option_0 = "all tracers are off" +! river_flag:option_1 = "only temperature" +! river_flag:option_2 = "only salinity" +! river_flag:option_3 = "both temperature and salinity" +! river_flag:units = "nondimensional" +! +! The above variable was too cumbersome and complicated when +! additional tracers are considered. However, this change is +! backward compatible. +! +! The LtracerSrc switch will be used to activate the reading of +! respective tracer variable from input river forcing NetCDF +! file. If you want to add other tracer variables (other than +! temperature and salinity) as a source for a particular +! river(s), you just need to specify such values on those +! river(s). Then, set the values to ZERO on the other river(s) +! that do NOT require such river forcing for that tracer. +! Recall that you need to specify the tracer values for all +! rivers, even if their values are zero. +! +!------------------------------------------------------------------------------ +! Logical switches to process climatology fields. The climatology fields are +! either read from a NetCDF file or set with analytical CPP options. +!------------------------------------------------------------------------------ +! +! LsshCLM Logical switch (T/F) to process sea-surface height climatology. +! The CPP option ZCLIMATOLOGY is now obsolete and replaced with +! this switch to facilitate nesting applications. Currently, +! the sea-surface height climatology, CLIMA(ng)%ssh, is NOT +! used but it is kept for future use. +! +! The nudging of SSH on the free-surface governing equation +! (vertically integrated continuity equation) is NOT allowed +! because it violates mass/volume conservation. Recall that +! the time rate of change of free-surface is computed from the +! divergence of "ubar" and "vbar". If such nudging term is +! required, it needs to be specified on the momentum equations +! for (u,v) and/or (ubar,vbar). If done on (u,v) only, its +! effects enter the 2D momentum equations via the residual +! vertically integrated forcing term. +! +! Lm2CLM Logical switch (T/F) to process 2D momentum (ubar, vbar) +! climatology. The CPP option M2CLIMATOLOGY is now obsolete +! and replaced with this switch to facilitate nesting +! applications. Currently, the CLIMA(ng)%ubarclm and +! CLIMA(ng)%vbarclm are used for sponges and nudging. If +! tidal forcing, the climatological values are adjusted to +! include tides. +! +! Lm3CLM Logical switch (T/F) to process 3D momentum climatology (u,v) +! The CPP option M3CLIMATOLOGY is now obsolete and replaced +! with this switch to facilitate nesting applications. +! Currently, the CLIMA(ng)%uclm and CLIMA(ng)%vclm are used +! for sponges and nudging. +! +! LtracerCLM Logical switches (T/F) to process active and inert tracer +! variables climatology. The CPP option TCLIMATOLOGY is now +! obsolete and replaced with these switches to facilitate +! nesting applications. Currently, the CLIMA(ng)%tclm is +! used for horizontal mixing, sponges, and nudging. +! +! Only NAT active tracers (temperature, salinity) and NPT inert +! tracers need to be specified here: +! +! LtracerCLM(itemp,ng) for temperature (itemp=1) +! LtracerCLM(isalt,ng) for salinity (isalt=2) +! LtracerCLM(NAT+1,ng) for inert tracer 1 +! ... ... +! LtracerCLM(NAT+NPT,ng) for inert tracer NPT +! +! Other biological and sediment tracers switches are specified +! in their respective input scripts. +! +! These switches also controls which climatology tracer fields +! (specially passive tracers) needs to be processed. So we +! may reduce the memory allocation for the CLIMA(ng)%tclm array. +! +!------------------------------------------------------------------------------ +! Logical switches for nudging to climatology fields. +!------------------------------------------------------------------------------ +! +! LnudgeM2CLM Logical switch (T/F) to activate the nudging of 2D momentum +! climatology. The CPP option M2CLM_NUDGING is now obsolete +! and replaced with this switch to facilitate nesting +! applications. Users also need to TURN ON the logical +! switch "Lm2CLM", described above, to process the required +! 2D momentum climatology data. This data can be set with +! analytical functions (ANA_M2CLIMA) or read from input +! climatology NetCDF file(s). +! +! The nudging coefficients CLIMA(ng)%M2nudgcof can be set +! with analytical functions in "ana_nudgcoef.h" using CPP +! option ANA_NUDGCOEF. Otherwise, it will be read from +! NetCDF file NUDNAME. +! +! LnudgeM3CLM Logical switch (T/F) to activate the nudging of 3D momentum +! climatology. The CPP option M3CLM_NUDGING is now obsolete +! and replaced with this switch to facilitate nesting +! applications. +! +! Users also need to TURN ON the logical switch "Lm3CLM", +! described above, to process the required 3D momentum +! climatology data. This data can be set with analytical +! functions (ANA_M3CLIMA) or read from input climatology +! NetCDF file(s). +! +! The nudging coefficients CLIMA(ng)%M3nudgcof can be set +! with analytical functions in "ana_nudgcoef.h" using CPP +! option ANA_NUDGCOEF. Otherwise, it will be read from +! NetCDF file NUDNAME. +! +! LnudgeTCLM Logical switches (T/F) to activate the nudging of active and +! inert tracer variables climatology. These switches also +! control which tracer variables to nudge. The CPP option +! TCLM_NUDGING is now obsolete and replaced with these +! switches to facilitate nesting applications. +! +! Only NAT active tracers (temperature, salinity) and NPT +! inert tracers need to be specified here: +! +! LnudgeTCLM(itemp,ng) for temperature (itemp=1) +! LnudgeTCLM(isalt,ng) for salinity (isalt=2) +! LnudgeTCLM(NAT+1,ng) for inert tracer 1 +! ... ... +! LnudgeTCLM(NAT+NPT,ng) for inert tracer NPT +! +! Other biological and sediment tracers switches are specified +! in their respective input scripts. +! +! User also needs to TURN ON the respective logical switches +! "LtracerCLM", described above, to process the required 3D +! tracer climatology data. This data can be set with analytical +! functions (ANA_TCLIMA) or read from input climatology +! NetCDF file(s). +! +! The nudging coefficients CLIMA(ng)%Tnudgcof can be set +! with analytical functions in "ana_nudgcoef.h" using CPP +! option ANA_NUDGCOEF. Otherwise, it will be read from +! NetCDF file NUDNAME. +! +!------------------------------------------------------------------------------ +! Adjoint sensitivity parameters. +!------------------------------------------------------------------------------ +! +! DstrS Starting day for adjoint sensitivity forcing. +! +! DendS Ending day for adjoint sensitivity forcing. +! +! The adjoint forcing is applied at every time step according +! to desired state functional stored in the adjoint sensitivity +! NetCDF file. DstrS must be less than or equal to DendS. If +! both values are zero, their values are reset internally to +! the full range of the adjoint integration. +! +! KstrS Starting vertical level of the 3D adjoint state variables whose +! sensitivity is required. +! +! KendS Ending vertical level of the 3D adjoint state variables whose +! sensitivity is required. +! +! Lstate Logical switches (TRUE/FALSE) to specify the adjoint state +! variables whose sensitivity is required. +! +! Lstate(isFsur): Free-surface +! Lstate(isUbar): 2D U-momentum +! Lstate(isVbar): 2D V-momentum +! Lstate(isUvel): 3D U-momentum +! Lstate(isVvel): 3D V-momentum +! Lstate(isWvel): 3D W-momentum +! Lstate(isTvar): Traces (NT values expected) +! +!------------------------------------------------------------------------------ +! Forcing Singular Vectors or Stochastic Optimals parameters. +!------------------------------------------------------------------------------ +! +! Fstate Logical switches (TRUE/FALSE) to specify state variables for +! which Forcing Singular Vectors or Stochastic Optimals is +! required. +! +! Fstate(isFsur): Free-surface +! Fstate(isUbar): 2D U-momentum +! Fstate(isVbar): 2D V-momentum +! Fstate(isUvel): 3D U-momentum +! Fstate(isVvel): 3D V-momentum +! Fstate(isTvar): Traces (NT values expected) +! +! Fstate(isUstr): surface U-stress +! Fstate(isVstr): surface V-stress +! Fstate(isTsur): surface tracers flux (NT values expected) +! +! SO_decay Stochastic Optimals time decorrelation scale (days) assumed +! for red noise processes. +! +! SO_sdev Stochastic Optimals surface forcing standard deviation for +! dimensionalization. +! +! SO_sdev(isFsur): Free-surface +! SO_sdev(isUbar): 2D U-momentum +! SO_sdev(isVbar): 2D V-momentum +! SO_sdev(isUvel): 3D U-momentum +! SO_sdev(isVvel): 3D V-momentum +! SO_sdev(isTvar): Traces (NT values expected) +! +! SO_sdev(isUstr): surface U-stress +! SO_sdev(isVstr): surface V-stress +! SO_sdev(isTsur): surface tracer flux (NT values expected) +! +!------------------------------------------------------------------------------ +! Logical switches (T/F) to activate writing of instantaneous fields into +! HISTORY file. +!------------------------------------------------------------------------------ +! +! Hout(idUvel) Write out 3D U-velocity component. +! Hout(idVvel) Write out 3D V-velocity component. +! Hout(idu3dE) Write out 3D Eastward velocity component at RHO-points. +! Hout(idv3dN) Write out 3D Northward velocity component at RHO-points. +! Hout(idWvel) Write out 3D W-velocity component. +! Hout(idOvel) Write out 3D omega vertical velocity. +! Hout(idUbar) Write out 2D U-velocity component. +! Hout(idVbar) Write out 2D V-velocity component. +! Hout(idu2dE) Write out 2D Eastward velocity component at RHO-points. +! Hout(idv2dN) Write out 2D Northward velocity component at RHO-points. +! Hout(idFsur) Write out free-surface. +! Hout(idBath) Write out time-dependent bathymetry. +! +! Hout(idTvar) Write out active (NAT) tracers: temperature and salinity. +! +! Hout(idpthR) Write out time-varying depths of RHO-points. +! Hout(idpthU) Write out time-varying depths of U-points. +! Hout(idpthV) Write out time-varying depths of V-points. +! Hout(idpthW) Write out time-varying depths of W-points. +! +! Hout(idUsms) Write out surface U-momentum stress. +! Hout(idVsms) Write out surface V-momentum stress. +! Hout(idUbms) Write out bottom U-momentum stress. +! Hout(idVbms) Write out bottom V-momentum stress. +! +! Hout(idUbrs) Write out current-induced, U-momentum stress. +! Hout(idVbrs) Write out current-induced, V-momentum stress. +! Hout(idUbws) Write out wind-induced, bottom U-wave stress. +! Hout(idVbws) Write out wind-induced, bottom V-wave stress. +! Hout(idUbcs) Write out bottom maximum wave and current U-stress. +! Hout(idVbcs) Write out bottom maximum wave and current V-stress. +! +! Hout(idUbot) Write out wind-induced, bed wave orbital U-velocity. +! Hout(idVbot) Write out wind-induced, bed wave orbital V-velocity. +! Hout(idUbur) Write out bottom U-velocity above bed. +! Hout(idVbvr) Write out bottom V-velocity above bed. +! +! Hout(idW2xx) Write out 2D radiation stress, Sxx component. +! Hout(idW2xy) Write out 2D radiation stress, Sxy component. +! Hout(idW2yy) Write out 2D radiation stress, Syy component. +! Hout(idU2rs) Write out 2D U-radiation stress. +! Hout(idV2rs) Write out 2D V-radiation stress. +! Hout(idU2Sd) Write out 2D U-Stokes velocity. +! Hout(idV2Sd) Write out 2D V-Stokes velocity. +! +! Hout(idW3xx) Write out 3D radiation stress, Sxx component. +! Hout(idW3xy) Write out 3D radiation stress, Sxy component. +! Hout(idW3yy) Write out 3D radiation stress, Syy component. +! Hout(idW3zx) Write out 3D radiation stress, Szx component. +! Hout(idW3zy) Write out 3D radiation stress, Szy component. +! Hout(idU3rs) Write out 3D U-radiation stress. +! Hout(idV3rs) Write out 3D V-radiation stress. +! Hout(idU3Sd) Write out 3D U-Stokes velocity. +! Hout(idV3Sd) Write out 3D V-Stokes velocity. +! +! Hout(idWamp) Write out wave height. +! Hout(idWlen) Write out wave length. +! Hout(idWdir) Write out wave direction. +! Hout(idWptp) Write out wave surface period. +! Hout(idWpbt) Write out wave bottom period. +! Hout(idWorb) Write out wave bottom orbital velocity. +! Hout(idWdis) Write out wave dissipation. +! +! Hout(idPair) Write out surface air pressure. +! Hout(idTair) Write out surface air temperature. +! Hout(idUair) Write out surface U-wind component. +! Hout(idVair) Write out surface V-wind component. +! +! Hout(idTsur) Write out surface net heat and salt flux +! Hout(idLhea) Write out latent heat flux. +! Hout(idShea) Write out sensible heat flux. +! Hout(idLrad) Write out long-wave radiation flux. +! Hout(idSrad) Write out short-wave radiation flux. +! Hout(idEmPf) Write out E-P flux. +! Hout(idevap) Write out evaporation rate. +! Hout(idrain) Write out precipitation rate. +! +! Hout(idDano) Write out density anomaly. +! Hout(idVvis) Write out vertical viscosity coefficient. +! Hout(idTdif) Write out vertical diffusion coefficient of temperature. +! Hout(idSdif) Write out vertical diffusion coefficient of salinity. +! Hout(idHsbl) Write out depth of oceanic surface boundary layer. +! Hout(idHbbl) Write out depth of oceanic bottom boundary layer. +! Hout(idMtke) Write out turbulent kinetic energy. +! Hout(idMtls) Write out turbulent kinetic energy times length scale. +! +! Hout(inert) Write out extra inert passive tracers. +! +!------------------------------------------------------------------------------ +! Logical switches (T/F) to activate writing of instantaneous fields into +! QUICKSAVE file. +!------------------------------------------------------------------------------ +! +! Qout(idUvel) Write out 3D U-velocity component. +! Qout(idVvel) Write out 3D V-velocity component. +! Qout(idu3dE) Write out 3D Eastward velocity component at RHO-points. +! Qout(idv3dN) Write out 3D Northward velocity component at RHO-points. +! Qout(idWvel) Write out 3D W-velocity component. +! Qout(idOvel) Write out 3D omega vertical velocity. +! Qout(idUbar) Write out 2D U-velocity component. +! Qout(idVbar) Write out 2D V-velocity component. +! Qout(idu2dE) Write out 2D Eastward velocity component at RHO-points. +! Qout(idv2dN) Write out 2D Northward velocity component at RHO-points. +! Qout(idFsur) Write out free-surface. +! Qout(idBath) Write out time-dependent bathymetry. +! +! Qout(idTvar) Write out active (NAT) tracers: temperature and salinity. +! +! Qout(idUsur) Write out surface U-velocity component. +! Qout(idVsur) Write out surface V-velocity component. +! Qout(idUsuE) Write out surface Eastward velocity component at RHO-points. +! Qout(idVsuN) Write out surface Northward velocity component at RHO-points. +! +! Qout(idsurT) Write out surface temperature and salinity +! +! Qout(idpthR) Write out time-varying depths of RHO-points. +! Qout(idpthU) Write out time-varying depths of U-points. +! Qout(idpthV) Write out time-varying depths of V-points. +! Qout(idpthW) Write out time-varying depths of W-points. +! +! Qout(idUsms) Write out surface U-momentum stress. +! Qout(idVsms) Write out surface V-momentum stress. +! Qout(idUbms) Write out bottom U-momentum stress. +! Qout(idVbms) Write out bottom V-momentum stress. +! +! Qout(idUbrs) Write out current-induced, U-momentum stress. +! Qout(idVbrs) Write out current-induced, V-momentum stress. +! Qout(idUbws) Write out wind-induced, bottom U-wave stress. +! Qout(idVbws) Write out wind-induced, bottom V-wave stress. +! Qout(idUbcs) Write out bottom maximum wave and current U-stress. +! Qout(idVbcs) Write out bottom maximum wave and current V-stress. +! +! Qout(idUbot) Write out wind-induced, bed wave orbital U-velocity. +! Qout(idVbot) Write out wind-induced, bed wave orbital V-velocity. +! Qout(idUbur) Write out bottom U-velocity above bed. +! Qout(idVbvr) Write out bottom V-velocity above bed. +! +! Qout(idW2xx) Write out 2D radiation stress, Sxx component. +! Qout(idW2xy) Write out 2D radiation stress, Sxy component. +! Qout(idW2yy) Write out 2D radiation stress, Syy component. +! Qout(idU2rs) Write out 2D U-radiation stress. +! Qout(idV2rs) Write out 2D V-radiation stress. +! Qout(idU2Sd) Write out 2D U-Stokes velocity. +! Qout(idV2Sd) Write out 2D V-Stokes velocity. +! +! Qout(idW3xx) Write out 3D radiation stress, Sxx component. +! Qout(idW3xy) Write out 3D radiation stress, Sxy component. +! Qout(idW3yy) Write out 3D radiation stress, Syy component. +! Qout(idW3zx) Write out 3D radiation stress, Szx component. +! Qout(idW3zy) Write out 3D radiation stress, Szy component. +! Qout(idU3rs) Write out 3D U-radiation stress. +! Qout(idV3rs) Write out 3D V-radiation stress. +! Qout(idU3Sd) Write out 3D U-Stokes velocity. +! Qout(idV3Sd) Write out 3D V-Stokes velocity. +! +! Qout(idWamp) Write out wave height. +! Qout(idWlen) Write out wave length. +! Qout(idWdir) Write out wave direction. +! Qout(idWptp) Write out wave surface period. +! Qout(idWpbt) Write out wave bottom period. +! Qout(idWorb) Write out wave bottom orbital velocity. +! Qout(idWdis) Write out wave dissipation. +! +! Qout(idPair) Write out surface air pressure. +! Qout(idTair) Write out surface air temperature. +! Qout(idUair) Write out surface U-wind component. +! Qout(idVair) Write out surface V-wind component. +! +! Qout(idTsur) Write out surface net heat and salt flux +! Qout(idLhea) Write out latent heat flux. +! Qout(idShea) Write out sensible heat flux. +! Qout(idLrad) Write out long-wave radiation flux. +! Qout(idSrad) Write out short-wave radiation flux. +! Qout(idEmPf) Write out E-P flux. +! Qout(idevap) Write out evaporation rate. +! Qout(idrain) Write out precipitation rate. +! +! Qout(idDano) Write out density anomaly. +! Qout(idVvis) Write out vertical viscosity coefficient. +! Qout(idTdif) Write out vertical diffusion coefficient of temperature. +! Qout(idSdif) Write out vertical diffusion coefficient of salinity. +! Qout(idHsbl) Write out depth of oceanic surface boundary layer. +! Qout(idHbbl) Write out depth of oceanic bottom boundary layer. +! Qout(idMtke) Write out turbulent kinetic energy. +! Qout(idMtls) Write out turbulent kinetic energy times length scale. +! +! Qout(inert) Write out inert passive tracers. +! Qout(Snert) Write out surface inert passive tracers. +! +!------------------------------------------------------------------------------ +! Logical switches (T/F) to activate writing of time-averaged fields into +! AVERAGE file. +!------------------------------------------------------------------------------ +! +! Aout(idUvel) Write out 3D U-velocity component. +! Aout(idVvel) Write out 3D V-velocity component. +! Aout(idu3dE) Write out 3D Eastward velocity component at RHO-points. +! Aout(idv3dN) Write out 3D Northward velocity component at RHO-points. +! Aout(idWvel) Write out 3D W-velocity component. +! Aout(idOvel) Write out 3D omega vertical velocity. +! Aout(idUbar) Write out 2D U-velocity component. +! Aout(idVbar) Write out 2D V-velocity component. +! Aout(idu2dE) Write out 2D Eastward velocity component at RHO-points. +! Aout(idv2dN) Write out 2D Northward velocity component at RHO-points. +! Aout(idFsur) Write out free-surface. +! +! Aout(idTvar) Write out active (NAT) tracers: temperature and salinity. +! +! Aout(idUsms) Write out surface U-momentum stress. +! Aout(idVsms) Write out surface V-momentum stress. +! Aout(idUbms) Write out bottom U-momentum stress. +! Aout(idVbms) Write out bottom V-momentum stress. +! +! Aout(idW2xx) Write out 2D radiation stress, Sxx component. +! Aout(idW2xy) Write out 2D radiation stress, Sxy component. +! Aout(idW2yy) Write out 2D radiation stress, Syy component. +! Aout(idU2rs) Write out 2D U-radiation stress. +! Aout(idV2rs) Write out 2D V-radiation stress. +! Aout(idU2Sd) Write out 2D U-Stokes velocity. +! Aout(idV2Sd) Write out 2D V-Stokes velocity. +! +! Aout(idW3xx) Write out 3D radiation stress, Sxx component. +! Aout(idW3xy) Write out 3D radiation stress, Sxy component. +! Aout(idW3yy) Write out 3D radiation stress, Syy component. +! Aout(idW3zx) Write out 3D radiation stress, Szx component. +! Aout(idW3zy) Write out 3D radiation stress, Szy component. +! Aout(idU3rs) Write out 3D U-radiation stress. +! Aout(idV3rs) Write out 3D V-radiation stress. +! Aout(idU3Sd) Write out 3D U-Stokes velocity. +! Aout(idV3Sd) Write out 3D V-Stokes velocity. +! +! Aout(idPair) Write out surface air pressure. +! Aout(idTair) Write out surface air temperature. +! Aout(idUair) Write out surface U-wind component. +! Aout(idVair) Write out surface V-wind component. +! +! Aout(idTsur) Write out surface net heat and salt flux +! Aout(idLhea) Write out latent heat flux. +! Aout(idShea) Write out sensible heat flux. +! Aout(idLrad) Write out long-wave radiation flux. +! Aout(idSrad) Write out short-wave radiation flux. +! Aout(idevap) Write out evaporation rate. +! Aout(idrain) Write out precipitation rate. +! +! Aout(idDano) Write out density anomaly. +! Aout(idVvis) Write out vertical viscosity coefficient. +! Aout(idTdif) Write out vertical diffusion coefficient of temperature. +! Aout(idSdif) Write out vertical diffusion coefficient of salinity. +! Aout(idHsbl) Write out depth of oceanic surface boundary layer. +! Aout(idHbbl) Write out depth of oceanic bottom boundary layer. +! +! Aout(id2dRV) Write out 2D relative vorticity (vertically integrated). +! Aout(id3dRV) Write out 3D relative vorticity. +! Aout(id2dPV) Write out 2D potential vorticity (shallow water). +! Aout(id3dPV) Write out 3D potential vorticity. +! +! Aout(idu3dD) Write out detided 3D U-velocity. +! Aout(idv3dD) Write out detided 3D V-velocity. +! Aout(idu2dD) Write out detided 2D U-velocity. +! Aout(idv2dD) Write out detided 2D V-velocity. +! Aout(idFsuD) Write out detided free-surface +! +! Aout(idTrcD) Write out detided temperature and salinity. +! +! Aout(idHUav) Write out u-volume flux, Huon. +! Aout(idHVav) Write out v-volume flux, Hvom. +! Aout(idUUav) Write out quadratic term. +! Aout(idUVav) Write out quadratic term. +! Aout(idVVav) Write out quadratic term. +! Aout(idU2av) Write out quadratic term. +! Aout(idV2av) Write out quadratic term. +! Aout(idZZav) Write out quadratic term. +! +! Aout(idTTav) Write out quadratic active and inert tracers terms. +! Aout(idUTav) Write out quadratic active and inert tracers terms. +! Aout(idVTav) Write out quadratic active and inert tracers terms. +! Aout(iHUTav) Write out active and inert tracer u-volume flux, . +! Aout(iHVTav) Write out active and inert tracer v-volume flux, . +! +! Aout(inert) Write out extra inert passive tracers. +! +!------------------------------------------------------------------------------ +! Logical switches (T/F) to activate writing of time-averaged fields into +! DIAGNOSTIC file. +!------------------------------------------------------------------------------ +! +! Time-averaged, 2D momentum (ubar,vbar) diagnostic terms: +! (if DIAGNOSTICS_UV) +! +! Dout(M2rate) Write out acceleration. +! Dout(M2pgrd) Write out pressure gradient. +! Dout(M2fcor) Write out Coriolis force, if UV_COR. +! Dout(M2hadv) Write out horizontal total advection, if UV_ADV. +! Dout(M2xadv) Write out horizontal XI-advection, if UV_ADV. +! Dout(M2yadv) Write out horizontal ETA-advection, if UV_ADV. +! Dout(M2hrad) Write out horizontal total radiation stress, NEARSHORE_MELLOR. +! Dout(M2hvis) Write out horizontal total viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M2xvis) Write out horizontal XI-viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M2yvis) Write out horizontal ETA-viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M2sstr) Write out surface stress. +! Dout(M2bstr) Write out bottom stress +! +! Time-averaged, 3D momentum (u,v) diagnostic terms: +! (if SOLVE3D and DIAGNOSTICS_UV) +! +! Dout(M3rate) Write out acceleration. +! Dout(M3pgrd) Write out pressure gradient. +! Dout(M3fcor) Write out Coriolis force, if UV_COR. +! Dout(M3hadv) Write out horizontal total advection, if UV_ADV. +! Dout(M3xadv) Write out horizontal XI-advection, if UV_ADV. +! Dout(M3yadv) Write out horizontal ETA-advection, if UV_ADV. +! Dout(M3hrad) Write out horizontal total radiation stress, NEARSHORE_MELLOR. +! Dout(M3vrad) Write out vertical radiation stress, if NEARSHORE_MELLOR. +! Dout(M3hvis) Write out horizontal total viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M3xvis) Write out horizontal XI-viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M3yvis) Write out horizontal ETA-viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M3yvis) Write out horizontal ETA-viscosity, if UV_VIS2 or UV_VIS4. +! Dout(M3vvis) Write out vertical viscosity. +! +! Time-averaged, active (temperature and salinity) and passive (inert) tracer +! diagnostic terms, [1:NAT+NPT,Ngrids] values expected: +! (if SOLVE3D and DIAGNOSTICS_TS) +! +! Dout(iTrate) Write out time rate of change. +! Dout(iThadv) Write out horizontal total advection. +! Dout(iTxadv) Write out horizontal XI-advection. +! Dout(iTyadv) Write out horizontal ETA-advection. +! Dout(iTvadv) Write out vertical advection. +! Dout(iThdif) Write out horizontal total diffusion, if TS_DIF2 or TS_DIF4. +! Dout(iTxdif) Write out horizonta1 XI-diffusion, if TS_DIF2 or TS_DIF4. +! Dout(iTydif) Write out horizontal ETA-diffusion, if TS_DIF2 or TS_DIF4. +! Dout(iTsdif) Write out horizontal S-diffusion, if TS_DIF2 or TS_DIF4 and +! rotated tensor (MIX_GEO_TS or MIX_ISO_TS). +! Dout(iTvdif) Write out vertical diffusion. +! +!------------------------------------------------------------------------------ +! Generic User parameters. +!------------------------------------------------------------------------------ +! +! NUSER Number of User parameters to consider (integer). +! +! USER Vector containing user parameters (real array). This array +! is used with the SANITY_CHECK to test the correctness of +! the tangent linear adjoint models. It contains information +! of the model variable and grid point to perturb: +! +! INT(user(1)): tangent state variable to perturb +! INT(user(2)): adjoint state variable to perturb +! [isFsur=1] free-surface +! [isUbar=2] 2D U-momentum +! [isVbar=3] 2D V-momentum +! [isUvel=4] 3D U-momentum +! [isVvel=5] 3D V-momentum +! [isTvar=6] First tracer (temperature) +! [ ... ] +! [isTvar=?] Last tracer +! +! INT(user(3)): I-index of tangent variable to perturb +! INT(user(4)): I-index of adjoint variable to perturb +! INT(user(5)): J-index of tangent variable to perturb +! INT(user(6)): J-index of adjoint variable to perturb +! INT(user(7)): K-index of tangent variable to perturb, if 3D +! INT(user(8)): K-index of adjoint variable to perturb, if 3D +! +! Set tangent and adjoint parameters to the same values +! if perturbing and reporting the same variable. +! +!------------------------------------------------------------------------------ +! I/O options and parameters. A more complete description of the available +! options can be found in WikiROMS (https://myroms.org/wiki/IO). +!------------------------------------------------------------------------------ +! +! The ROMS input and output NetCDF files can be processed using the standard +! NetCDF library developed by UNIDATA, the Parallel-IO (PIO) library developed +! at NCAR, or the SCORPIO library available in E3SM (Sreepathi et al., 2013; +! doi:10.1109/HiPC.2013.6799128). The SCORPIO library was forked from the PIO +! library several years ago, and they have evolved separately. In addition to +! the standard NetCDF library, ROMS can be compiled with either the PIO or +! SCORPIO libraries. Check www.myroms.org/wiki/External_Libraries for more +! information on how to obtain and install these libraries. The user has the +! choice to select which library is used to process input and output NetCDF +! files. For parallel I/O, we recommend using the PIO library because it is +! more efficient than the SCORPIO library in our benchmark tests. +! +! The Parallel I/O using the PIO or SCORPIO libraries is restricted to +! distributed-memory applications because it uses MPI-IO implementations +! like ROMIO. +! +! * ROMS Input and Output NetCDF library to use flag: [1 or 2] +! +! [1] Standard NetCDF3 or NetCDF4 library (Unidata) +! [2] Serial/Parallel I/O using Paralle-IO (PIO) library (MPI applications) +! +! INP_LIB Reading library flag for input NetCDF files +! +! OUT_LIB Creation/writing library flag for output NetCDF files +! +! * PIO method flag for reading/writing NetCDF files: [0,1,2,3,4] +! +! [0] parallel read and write of PnetCDF files (CDF-5 type) +! [1] parallel read and write of PnetCDF files (NetCDF3 64-bit offset type) +! [2] serial read and write of NetCDF3 files (NetCDF3 64-bit offset type) +! [3] parallel read and serial write of NetCDF4/HDF5 files (NetCDF4 type) +! [4] parallel read and write of NETCDF4/HDF5 files (NetCDF4 type) +! +! PIO_METHOD PIO library file type for reading or writing. Depending on +! the build of the PIO library, not all the I/O types are +! available. If NetCDF library does not support parallel I/O, +! PIO_METHOD=3,4 are not available. Notice that we can create +! CDF-5 type PnetCDF files (PIO_METHOD=0), but it is not +! recommended because portability and post-processing +! constraints. Currently, NetCDF4/HDF5 data compression is +! possible with PIO_METHOD=3 during serial write. +! +! * PIO library processes set-up: +! +! PIO_IOTASKS Number of MPI processors used for I/O. If I/O decomposition is +! identical to the computational decomposition, PIO_IOTASK is +! equal to NtileI*NtileJ. Typically, it is advantageous and +! highly recommended to define the I/O decomposition in smaller +! number of processes for efficiency and to avoid MPI +! communication bottlenecks. +! +! PIO_STRIDE Stride step in the MPI-rank between I/O tasks. +! +! PIO_BASE Offset for the first I/O task (usually, PIO_BASE=1). +! +! PIO_AGGREG Number of MPI-aggregators to use in intra-communication mode to +! improve MPI collective I/O performance. +! +! In intra-communications mode, all processors in OCN_COMM_WORLD +! are involved in computations. A subset or all processors does +! I/O (and also computations). The PIO_IOTASKS and PIO_STRIDE +! parameters specify the total number of I/O tasks and the stride +! between them with respect to the ROMS MPI-communicator object, +! OCN_COMM_WORLD. The optional PIO_BASE parameter is used to shift +! the first I/O task away from the first computational task. This +! is often desirable because the application's first computational +! task usually has higher memory requirements than other processes. +! If the MPI-processes are spread over several hardware nodes, it +! is highly recommended to use a value for PIO_STRIDE that scatters +! the I/O processes over all nodes. Avoid all the I/O processes +! occupying the same node. +! +! In the inter-communications (asynchronous) mode, the I/O tasks +! are a disjointed set of dedicated I/O processes and do not +! perform computations. It is possible to have several groups of +! computational units running separate models (coupling) where +! all the I/O data are sent to dedicated processes. Asynchronous +! I/O is still under development and not recommended for use at +! this time. +! +! +! * PIO rearranger methods for moving data between computational and I/O +! processes: +! +! [1] Box rearrangement +! [2] Subset rearrangement +! +! PIO_REARR Rearrangement method between computational and I/O processes. It +! provides the ability to rearrange data between computational +! and parallel I/O decompositions. +! +! In the box method, data is rearranged from computational to I/O +! processes in a continuous manner to the data ordering in the +! file. Since the ordering of data between computational and I/O +! partitions may be different, the rearrangement will require +! all-to-all MPI communications. Also, notice that each computing +! tile may transfer data to one or more I/O processes. +! +! In the subset method, each I/O process is associated with a +! subset of computing processes. The computing tile sends its data +! to a unique I/O process. The data on I/O processes may be more +! fragmented to the ordering on disk, which may increase the +! communications to the storage medium. However, the rearrangement +! scales better since all-to-all MPI communications are not +! required. +! +! * PIO rearranger MPI communication flag: +! +! [0] Point-to-Point (basic send/receive individual operations) +! [1] Collective (high-level gather/scatter grouped operations) +! +! PIO_REARRCOM Type of communications between computational to I/O processes. +! In some systems with a generic MPI library implementation, the +! Point-to-Point communications are more efficient. +! +! * PIO rearranger MPI communications direction control flag: +! +! [0] Enable computational to I/O processes, and vice versa +! [1] Enable computational to I/O processes only +! [2] Enable I/O to computational processes only +! [3] Disable flow control +! +! PIO_REARRDIR Flow control algorithm between computational and I/O processes: +! +! Optimally, MPI communications should be designed to send a modest +! number messages evenly distributed across a number of processes. +! An excessive number of messages to a single MPI-process can +! exhaust the buffer space which can affect efficiency or failure +! due to the slowdown in the retransmitting of dropped messages. +! PIO only send messages (Isend) when the receiver is ready and +! has sufficient resources. +! +! * PIO rearranger options for communications from computational to I/O +! processes (C2I): +! +! PIO_C2I_HS Logical switch (T/F) to enable C2I exchange handshake +! PIO_C2I_Send Logical switch (T/F) to enable C2I MPI-Isends +! PIO_C2I_Preq Maximum pending C2I requests +! +! * PIO rearranger options for communications from I/O to computational +! processes (I2C): +! +! PIO_I2C_HS Logical switch (T/F) to enable I2C exchange handshake +! PIO_I2C_Send Logical switch (T/F) to enable I2C MPI-Isends +! PIO_I2C_Preq Maximum pending I2C requests +! +! * NetCDF-4/HDF5 compression parameters for output files: +! +! This capability is used when both HDF5 and DEFLATE C-preprocessing +! options are activated. The user needs to compile with the NetCDF-4 +! (HDF5) and MPI libraries. File deflation cannot be used in parallel +! I/O for writing because the compression makes it impossible for the +! HDF5 library to exactly map the data to the disk location. For more +! information, check NetCDF official website: +! +! www.unidata.ucar.edu/software/netcdf +! +! NC_SHUFFLE Shuffle filter integer flag. If non-zero, turn on shuffle +! filter. +! +! NC_DEFLATE Deflate filter integer flag, If non-zero, turn on deflate +! filter at the level specified by the NC_DLEVEL parameter. +! +! NC_DLEVEL Deflate filter level parameter (integer). If NC_DEFLATE is +! non-zero, set the deflate level to this value. Must be +! between 0 and 9. +! +!------------------------------------------------------------------------------ +! Input/output NetCDF filenames (string with a maximum of 256 characters). +!------------------------------------------------------------------------------ +! +! Input filenames: +! +! GRDNAME Input grid filename. +! +! ININAME Input nonlinear initial conditions filename. It can be a +! re-start file. +! +! ITLNAME Input tangent linear model initial conditions filename. +! +! IRPNAME Input representer model initial conditions filename. +! +! IADNAME Input adjoint model initial conditions filename. +! +! FWDNAME Input forward solution fields filename. +! +! ADSNAME Input adjoint sensitivity functional filename. +! +! +! Input adjoint forcing filenames for computing observations impacts +! during the analysis-forecast cycle when RBL4DVAR_FCT_SENSITIVITY is +! activated. The files FOInameA and FOInameB are used when the forecast +! metric is defined in state-space (CPP option OBS_SPACE is off). Both +! are regular adjoint forcing files just like ADSname. +! +! (See www.myroms.org/wiki/Analysis-Forecast_Cycle_Observation_Impacts) +! +! FOInameA Forecast initialized with 4D-Var analysis (red curve) +! +! FOInameB Forecast initialized with 4D_Var background (blue curve) +! +! +! Input NetCDF filenames for the forecasts initialized from the 4D-Var +! analysis files: +! +! FCTnameA Current 4D-Var analysis cycle (red curve) +! +! FCTnameB Previous 4D-Var analysis cycle (blue curve) +! +! +! Nesting grids connectivity data: +! +! NGCNAME Input nested grids contact points information filename. This +! NetCDF file is currently generated using script: +! +! matlab/grid/contact.m +! +! from the ROMS Matlab repository. The nesting information +! is not trivial and this Matlab scripts is quite complex. See +! +! https://www.myroms.org/wiki/index.php/Nested_Grids +! https://www.myroms.org/wiki/index.php/Grid_Processing_Scripts +! +! for more information. +! +! +! Input lateral boundary conditions file(s) name: +! +! NBCFILES Number of unique boundary files per nested grid. +! +! BRYNAME Input open boundary data filename(s) per nested grid. +! +! The USER has the option to enter several filenames for the lateral +! boundary conditions variables and or split input data time records for +! each nested grid. For example, the USER may have different files for +! physical, biology, and sediment state variables. The model will scan +! the file list and will read the needed data from the first file in the +! list containing the lateral boundary variable. Therefore, the order of +! the filenames is critical. It is also possible to split input data +! time records into several NetCDF files. +! +! NBCFILES == 2 ! number of boundary files +! +! BRYNAME == my_physics_bry_year1.nc | ! physical kernel variables +! my_physics_bry_year2.nc \ +! my_biology_bry_year1.nc | ! biological tracers +! my_biology_bry_year2.nc +! +! +! Input climatology file(s) name: +! +! NCLMFILES Number of unique climatology files per nested grid. +! +! CLMNAME Input climatology data filename(s) per nested grid. +! +! The USER has the option to enter several filenames for the climatology +! variables and or split input data time records for each nested grid. +! For example, the USER may have different files for physical, biology, +! and sediment state variables. The model will scan the file list and +! will read the needed data from the first file in the list containing +! the lateral climatology variable. Therefore, the order of the filenames +! is critical. It is also possible to split input data time records into +! several NetCDF files. +! +! NCLMFILES == 2 ! number of climatology files +! +! CLMNAME == my_physics_clm_year1.nc | ! physical kernel variables +! my_physics_bry_year2.nc \ +! my_biology_bry_year1.nc | ! biological tracers +! my_biology_bry_year2.nc +! +! +! Input nudging coefficients filename: +! +! NUDNAME Input nudging coefficients filename. +! +! +! Input Sources/Sinks forcing filename: +! +! SSFNAME River runoff data. This file is now separated from the +! regular forcing files to allow manipulations over nested +! grids. A particular nesting grid may or may not have +! Sources/Sinks forcing. +! +! For example, in an application with 3 nested grids but +! with river forcing in grids 1 and 3 we would have: +! +! LuvSrc == T F T +! LtracerSrc == 2*T 2*F 2*T +! +! SSFNAME == my_rivers_grid1.nc \ +! my_rivers_grid2.nc \ +! my_rivers_grid3.nc +! +! Here, "my_rivers_grid2.nc" is a dummy name that will never +! be processed in ROMS because of the logical switches are +! FALSE the second grid. +! +! +! Input/output tidal forcing filename: +! +! TIDENAME Tidal constituents period, phase, elevation, and current data. +! This data is needed when SSH_TIDES, UV_TIDES, or both are +! activated to force tides at the open boundaries. Currently, +! in nested applications, the tidal forcing is used in the +! coarser/larger grid (ng=1). If AVERAGES_DETIDE is activated, +! several least-squares time-accumulated harmonic variables +! are written into this NetCDF file to facilitate restart for +! during long fitting simulations. +! +! +! Input forcing file(s) name: +! +! NFFILES Number of unique forcing files per nested grid. +! +! FRCNAME Input forcing fields filename per nested grid. +! +! The USER has the option to enter several filenames for forcing fields +! and or split input data time records for each nested grid. For example, +! the USER may have different files for wind products, heat fluxes, etc. +! The model will scan the file list and will read the needed data from +! the first file in the list containing the forcing field. Therefore, +! the order of the filenames is essential. It is also possible to split +! input data time records into several NetCDF files. +! +! Use a single line per entry with a continuation (\) or vertical bar (|) +! symbol after each entry, except the last one: +! +! NFFILES == 6 ! number of unique forcing files +! +! FRCNAME == my_lwrad_year1.nc | ! net longwave radiation flux +! my_lwrad_year2.nc \ +! my_swrad_year1.nc | ! solar shortwave radiation flux +! my_swrad_year2.nc \ +! my_winds_year1.nc | ! surface winds +! my_winds_year2.nc \ +! my_Pair_year1.nc | ! surface air pressure +! my_Pair_year2.nc \ +! my_Qair_year1.nc | ! surface air relative humidity +! my_Qair_year2.nc \ +! my_Tair_year1.nc | ! surface air temperature +! my_Tair_year2.nc +! +! +! Output filenames: +! +! DAINAME Output data assimilation next cycle initial conditions (4D-Var +! analysis) or restart (Ensemble Kalman Filter, EnKF) filename. +! GSTNAME Output GST analysis re-start filename. +! RSTNAME Output re-start filename. +! HISNAME Output history filename. +! QCKNAME Output quicksave filename. +! TLFNAME Output impulse forcing for tangent linear (TLM and RPM) models. +! TLMNAME Output tangent linear filename. +! ADJNAME Output adjoint filename. +! AVGNAME Output averages filename. +! HARNAME Output least-squares detiding harmonics filename. +! DIANAME Output diagnostics filename. +! STANAME Output stations filename. +! FLTNAME Output floats filename. +! +!------------------------------------------------------------------------------ +! Input ASCII parameters filenames. +!------------------------------------------------------------------------------ +! +! APARNAM Input assimilation parameters filename. +! SPOSNAM Input stations positions filename. +! FPOSNAM Input initial drifters positions filename. +! BPARNAM Input biological parameters filename. +! SPARNAM Input sediment transport parameters filename. +! USRNAME USER's input generic filename. +! diff --git a/cloudflow/job/templates/submit.cloudflow.template b/cloudflow/job/templates/submit.cloudflow.template new file mode 100644 index 0000000..8dcd5db --- /dev/null +++ b/cloudflow/job/templates/submit.cloudflow.template @@ -0,0 +1,54 @@ +#!/bin/bash -l +# set -x + +echo "RUNDIR: $RUNDIR" +cd $RUNDIR +echo "PWD: $PWD" + +PHOME= + +DATETIME=`date +'%Y-%h-%d-T%H:%M:%S'` +echo "${DATETIME}" > run.start + +echo "MPIOPTS: $MPIOPTS" + +hostname + +# Load modules +module purge +module use -a /mnt/efs/fs1/save/environments/spack/share/spack/modules/linux-rhel8-x86_64 +module load intel-oneapi-compilers/2023.1.0-gcc-11.2.1-3a7dxu3 +module load intel-oneapi-mpi/2021.9.0-intel-2021.9.0-egjrbfg +setenv MPI_INC "$env(I_MPI_ROOT)/include" + +module load zlib-ng/2.1.4-intel-2021.9.0-57ptxrw +module load libszip/2.1.1-intel-2021.9.0-s3p3pgl +module load hdf5/1.14.3-intel-2021.9.0-4xskthb +module load netcdf-fortran/4.6.1-intel-2021.9.0-meeveoj +module load netcdf-c/4.9.2-intel-2021.9.0-vznmeik + +DATETIME=`date +'%Y-%h-%d-T%H:%M:%S'` +echo "${DATETIME}" > run.start + +echo "MPIOPTS: $MPIOPTS" + +#PrepLine1 +#PrepLine2 + +echo "mpirun $MPIOPTS $PHOME/ " +mpirun $MPIOPTS $PHOME/ + +ERROVALUE=$? +if [ $ERROVALUE == 0 ] ; then + RUNSUFFIX="complete" + cp PE0000/fort.6{7,8}* . + rm -rf PE* metis* part* fort.80 rads.64.nc fort.90.nc + mv -f $RUNDIR/../2018 $RUNDIR/../2018.previous +else + RUNSUFFIX="failed" +fi + +DATETIME=`date +'%Y-%h-%d-T%H:%M:%S'` +echo "${DATETIME}" > run.${RUNSUFFIX} + +exit $ERROVALUE diff --git a/cloudflow/utils/romsUtil.py b/cloudflow/utils/romsUtil.py index cdc49d7..9939d2f 100644 --- a/cloudflow/utils/romsUtil.py +++ b/cloudflow/utils/romsUtil.py @@ -102,6 +102,12 @@ def makeOceanin(NPROCS, settings, template, outfile, ratio=1.0): ##################################################################### +def makeADCIRCin(settings, template, outfile): + sedoceanin(template, outfile, settings) + return + +##################################################################### + def ndays(cdate1, cdate2): diff --git a/cloudflow/workflows/cora_launcher.sh b/cloudflow/workflows/cora_launcher.sh new file mode 100755 index 0000000..e53727d --- /dev/null +++ b/cloudflow/workflows/cora_launcher.sh @@ -0,0 +1,99 @@ +#!/bin/env bash + +# Script used to launch forecasts. +# BASH is used to bridge between the Python workflow and BASH based run scripts + +# set -xa +set -a +ulimit -c unlimited +ulimit -s unlimited + +#__copyright__ = "Copyright © 2023 RPS Group, Inc. All rights reserved." +#__license__ = "BSD 3-Clause" + +if [ $# -lt 6 ] ; then + echo "Usage: $0 YYYY PROJHOME NPROCS PPN HOSTS CONFIG" + exit 1 +fi + +# This was created to launch a job via Python +# The Python scripts create the cluster on-demand +# and submits this job with the list of hosts available. + +export YYYY=$1 +export PROJHOME=$2 +export NPROCS=$3 +export PPN=$4 +export HOSTS=$5 +export CONFIG=$6 + +#OpenMPI +#mpirun --version + +#IntelMPI +#mpirun --version + + +# TODO: put the following back in +# mpirun --version | grep Intel +# impi=$? +# +# mpirun --version | grep "Open MPI" +# openmpi=$? + +# for openMPI openmpi=1 +# for Intel MPI set impi=1 + +openmpi=0 +impi=1 + + +# MPIOPTS is used by the fcstrun.sh script for nosofs and wrfroms +if [ $openmpi -eq 1 ]; then + export MPIOPTS="-host $HOSTS -np $NPROCS -npernode $PPN -oversubscribe" +elif [ $impi -eq 1 ]; then + export MPIOPTS="-launcher ssh -hosts $HOSTS -np $NPROCS -ppn $PPN" + #export I_MPI_OFI_LIBRARY_INTERNAL=1 # Use intel's fabric library + export I_MPI_OFI_LIBRARY_INTERNAL=0 # Using AWS EFA Fabric on AWS + export I_MPI_DEBUG=0 +else + echo "ERROR: Unsupported mpirun version ..." + exit 1 +fi + +OFS='adcirc-cora' + +echo "**********************************************************" +echo "Current directory is $PWD" +echo "**********************************************************" + +#TODO: Make this section a switch statement instead +# Can put domain specific options here +if [[ "$OFS" == "adcirc-cora" ]]; then + + export JOBDIR=$PROJHOME + + # TODO: parameterize ec95d below + export RUNDIR=$PROJHOME/ERA5/ec95d/$YYYY + TRACKSDIR=$PROJHOME/TracksToRun + + cp ./job/templates/submit.cloudflow.template "$JOBDIR/common" + touch "$TRACKSDIR/${YYYY}.trk" + + cd "$JOBDIR" || exit 1 + + RUNSCRIPT="./bin/run_storms.sh --config $CONFIG --maxrun=1" + # example ./bin/run_storms.sh -v --config ./configs/ec95d_prior_config.yml --maxrun=1 + + # Run it + $RUNSCRIPT + result=$? + +else + echo "Model not supported $OFS" + exit 1 +fi + +exit $result + + diff --git a/cloudflow/workflows/fcst_launcher.sh b/cloudflow/workflows/fcst_launcher.sh index 41494ce..fc66286 100755 --- a/cloudflow/workflows/fcst_launcher.sh +++ b/cloudflow/workflows/fcst_launcher.sh @@ -2,10 +2,10 @@ # Script used to launch forecasts. # BASH is used in order to bridge between the Python interface and NCO's BASH based run scripts -WRKDIR=/save/$USER - -set -xa +# WRKDIR=/save/$USER +# set -xa set -a + ulimit -c unlimited ulimit -s unlimited @@ -13,14 +13,17 @@ ulimit -s unlimited #__license__ = "BSD 3-Clause" -if [ $# -lt 7 ] ; then - echo "Usage: $0 YYYYMMDD HH COMOUT NPROCS PPN HOSTS " +if [ $# -lt 8 ] ; then + echo "Usage: $0 YYYYMMDD HH COMOUT WRKDIR NPROCS PPN HOSTS " exit 1 fi +export I_MPI_OFI_LIBRARY_INTERNAL=0 # Using AWS EFA Fabric on AWS + #export I_MPI_DEBUG=${I_MPI_DEBUG:-0} -#export I_MPI_FABRICS=${I_MPI_FABRICS:-shm:ofi} +#export I_MPI_OFI_LIBRARY_INTERNAL=1 # Use intel's fabric library #export I_MPI_FABRICS=efa +#export I_MPI_FABRICS=${I_MPI_FABRICS:-shm:ofi} #export FI_PROVIDER=efa #export FI_PROVIDER=tcp @@ -32,11 +35,12 @@ fi export CDATE=$1 export HH=$2 export COMOUT=$3 # OUTDIR in caller -export NPROCS=$4 -export PPN=$5 -export HOSTS=$6 -export OFS=$7 -export EXEC=$8 +export WRKDIR=$4 +export NPROCS=$5 +export PPN=$6 +export HOSTS=$7 +export OFS=$8 +export EXEC=$9 #OpenMPI #mpirun --version @@ -77,8 +81,7 @@ if [ $openmpi -eq 1 ]; then #export MPIOPTS="-launch-agent ssh -host $HOSTS -n $NPROCS -npernode $PPN" elif [ $impi -eq 1 ]; then export MPIOPTS="-launcher ssh -hosts $HOSTS -np $NPROCS -ppn $PPN" - export I_MPI_OFI_LIBRARY_INTERNAL=1 # Using AWS EFA Fabric on AWS - export I_MPI_DEBUG=1 + export I_MPI_DEBUG=0 else echo "ERROR: Unsupported mpirun version ..." exit 1 @@ -92,10 +95,11 @@ case $OFS in liveocean) export HOMEnos=$WRKDIR/LiveOcean export JOBDIR=$HOMEnos/jobs - export COMROT=/com/$USER export JOBSCRIPT=$JOBDIR/fcstrun.sh - export JOBARGS="$CDATE $COMROT" + export JOBARGS="$CDATE $COMOUT" cd "$JOBDIR" || exit 1 + + echo "About to run $JOBSCRIPT $JOBDIR" $JOBSCRIPT $JOBARGS result=$? ;; diff --git a/cloudflow/workflows/flows.py b/cloudflow/workflows/flows.py index 60dd3a9..3325ea9 100755 --- a/cloudflow/workflows/flows.py +++ b/cloudflow/workflows/flows.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/python3 -u """ Collection of functions that provide pre-defined Prefect Flow contexts for use in the cloud """ import os @@ -43,8 +43,6 @@ #prelog.handler.formatter.converter = time.localtime # Use the same handler for all of them for handler in prelog.handlers: - #print('Setting the prefect log handler') - #print(handler) pformatter = logging.Formatter('[%(asctime)s] %(levelname)s - %(module)s.%(funcName)s | %(message)s') pformatter.converter = time.localtime handler.setFormatter(pformatter) @@ -139,21 +137,19 @@ def hindcast_flow(hcstconf, hcstjobfile, sshuser) -> Flow: # Create the cluster object cluster = ctasks.cluster_init(hcstconf) - # Setup the job and create the ocean.in + # Setup the job hcstjob = tasks.job_init(cluster, hcstjobfile) # Get forcing data forcing = jtasks.get_forcing_multi(hcstjob, sshuser) # Start the cluster - cluster_start = ctasks.cluster_start(cluster, upstream_tasks=[forcing]) + cluster_start = ctasks.cluster_start(cluster, upstream_tasks=[forcing, hcstjob]) - - # Run the forecast + # Create the oceanin and run the forecasts # This will run in a loop to complete all forecasts hcst_run = tasks.hindcast_run_multi(cluster, hcstjob, upstream_tasks=[cluster_start]) - # Terminate the cluster nodes cluster_stop = ctasks.cluster_terminate(cluster, upstream_tasks=[hcst_run]) @@ -241,6 +237,73 @@ def fcst_flow(fcstconf, fcstjobfile, sshuser) -> Flow: return fcstflow +###################################################################### + +def reanalysis_flow(fcstconf, fcstjobfile) -> Flow: + """ Provides a Prefect Flow for a reanalysis workflow. e.g. CORA ADCIRC + + Parameters + ---------- + fcstconf : str + The JSON configuration file for the Cluster to create + + fcstjobfile : str + The JSON configuration file for the forecast Job + + sshuser : str + The user and host to use for retrieving data from a remote server. + + Returns + ------- + fcstflow : prefect.Flow + """ + + with Flow('reanalysis workflow') as raflow: + ##################################################################### + # FORECAST + ##################################################################### + + # Create the cluster object + cluster = ctasks.cluster_init(fcstconf) + + # Setup the job + fcstjob = tasks.job_init(cluster, fcstjobfile) + + # Get forcing data + # Forcing should be retrieved external to this flow before running + # forcing = jtasks.get_forcing(fcstjob, sshuser) + + # Start the cluster + #cluster_start = ctasks.cluster_start(cluster, upstream_tasks=[forcing]) + cluster_start = ctasks.cluster_start(cluster) + + # Run the forecast + fcst_run = tasks.cora_reanalysis_run(cluster, fcstjob, upstream_tasks=[cluster_start]) + + # Terminate the cluster nodes + cluster_stop = ctasks.cluster_terminate(cluster, upstream_tasks=[fcst_run]) + + # Copy the results to /com (liveocean does not run in ptmp currently) + #cp2com = jtasks.ptmp2com(fcstjob, upstream_tasks=[fcst_run]) + + # Copy the results to S3 (optionally) + #cp2s3 = jtasks.cp2s3(fcstjob, upstream_tasks=[fcst_run]) + #storage_service = tasks.storage_init(provider) + #pngtocloud = tasks.save_to_cloud(plotjob, storage_service, ['*.png'], public=True) + #pngtocloud.set_upstream(plots) + + # Copy the results to S3 (optionally. currently only saves LiveOcean) + #storage_service = tasks.storage_init(provider) + #cp2cloud = tasks.save_history(fcstjob, storage_service, ['*.nc'], public=True, upstream_tasks=[storage_service,cp2com]) + + #pngtocloud.set_upstream(plots) + + # If the fcst fails, then set the whole flow to fail + raflow.set_reference_tasks([fcst_run]) + + return raflow + +###################################################################### def plot_flow(postconf, postjobfile) -> Flow: """ Provides a Prefect Flow for a plotting workflow. Also creates mpegs of sequential plots. diff --git a/cloudflow/workflows/lohindcast_launch.py b/cloudflow/workflows/lohindcast_launch.py index 4399914..474b13b 100755 --- a/cloudflow/workflows/lohindcast_launch.py +++ b/cloudflow/workflows/lohindcast_launch.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env -S python3 -u """ A driver to run workflows from provided job configuration files """ ''' Usage: @@ -11,6 +11,8 @@ import re from signal import signal, SIGINT +sys.stdout.reconfigure(line_buffering=False) + if os.path.abspath('..') not in sys.path: sys.path.append(os.path.abspath('..')) @@ -22,12 +24,23 @@ curdir = os.path.dirname(os.path.abspath(__file__)) -#fcstconf = f'{curdir}/../cluster/configs/liveocean.rps' -fcstconf = f'{curdir}/../cluster/configs/liveocean.config' +###################################################################### +############### Set these for your specific deployment ############### +###################################################################### + +# NOS or IOOS(RPS) +fcstconf = f'{curdir}/../cluster/configs/NOS/nos.liveocean.cfg' +#fcstconf = f'{curdir}/../cluster/configs/RPS/ioos.liveocean.cfg' +#fcstconf = f'{curdir}/../cluster/configs/RPS/test.liveocean.cfg' # This is used for obtaining liveocean forcing data # LiveOcean users need to obtain credentials from UW -sshuser = 'ptripp@apogee.ocean.washington.edu' + +# NOTE: Your ssh public key will need to be added to apogee .ssh/authorized_keys file for passwordless scp. +sshuser = 'username@apogee.ocean.washington.edu' + +###################################################################### + def handler(signal_received, frame): print('SIGINT or CTRL-C detected. Exiting gracefully') diff --git a/cloudflow/workflows/lohindcast_main.py b/cloudflow/workflows/lohindcast_main.py new file mode 120000 index 0000000..25e3855 --- /dev/null +++ b/cloudflow/workflows/lohindcast_main.py @@ -0,0 +1 @@ +lohindcast_launch.py \ No newline at end of file diff --git a/cloudflow/workflows/tasks.py b/cloudflow/workflows/tasks.py index 9aa0bd6..96aec18 100755 --- a/cloudflow/workflows/tasks.py +++ b/cloudflow/workflows/tasks.py @@ -23,6 +23,7 @@ if os.path.abspath('..') not in sys.path: sys.path.append(os.path.abspath('..')) + curdir = os.path.dirname(os.path.abspath(__file__)) from cloudflow.job.Job import Job @@ -41,7 +42,6 @@ __copyright__ = "Copyright © 2023 RPS Group, Inc. All rights reserved." __license__ = "BSD 3-Clause" - pp = pprint.PrettyPrinter() debug = False @@ -332,6 +332,7 @@ def forecast_run(cluster: Cluster, job: Job): OFS = job.OFS NPROCS = job.NPROCS OUTDIR = job.OUTDIR + SAVEDIR = job.SAVE runscript = f"{curdir}/fcst_launcher.sh" @@ -345,11 +346,9 @@ def forecast_run(cluster: Cluster, job: Job): if OFS == "adnoc": time.sleep(60) - result = subprocess.run([runscript, CDATE, HH, OUTDIR, str(NPROCS), str(PPN), HOSTS, OFS, job.EXEC], \ - stderr=subprocess.STDOUT) + result = subprocess.run([runscript, CDATE, HH, OUTDIR, SAVEDIR, str(NPROCS), str(PPN), HOSTS, OFS, job.EXEC], stderr=subprocess.STDOUT, universal_newlines=True) else: - result = subprocess.run([runscript, CDATE, HH, OUTDIR, str(NPROCS), str(PPN), HOSTS, OFS, job.EXEC], \ - stderr=subprocess.STDOUT) + result = subprocess.run([runscript, CDATE, HH, OUTDIR, SAVEDIR, str(NPROCS), str(PPN), HOSTS, OFS, job.EXEC], stderr=subprocess.STDOUT, universal_newlines=True) if result.returncode != 0: log.exception(f'Forecast failed ... result: {result.returncode}') @@ -390,8 +389,10 @@ def hindcast_run_multi(cluster: Cluster, job: Job): OFS = job.OFS NPROCS = job.NPROCS OUTDIR = job.OUTDIR + SAVEDIR = job.SAVE runscript = f"{curdir}/fcst_launcher.sh" + print(f"In hindcast_run_multi: runscript: {runscript}") try: HOSTS = cluster.getHostsCSV() @@ -403,13 +404,14 @@ def hindcast_run_multi(cluster: Cluster, job: Job): while job.CDATE <= EDATE: + print(f'In hindcast run multi: job.CDATE: {job.CDATE}') + # Create ocean in file - print(f'In hindcast_run_multi: CDATE {job.CDATE} about to make_oceanin') job.make_oceanin() try: - result = subprocess.run([runscript, job.CDATE, HH, OUTDIR, str(NPROCS), str(PPN), HOSTS, OFS, job.EXEC], \ - stderr=subprocess.STDOUT) + print('Launching model run ...') + result = subprocess.run([runscript, job.CDATE, HH, job.OUTDIR, SAVEDIR, str(NPROCS), str(PPN), HOSTS, OFS, job.EXEC], stderr=subprocess.STDOUT, universal_newlines=True) if result.returncode != 0: log.exception(f'Forecast failed ... result: {result.returncode}') @@ -419,10 +421,60 @@ def hindcast_run_multi(cluster: Cluster, job: Job): log.exception('In driver: Exception during subprocess.run :' + str(e)) raise signals.FAIL() + # Set the date for the next day run job.CDATE = util.ndate(job.CDATE, 1) - print(f'in hindcast run multi: job.CDATE: {job.CDATE}') + # end of while loop + + +############################################################################### +# cluster, job + +@task +def cora_reanalysis_run(cluster: Cluster, job: Job): + """ Run the forecast + + Parameters + ---------- + cluster : Cluster + The cluster to run on + job : Job + The job to run + """ + PPN = cluster.getCoresPN() + + # Easier to read + YYYY = job.YYYY + OFS = job.OFS + NPROCS = job.NPROCS + ProjectHome = job.ProjectHome + CONFIG=job.CONFIG + + runscript = f"{curdir}/cora_launcher.sh" + + print(f'DEBUG: job.CONFIG: {job.CONFIG}') + print(f'runscript: {runscript}') + + try: + HOSTS = cluster.getHostsCSV() + except Exception as e: + log.exception('In driver: execption retrieving list of hostnames:' + str(e)) + raise signals.FAIL() + + try: + result = subprocess.run([runscript, YYYY, ProjectHome, str(NPROCS), str(PPN), HOSTS, CONFIG], universal_newlines=True, stderr=subprocess.STDOUT) + + if result.returncode != 0: + log.exception(f'Forecast failed ... result: {result.returncode}') + raise signals.FAIL() + + except Exception as e: + log.exception('In driver: Exception during subprocess.run :' + str(e)) + raise signals.FAIL() + + log.info('Forecast finished successfully') +############################################################################### @task def run_pynotebook(pyfile: str): diff --git a/cloudflow/workflows/workflow_main.py b/cloudflow/workflows/workflow_main.py index 7d5aa6d..a7dc5ea 100755 --- a/cloudflow/workflows/workflow_main.py +++ b/cloudflow/workflows/workflow_main.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env -S python3 -u """ A driver to run workflows from provided job configuration files """ ''' Usage: @@ -24,18 +24,24 @@ __copyright__ = "Copyright © 2023 RPS Group, Inc. All rights reserved." __license__ = "BSD 3-Clause" - curdir = os.path.dirname(os.path.abspath(__file__)) -fcstconf = f'{curdir}/../cluster/configs/ioos.config' -#postconf = f'{curdir}/../cluster/configs/post.config' +###################################################################### +############### Set these for your specific deployment ############### +###################################################################### + +fcstconf = f'{curdir}/../cluster/configs/NOS/nos.cora.cfg' +#fcstconf = f'{curdir}/../cluster/configs/RPS/ioos.cora.cfg' +#fcstconf = f'{curdir}/../cluster/configs/RPS/test.cora.cfg' + postconf = f'{curdir}/../cluster/configs/local.config' -#postconf = f'{curdir}/../cluster/configs/ioos.config' # This is used for obtaining liveocean forcing data # LiveOcean users need to obtain credentials from UW sshuser = 'username@apogee.ocean.washington.edu' +###################################################################### + def handler(signal_received, frame): print('SIGINT or CTRL-C detected. Exiting gracefully') raise signal.FAIL() @@ -65,6 +71,10 @@ def main(): fcstflow = flows.fcst_flow(fcstconf, jobfile, sshuser) flowdeq.appendleft(fcstflow) + elif jobtype == "adcircreanalysis": + raflow = flows.reanalysis_flow(fcstconf, jobfile) + flowdeq.appendleft(raflow) + # Add the plot flow elif jobtype == "plotting": plotflow = flows.plot_flow(postconf, jobfile) diff --git a/models/adcirc-cora/buildadcirc.sh b/models/adcirc-cora/buildadcirc.sh new file mode 100755 index 0000000..ab5d7a4 --- /dev/null +++ b/models/adcirc-cora/buildadcirc.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +ADCIRCHome=/save/ec2-user/adcirc + +# NETCDFHOME Sets the home path for netCDF C and Fortran libraries. This assumes that the libraries are installed to the same location. This folder should contain the folders "lib" and "include +# Need to create symlinks to netcdf-fortran include and lib files + +export NETCDFHOME="/mnt/efs/fs1/save/environments/spack/opt/spack/linux-rhel8-x86_64/intel-2021.9.0/netcdf-c-4.9.2-vznmeikm7cp5ht2ktorgf2ehhzgvqqel" +export I_MPI_F90=ifort +export CMAKE_INSTALL_PREFIX="${ADCIRCHome}/work" + +echo $PWD +module use -a $PWD +module load intel_x86_64 + +cp cmplrflags.mk $ADCIRCHome/work + +cd "$ADCIRCHome" || exit 1 + +if [ ! -e build ]; then + mkdir build +fi + +cd build + +#cmake .. -DBUILD_ADCIRC=ON -DBUILD_PADCIRC=ON -DBUILD_ADCSWAN=ON \ +# -DBUILD_PADCSWAN=ON -DBUILD_ADCPREP=ON -DBUILD_UTILITIES=ON \ +# -DBUILD_ASWIP=ON -DBUILD_SWAN=ON -DBUILD_PUNSWAN=ON \ +# -DENABLE_OUTPUT_NETCDF=ON -DENABLE_OUTPUT_XDMF=ON \ +# -DNETCDFHOME=/usr -DXDMFHOME=/usr -DBUILD_UTILITIES=ON \ +# -DCMAKE_Fortran_FLAGS="-mtune=native" + +cmake .. -DBUILD_PADCIRC=ON \ + -DBUILD_ADCPREP=ON \ + -DENABLE_OUTPUT_NETCDF=ON \ + -DBUILD_UTILITIES=ON \ + -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icc -DCMAKE_Fortran_COMPILER=ifort +make + +# testing +# cmake .. -DCMAKE_C_COMPILER=mpiicc -DCMAKE_CXX_COMPILER=mpiicc -DCMAKE_Fortran_COMPILER=mpiifort +# cmake .. -DBUILD_ADCIRC=ON -DBUILD_PADCIRC=ON -DENABLE_OUTPUT_NETCDF=ON -DCMAKE_Fortran_FLAGS_RELEASE="-xCORE-AVX2" +# cmake .. -DBUILD_ADCIRC=ON -DBUILD_PADCIRC=ON -DENABLE_OUTPUT_NETCDF=ON -DCMAKE_Fortran_FLAGS_RELEASE="-axSSE4.2" +# cmake .. -DBUILD_ADCIRC=ON -DBUILD_PADCIRC=ON -DENABLE_OUTPUT_NETCDF=ON -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icc -DCMAKE_Fortran_COMPILER=ifort +# -DCMAKE_C_COMPILER=mpiicc -DCMAKE_CXX_COMPILER=mpiicc -DCMAKE_Fortran_COMPILER=mpiifort +#cmake .. + +# gnu make testing +#make clean +#make compiler=intel +#make all compiler=intel +#make padcirc compiler=intel +#make compiler=intel +#make padcirc compiler=intel +#cmake .. -DCMAKE_C_COMPILER=mpiicc -DCMAKE_CXX_COMPILER=mpiicc -DCMAKE_Fortran_COMPILER=ifort -DBUILD_ADCIRC=ON -DBUILD_PADCIRC=ON -DENABLE_OUTPUT_NETCDF=ON -DCMAKE_Fortran_FLAGS_RELEASE="-xCORE-AVX2" diff --git a/models/adcirc-cora/cleanme.sh b/models/adcirc-cora/cleanme.sh new file mode 100755 index 0000000..a1b338d --- /dev/null +++ b/models/adcirc-cora/cleanme.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +cd /save/ec2-user/adcirc/build || exit 1 +make clean + +rm -Rf CMake* +rm cmake_install.cmake +rm adc* +rm padcirc +rm -Rf odir* +rm Makefile +ls -altr diff --git a/models/adcirc-cora/cmplrflags.mk b/models/adcirc-cora/cmplrflags.mk new file mode 100644 index 0000000..1bf4be6 --- /dev/null +++ b/models/adcirc-cora/cmplrflags.mk @@ -0,0 +1,1567 @@ +# SRCDIR is set in makefile or on the compile line +INCDIRS := -I. -I$(SRCDIR)/prep +#DEBUG := full + +######################################################################## +# Compiler flags for Linux operating system on 64bit x86 CPU +# +ifeq ($(MACHINE)-$(OS),x86_64-linux-gnu) +# +# ***NOTE*** User must select between various Linux setups +# by commenting/uncommenting the appropriate compiler +# +#compiler=gnu +#compiler=g95 +#compiler=gfortran +compiler=intel +#compiler=intel-ND +#compiler=intel-lonestar +#compiler=intel-sgi +#compiler=cray_xt3 +#compiler=cray_xt4 +#compiler=cray_xt5 +#compiler=pgi +#compiler=pgi-ranger +#compiler=diamond +#compiler=kraken +#compiler=utils +#compiler=xtintel +#compiler=circleci +# +# +# Compiler Flags for gfortran and gcc +ifeq ($(compiler),gnu) + PPFC := gfortran + FC := gfortran + PFC := mpif90 + FFLAGS1 := $(INCDIRS) -O2 -mcmodel=medium -ffixed-line-length-none -m64 + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + IMODS := -I + CC := gcc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -O2 -mcmodel=medium -DLINUX -m64 + CLIBS := + LIBS := + MSGLIBS := + ifeq ($(NETCDF),enable) + ifeq ($(MACHINENAME),blueridge) + # FLIBS := $(FLIBS) -L$(HDF5HOME) -lhdf5 + NETCDFHOME :=/usr + FFLAGS1 :=$(FFLAGS1) -I/usr/lib64/gfortran/modules + FFLAGS2 :=$(FFLAGS1) + FFLAGS3 :=$(FFLAGS1) + # NETCDFHOME :=/shared/apps/RHEL-5/x86_64/NetCDF/netcdf-4.1.1-gcc4.1-ifort + # NETCDFHOME :=/shared/apps/RHEL-5/x86_64/NetCDF/netcdf-4.1.2-gcc4.1-ifort + FLIBS :=$(FLIBS) -L/usr/lib64 -lnetcdff + else + FLIBS := $(FLIBS) -L$(HDF5HOME) -lhdf5 -lhdf5_fortran + endif + endif + $(warning (INFO) Corresponding compilers and flags found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +ifeq ($(compiler),gfortran) + ifeq ($(MACHINENAME),jason-desktop) + XDMFPATH := /home/jason/projects/XDMF/Code/latestCode + XDMFLIBPATH := /home/jason/projects/XDMF/Code/testLatest + endif + PPFC := gfortran + FC := gfortran + PFC := mpif90 + FFLAGS1 := $(INCDIRS) -O2 -ffixed-line-length-none + ifeq ($(PROFILE),enable) + FFLAGS1 := $(INCDIRS) -pg -O0 -fprofile-arcs -ftest-coverage -ffixed-line-length-none + endif + ifeq ($(DEBUG),full) + FFLAGS1 := $(INCDIRS) -g -O0 -ffixed-line-length-none -fbacktrace -fbounds-check -ffpe-trap=zero,invalid,overflow,denormal -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK -DDEBUG_HOLLAND -DDEBUG_WARN_ELEV + endif + ifeq ($(DEBUG),compiler-warnings) + FFLAGS1 := $(INCDIRS) -g -O0 -Wall -Wextra -ffixed-line-length-none -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK + endif + ifeq ($(DEBUG),full-not-warnelev) + FFLAGS1 := $(INCDIRS) -g -O0 -ffixed-line-length-none -fbacktrace -fbounds-check -ffpe-trap=zero,invalid,overflow,denormal -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK -DDEBUG_HOLLAND + endif + ifeq ($(DEBUG),full-not-fpe) + FFLAGS1 := $(INCDIRS) -g -O0 -ffixed-line-length-none -fbacktrace -fbounds-check -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK -DDEBUG_HOLLAND + endif + ifeq ($(DEBUG),trace) + FFLAGS1 := $(INCDIRS) -g -O0 -ffixed-line-length-none -fbacktrace -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK + endif +# ifneq ($(MACHINENAME),jason-desktop) +# FFLAGS1 := $(FFLAGS1) -fno-underscoring +# endif + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + ifeq ($(SWAN),enable) + DPRE := -DREAL8 -DLINUX -DADCSWAN + endif + FLIBS := + ifeq ($(NETCDF),enable) + ifeq ($(MACHINENAME),penguin) + # module purge + # module load gcc/6.2.0 openmpi/2.1.2/gcc.6.2.0 + # curl -O ftp://ftp.unidata.ucar.edu/pub/netcdf/old/netcdf-4.2.1.1.tar.gz + # curl -O ftp://ftp.unidata.ucar.edu/pub/netcdf/old/netcdf-fortran-4.2.tar.gz + # curl -O https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.12/src/hdf5-1.8.12.tar.gz + # CPPFLAGS=-I/home/jgflemin/local/include LDFLAGS=-L/home/jgflemin/local/lib ./configure --prefix=/home/jgflemin/local + # + # export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/local/lib + # export PATH=${PATH}:${HOME}/local/bin + NETCDFHOME := ${HOME}/local + FFLAGS1 := $(FFLAGS1) -I${HOME}/local/include + FFLAGS2 := $(FFLAGS2) -I${HOME}/local/include + FFLAGS3 := $(FFLAGS3) -I${HOME}/local/include + FLIBS := $(FLIBS) -L${HOME}/local/lib -lnetcdff -lnetcdf + endif + ifeq ($(MACHINENAME),jason-desktop) + NETCDFHOME := /usr + FFLAGS1 := $(FFLAGS1) -L/usr/lib/x86_64-linux-gnu + FFLAGS2 := $(FFLAGS2) -L/usr/lib/x86_64-linux-gnu + FFLAGS3 := $(FFLAGS3) -L/usr/lib/x86_64-linux-gnu + endif + ifeq ($(MACHINENAME),rostam) + NETCDFHOME := /usr + FFLAGS1 := $(FFLAGS1) -I/usr/lib64/gfortran/modules + FFLAGS2 := $(FFLAGS2) -I/usr/lib64/gfortran/modules + FFLAGS3 := $(FFLAGS3) -I/usr/lib64/gfortran/modules + endif + ifeq ($(MACHINENAME),wsl2-ubuntu) + NETCDFHOME := /usr + FFLAGS1 := $(FFLAGS1) -I/usr/include + FFLAGS2 := $(FFLAGS2) -I/usr/include + FFLAGS3 := $(FFLAGS3) -I/usr/include + endif + endif + IMODS := -I + CC := gcc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -O2 -DLINUX + ifeq ($(DEBUG),full) + CFLAGS := $(INCDIRS) -g -O0 -DLINUX + endif + CLIBS := + MSGLIBS := + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +ifeq ($(compiler),g95) + PPFC := g95 + FC := g95 + PFC := mpif90 + FFLAGS1 := $(INCDIRS) -O3 -mcmodel=medium -fstatic -ffixed-line-length-132 + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + IMODS := -I + CC := gcc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -O2 -mcmodel=medium -DLINUX + CLIBS := + FLIBS := + MSGLIBS := + $(warning (INFO) Corresponding compilers and flags found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# jgf45.12 These flags work on the UNC Topsail Cluster. +# jgf: The -i-dynamic flag defers the inclusion of the library with +# feupdateenv until run time, thus avoiding the error message: +# "feupdateenv is not implemented and will always fail" +# HERE +ifeq ($(compiler),intel) + PPFC := ifort + FC := ifort + PFC ?= mpiifort + FFLAGS1 := $(INCDIRS) -O2 -g -traceback -FI -assume byterecl -132 -axSSE4.2 -assume buffered_io + CFLAGS := $(INCDIRS) -O2 -axSSE4.2 -m64 -mcmodel=medium -DLINUX + FLIBS := + ifeq ($(DEBUG),full) + CFLAGS := $(INCDIRS) -g -O0 -m64 -mcmodel=medium -DLINUX + endif + ifeq ($(DEBUG),full) + FFLAGS1 := $(INCDIRS) -g -O0 -traceback -debug all -check all -ftrapuv -fpe0 -FI -assume byterecl -132 -DALL_TRACE -DFULL_STACK -DFLUSH_MESSAGES + endif + ifeq ($(DEBUG),full-not-fpe) + FFLAGS1 := $(INCDIRS) -g -O0 -traceback -debug all -check all -FI -assume byterecl -132 -DALL_TRACE -DFULL_STACK -DFLUSH_MESSAGES + endif + ifeq ($(DEBUG),trace) + FFLAGS1 := $(INCDIRS) -g -O0 -traceback -FI -assume byterecl -132 -DALL_TRACE -DFULL_STACK -DFLUSH_MESSAGES + endif + ifeq ($(DEBUG),buserror) + FFLAGS1 := $(INCDIRS) -g -O0 -traceback -FI -assume byterecl -132 -DALL_TRACE -DFULL_STACK -DFLUSH_MESSAGES -check bounds + endif + ifeq ($(DEBUG),netcdf_trace) + FFLAGS1 := $(INCDIRS) -g -O0 -traceback -FI -assume byterecl -132 -DNETCDF_TRACE -DFULL_STACK -DFLUSH_MESSAGES + endif + # + ifeq ($(MACHINENAME),stampede2) + FFLAGS1 := $(INCDIRS) -O3 -FI -assume byterecl -132 -xCORE-AVX2 -axCORE-AVX512,MIC-AVX512 -assume buffered_io + CFLAGS := $(INCDIRS) -O3 -DLINUX -xCORE-AVX2 -axCORE-AVX512,MIC-AVX512 + FLIBS := $(INCDIRS) -xCORE-AVX2 -axCORE-AVX512,MIC-AVX512 + ifeq ($(DEBUG),trace) + FFLAGS1 := $(INCDIRS) -g -O0 -traceback -FI -assume byterecl -132 -xCORE-AVX2 -axCORE-AVX512,MIC-AVX512 -assume buffered_io + CFLAGS := $(INCDIRS) -g -O0 -traceback -DLINUX -xCORE-AVX2 -axCORE-AVX512,MIC-AVX512 + FLIBS := $(INCDIRS) -xCORE-AVX2 -axCORE-AVX512,MIC-AVX512 + endif + endif + ifeq ($(MACHINENAME),frontera) + FFLAGS1 := $(INCDIRS) -O3 -FI -assume byterecl -132 -xCORE-AVX512 -assume buffered_io + CFLAGS := $(INCDIRS) -O3 -DLINUX -xCORE-AVX512 + FLIBS := $(INCDIRS) -xCORE-AVX512 + ifeq ($(DEBUG),trace) + FFLAGS1 := $(INCDIRS) -g -O0 -traceback -FI -assume byterecl -132 -xCORE-AVX512 -assume buffered_io + CFLAGS := $(INCDIRS) -g -O0 -traceback -DLINUX -xCORE-AVX512 + FLIBS := $(INCDIRS) -xCORE-AVX512 + endif + endif + ifeq ($(MACHINENAME),queenbee) + FFLAGS1 := $(INCDIRS) -O3 -FI -assume byterecl -132 -xSSE4.2 -assume buffered_io + CFLAGS := $(INCDIRS) -O3 -DLINUX -xSSE4.2 + FLIBS := $(INCDIRS) -xSSE4.2 + ifeq ($(DEBUG),trace) + FFLAGS1 := $(INCDIRS) -g -O0 -traceback -FI -assume byterecl -132 -xSSE4.2 -assume buffered_io + CFLAGS := $(INCDIRS) -g -O0 -traceback -DLINUX -xSSE4.2 + FLIBS := $(INCDIRS) -xSSE4.2 + endif + endif + ifeq ($(MACHINENAME),supermic) + FFLAGS1 := $(INCDIRS) -O3 -FI -assume byterecl -132 -xAVX -assume buffered_io + CFLAGS := $(INCDIRS) -O3 -DLINUX -xAVX + FLIBS := $(INCDIRS) -xAVX + ifeq ($(DEBUG),trace) + FFLAGS1 := $(INCDIRS) -g -O0 -traceback -FI -assume byterecl -132 -xAVX -assume buffered_io + CFLAGS := $(INCDIRS) -g -O0 -traceback -DLINUX -xAVX + FLIBS := $(INCDIRS) -xAVX + endif + endif + # + #@jasonfleming Added to fix bus error on hatteras@renci + ifeq ($(HEAP_ARRAYS),fix) + FFLAGS1 := $(FFLAGS1) -heap-arrays unlimited + endif + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + ifeq ($(SWAN),enable) + DPRE := $(DPRE) -DADCSWAN + endif + IMODS := -I + CC := icc + CCBE := $(CC) + CLIBS := + MSGLIBS := + ifeq ($(NETCDF),enable) + ifeq ($(MACHINENAME),hatteras) + NETCDFHOME :=$(shell nf-config --prefix) + FLIBS :=$(FLIBS) -L$(NETCDFHOME)/lib -lnetcdff -lnetcdf + FFLAGS1 :=$(FFLAGS1) -I$(NETCDFHOME)/include + FFLAGS2 :=$(FFLAGS1) + FFLAGS3 :=$(FFLAGS1) + endif + # jgf20150417 queenbee requires that the analyst load the netcdf and + # netcdf_fortran modules prior to compiling or executing ADCIRC + ifeq ($(MACHINENAME),queenbee) + FLIBS := $(FLIBS) -L/usr/local/packages/netcdf/4.2.1.1/INTEL-140-MVAPICH2-2.0/lib -lnetcdff -lnetcdf + NETCDFHOME :=/usr/local/packages/netcdf/4.2.1.1/INTEL-140-MVAPICH2-2.0 + endif + ifeq ($(MACHINENAME),supermic) + FLIBS := $(FLIBS) -L/usr/local/packages/netcdf_fortran/4.2/INTEL-140-MVAPICH2-2.0/lib -lnetcdff -L/usr/local/packages/netcdf/4.2.1.1/INTEL-140-MVAPICH2-2.0/lib -lnetcdf -lnetcdf -liomp5 -lpthread + NETCDFHOME :=/usr/local/packages/netcdf/4.2.1.1/INTEL-140-MVAPICH2-2.0/include + FFLAGS1 :=$(FFLAGS1) -I/usr/local/packages/hdf5/1.8.12/INTEL-140-MVAPICH2-2.0/include + endif + ifeq ($(MACHINENAME),stampede) + NETCDFHOME :=/opt/apps/intel17/netcdf/4.3.3.1/x86_64 + FLIBS := $(FLIBS) -L$(NETCDFHOME)/lib -lnetcdff -lnetcdf + endif + ifeq ($(MACHINENAME),stampede2) + NETCDFHOME :=/opt/apps/intel17/netcdf/4.3.3.1/x86_64 + FLIBS := $(FLIBS) -L$(NETCDFHOME)/lib -lnetcdff -lnetcdf + ifeq ($(USER),jgflemin) + NETCDFHOME :=/work/00976/jgflemin/stampede2/local + FLIBS := $(FLIBS) -L$(NETCDFHOME)/lib -lnetcdff -lnetcdf + endif + endif + ifeq ($(MACHINENAME),frontera) + # specify NETCDFHOME on the command line or as an environment var + FLIBS := $(FLIBS) -L$(NETCDFHOME)/lib -lnetcdff -lnetcdf + endif + # @jasonfleming: Added support for lonestar5 at tacc.utexas.edu; + # load the following module: netcdf/4.3.3.1 + ifeq ($(MACHINENAME),lonestar5) + #NETCDFHOME :=/opt/apps/intel18/netcdf/4.3.3.1/x86_64 + # @jasonfleming: Updated support for lonestar5 + NETCDFHOME :=/opt/apps/intel18/netcdf/4.6.2/x86_64 + FLIBS := $(FLIBS) -L$(NETCDFHOME)/lib -lnetcdff -lnetcdf + endif + # jgf20150817: Adding support for spirit.afrl.hpc.mil; + # load the following modules: netcdf-fortran/intel/4.4.2 + # and hdf5/intel/1.8.12 and hdf5-mpi/intel/sgimpt/1.8.12 + ifeq ($(MACHINENAME),spirit) + NETCDFHOME :=/app/wpostool/COST/netcdf-fortran-4.4.2/intel + FLIBS := $(FLIBS) -L/app/wpostool/COST/netcdf-c-4.3.1.1/intel/lib -L$(NETCDFHOME)/lib -L/app/wpostool/COST/hdf5-mpi/1.8.12/intel/sgimpt/lib -lnetcdff -lnetcdf + endif + # jgf20150420 mike requires that the analyst add netcdf to the softenv + # with the following on the command line + # soft add +netcdf-4.1.3-Intel-13.0.0 + ifeq ($(MACHINENAME),mike) + FLIBS := $(FLIBS) -L/usr/local/packages/netcdf/4.1.3/Intel-13.0.0/lib -lnetcdff -lnetcdf + NETCDFHOME :=/usr/local/packages/netcdf/4.1.3/Intel-13.0.0 + endif + ifeq ($(MACHINENAME),killdevil) + HDF5HOME :=/nas02/apps/hdf5-1.8.5/lib + NETCDFHOME :=/nas02/apps/netcdf-4.1.1 + FLIBS := $(FLIBS) -L$(HDF5HOME) -lhdf5 -lhdf5_fortran + endif + endif + +# ------------ + ifeq ($(NETCDF),enable) + ifeq ($(WDALTVAL),enable) + DP := $(DP) -DWDVAL_NETCDF + endif + endif +# ----------- + + #jgf20110519: For netcdf on topsail at UNC, use + #NETCDFHOME=/ifs1/apps/netcdf/ + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif + +# +# Corbitt 120322: These flags work on the Notre Dame Athos & Zas +ifeq ($(compiler),intel-ND) + PPFC := ifort + FC := ifort + PFC ?= mpif90 +# FFLAGS1 := $(INCDIRS) -w -O3 -assume byterecl -132 -assume buffered_io #-i-dynamic + + ifeq ($(AMD),yes) + FFLAGS1 := $(INCDIRS) -g -traceback -O2 -assume byterecl -132 -mcmodel=medium -shared-intel -assume buffered_io + else + FFLAGS1 := $(INCDIRS) -O3 -g -traceback -xSSE4.2 -assume byterecl -132 -mcmodel=medium -shared-intel -assume buffered_io +# FFLAGS1 := $(INCDIRS) -O2 -g -traceback -xSSE4.2 -assume byterecl -132 -mcmodel=medium -shared-intel -assume buffered_io +# FFLAGS1 := $(INCDIRS) -O0 -g -traceback -check bounds -xSSE4.2 -assume byterecl -132 -mcmodel=medium -shared-intel -assume buffered_io + endif + ifeq ($(DEBUG),full) + FFLAGS1 := $(INCDIRS) -g -O0 -traceback -debug -check all -FI -assume byterecl -132 -DEBUG -DALL_TRACE -DFULL_STACK -DFLUSH_MESSAGES + endif + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI #-DNOFSBPG #-DNOIVB -DPOWELL + DPRE := -DREAL8 -DLINUX -DADCSWAN + ifeq ($(SWAN),enable) + DPRE := $(DPRE) -DADCSWAN + endif + IMODS := -I + CC := icc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -O3 -m64 -mcmodel=medium -DLINUX + FLIBS := + ifeq ($(DATETIME),enable) + DATETIMEHOME := /pontus/gling/ADCIRC_Codes/adcirc-cg-GLOBAL_WP_20200513/lib/datetime-fortran/ + FLIBS := -ldatetime -L$(DATETIMEHOME)lib/ + endif + ifeq ($(GRIB2),enable) + WGRIB2HOME := /pontus/gling/ADCIRC_Codes/adcirc-cg-GLOBAL_WP_20200513/lib/grib2/lib/ + FLIBS := $(FLIBS) -lwgrib2_api -lwgrib2 -ljasper -L$(WGRIB2HOME) + endif + ifeq ($(DEBUG),full) + CFLAGS := $(INCDIRS) -g -O0 -m64 -mcmodel=medium -DLINUX + endif + ifeq ($(NETCDF),enable) + #HDF5HOME=/afs/crc.nd.edu/x86_64_linux/hdf/hdf5-1.8.6-linux-x86_64-static/lib + HDF5HOME=/opt/crc/n/netcdf/4.7.0/intel/18.0 + FLIBS := $(FLIBS) -lnetcdff -L$(HDF5HOME) + endif +# ------------ + ifeq ($(NETCDF),enable) + ifeq ($(WDALTVAL),enable) + DP := $(DP) -DWDVAL_NETCDF + endif + endif +# ----------- + + CLIBS := + MSGLIBS := + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif + NETCDFHOME=/afs/crc.nd.edu/x86_64_linux/n/netcdf/4.7.0/intel/18.0/ +endif + +# SGI ICE X (e.g. topaz@ERDC) using Intel compilers, added by TCM +# jgf: Added flags for Thunder@AFRL. +ifeq ($(compiler),intel-sgi) + PPFC := ifort + FC := ifort + PFC ?= mpif90 + CC := icc -O2 -no-ipo + CCBE := icc -O2 -no-ipo + FFLAGS1 := $(INCDIRS) -fixed -extend-source 132 -O2 -finline-limit=1000 -real-size 64 -no-ipo -assume buffered_io +# FFLAGS1 := $(INCDIRS) -Mextend -g -O0 -traceback + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) -assume buffered_stdout + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCMPI -DCSCA + DPRE := -DREAL8 -DLINUX + CFLAGS := $(INCDIRS) -DLINUX + IMODS := -module + FLIBS := + ifeq ($(NETCDF),enable) + ifeq ($(MACHINENAME),topaz) + NETCDFHOME :=/apps/unsupported/netcdf/4.3.3.1-intel-15.0.3 + endif + ifeq ($(MACHINENAME),thunder) + # add the following lines to ~/.personal.bashrc: + # module load costinit + # module load git + # module load netcdf-fortran/intel/4.4.2 + NETCDFHOME :=/app/COST/netcdf-fortran/4.4.2/intel + endif + # for platforms other than topaz, specify NETCDFHOME on the command line + FLIBS := $(FLIBS) -lnetcdff + endif + MSGLIBS := + BACKEND_EXEC := metis_be adcprep_be + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# Cray-XT3 using standard compilers, from vjp; added by jgf46.00 +ifeq ($(compiler),cray_xt3) + PPFC := pgf90 + FC := ftn + PFC := ftn + CC := pgcc + CCBE := cc + FFLAGS1 := $(INCDIRS) -fastsse -Mextend + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) -r8 -Mr8 -Mr8intrinsics + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCMPI -DCSCA -DDEBUG_WARN_ELEV +# DP := -DREAL8 -DLINUX -DCMPI -DCSCA + DPRE := -DREAL8 -DLINUX + CFLAGS := -c89 $(INCDIRS) -DLINUX + IMODS := -module + FLIBS := + MSGLIBS := +# When compiling with netCDF support, the HDF5 libraries must also +# be linked in, so the user must specify HDF5HOME on the command line. +# jgf20101102: on Sapphire, +# NETCDFHOME=/usr/local/usp/PETtools/CE/pkgs/netcdf-4.1.1-serial +# HDF5HOME=${PET_HOME}/pkgs/hdf5-1.8.5-serial/lib + ifeq ($(NETCDF),enable) + FLIBS := $(FLIBS) -L$(HDF5HOME) -lhdf5_fortran -lhdf5_hl -lhdf5 -lz + endif + BACKEND_EXEC := metis_be adcprep_be + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# Cray-XT4 (e.g. Jade@ERDC) using standard compilers, added by jgf48.4607 +ifeq ($(compiler),cray_xt4) + PPFC := pgf90 + FC := ftn + PFC := ftn + CC := pgcc + CCBE := cc + FFLAGS1 := $(INCDIRS) -Mextend -Minform,inform -O2 -fastsse + ifeq ($(DEBUG),full) + FFLAGS1 := $(INCDIRS) -Mextend -g -O0 -traceback -Mbounds -Mchkfpstk -Mchkptr -Mchkstk -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK + endif + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) -r8 -Mr8 -Mr8intrinsics + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCMPI -DCSCA + DPRE := -DREAL8 -DLINUX + ifeq ($(SWAN),enable) + DPRE := -DREAL8 -DLINUX -DADCSWAN + endif + CFLAGS := $(INCDIRS) -DLINUX + ifeq ($(DEBUG),full) + CFLAGS := $(INCDIRS) -DLINUX -g -O0 + endif + IMODS := -module + FLIBS := +# When compiling with netCDF support, the HDF5 libraries must also +# be linked in, so the user must specify HDF5HOME on the command line. +# On Jade, HDF5 was compiled with szip compression, so this library is +# required as well. +# jgf20101102: on Jade, NETCDFHOME=/usr/local/usp/PETtools/CE/pkgs/netcdf-4.0.1-serial +# jgf20101102: on Jade, HDF5HOME=${PET_HOME}/pkgs/hdf5-1.8.4-serial/lib +# jgf20101103: on Jade, SZIPHOME=/usr/local/usp/PETtools/CE/pkgs/szip-2.1/lib +# jgf20110728: on Garnet, NETCDFHOME=/opt/cray/netcdf/4.1.1.0/netcdf-pgi + ifeq ($(NETCDF),enable) + FLIBS := $(FLIBS) -L$(HDF5HOME) -L$(SZIPHOME) -lhdf5_fortran -lhdf5_hl -lhdf5 -lsz -lz + endif + MSGLIBS := + BACKEND_EXEC := metis_be adcprep_be + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# Cray-XT5 (e.g. einstein@NAVO) using standard compilers, added by jgf49.07 +ifeq ($(compiler),cray_xt5) + PPFC := ftn + FC := ftn + PFC := ftn + CC := cc + CCBE := cc + FFLAGS1 := $(INCDIRS) -Mextend -Minform,inform -O2 -fastsse +# FFLAGS1 := $(INCDIRS) -Mextend -g -O0 -traceback + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) -r8 -Mr8 -Mr8intrinsics + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCMPI -DCSCA + DPRE := -DREAL8 -DLINUX + CFLAGS := -c89 $(INCDIRS) -DLINUX + IMODS := -module + FLIBS := +# When compiling with netCDF support, the HDF5 libraries must also +# be linked in, so the user must specify HDF5HOME on the command line. +# jgf20090518: on Jade, NETCDFHOME=/usr/local/usp/PETtools/CE/pkgs/netcdf-4.0 +# jgf20090518: on Jade, HDF5HOME=${PET_HOME}/pkgs/hdf5-1.8.2/lib + ifeq ($(NETCDF),enable) + FLIBS := $(FLIBS) -L$(HDF5HOME) -lhdf5 -lhdf5_fortran + endif + MSGLIBS := + BACKEND_EXEC := metis_be adcprep_be + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# Cray-XC30/40 (e.g. armstrong@NAVO& lightning@afrl) using Intel compilers, added by TCM +ifeq ($(compiler),xtintel) + PPFC := ftn + FC := ftn + PFC := ftn + CC := cc -O2 -no-ipo + CCBE := cc -O2 -no-ipo + FFLAGS1 := $(INCDIRS) -fixed -extend-source 132 -O2 -default64 -finline-limit=1000 -real-size 64 -no-ipo -assume buffered_io +# FFLAGS1 := $(INCDIRS) -Mextend -g -O0 -traceback + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) -assume buffered_stdout + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCMPI -DCSCA + DPRE := -DREAL8 -DLINUX + CFLAGS := $(INCDIRS) -DLINUX + IMODS := -module + FLIBS := +# When compiling with netCDF support, the HDF5 libraries must also +# be linked in, so the user must specify HDF5HOME on the command line. +# jgf20090518: on Jade, NETCDFHOME=/usr/local/usp/PETtools/CE/pkgs/netcdf-4.0 +# jgf20090518: on Jade, HDF5HOME=${PET_HOME}/pkgs/hdf5-1.8.2/lib + ifeq ($(NETCDF),enable) + FLIBS := $(FLIBS) -L$(HDF5HOME) -lhdf5 -lhdf5_fortran + endif + MSGLIBS := + BACKEND_EXEC := metis_be adcprep_be + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# Portland Group +ifeq ($(compiler),pgi) + PPFC := pgf90 + FC := pgf90 + PFC := mpif90 + FFLAGS1 := $(INCDIRS) -fastsse -mcmodel=medium -Mextend + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + IMODS := -I + CC := gcc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -O2 -mcmodel=medium -DLINUX + CLIBS := + FLIBS := + MSGLIBS := + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# Utility Server (e.g. US@ERDC) using standard compilers, added by jgf48.4607 +ifeq ($(compiler),utils) + PPFC := pgf90 + FC := pgf90 + PFC := mpif90 + CC := pgcc + CCBE := pgcc + FFLAGS1 := $(INCDIRS) -Mextend -Minform,inform -O2 -fastsse + ifeq ($(DEBUG),full) + FFLAGS1 := $(INCDIRS) -Mextend -g -O0 -traceback -Mbounds -Mchkfpstk -Mchkptr -Mchkstk -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK + endif + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) -r8 -Mr8 -Mr8intrinsics + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCMPI -DCSCA + DPRE := -DREAL8 -DLINUX + ifeq ($(SWAN),enable) + DPRE := -DREAL8 -DLINUX -DADCSWAN + endif + CFLAGS := -c89 $(INCDIRS) -DLINUX + ifeq ($(DEBUG),full) + CFLAGS := -c89 $(INCDIRS) -DLINUX -g -O0 + endif + IMODS := -module + FLIBS := +# When compiling with netCDF support, the HDF5 libraries must also +# be linked in, so the user must specify HDF5HOME on the command line. +# On Jade, HDF5 was compiled with szip compression, so this library is +# required as well. +# jgf20101102: on Jade, NETCDFHOME=/usr/local/usp/PETtools/CE/pkgs/netcdf-4.0.1-serial +# jgf20101102: on Jade, HDF5HOME=${PET_HOME}/pkgs/hdf5-1.8.4-serial/lib +# jgf20101103: on Jade, SZIPHOME=/usr/local/usp/PETtools/CE/pkgs/szip-2.1/lib +# jgf20110728: on Garnet, NETCDFHOME=/opt/cray/netcdf/4.1.1.0/netcdf-pgi + ifeq ($(NETCDF),enable) + FLIBS := $(FLIBS) -L$(HDF5HOME) -L$(SZIPHOME) -lhdf5_fortran -lhdf5_hl -lhdf5 -lsz -lz + endif + MSGLIBS := + BACKEND_EXEC := metis_be adcprep_be + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# Portland Group on TU Ranger (AMD Opteron 8356, Barcelona Core) Seizo +ifeq ($(compiler),pgi-ranger) + PPFC := pgf95 + FC := pgf95 + PFC := mpif90 + FFLAGS1 := $(INCDIRS) -fast -tp barcelona-64 -Mextend + ifeq ($(DEBUG),full) + FFLAGS1 := $(INCDIRS) -Minform,inform -Mextend -g -O0 -traceback -DNETCDF_DEBUG -Mbounds -Mchkfpstk -Mchkptr -Mchkstk -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK + endif + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + IMODS := -I + CC := gcc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -DLINUX + CLIBS := + LIBS := + MSGLIBS := + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# ERDC Diamond +ifeq ($(compiler),diamond) + PPFC := ifort + FC := ifort + PFC := ifort +# FFLAGS1 := $(INCDIRS) -O3 -xT -132 + FFLAGS1 := -O3 -132 -xSSSE3 + ifeq ($(DEBUG),full) + FFLAGS1 := $(INCDIRS) -g -O0 -debug -fpe0 -132 -traceback -check all -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK + endif + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + ifeq ($(SWAN),enable) + DPRE := -DREAL8 -DLINUX -DADCSWAN + endif + IMODS := -I + CC := icc + CCBE := $(CC) +# CFLAGS := $(INCDIRS) -O3 -xT + CFLAGS := $(INCDIRS) -O3 -xSSSE3 + ifeq ($(DEBUG),full) + CFLAGS := $(INCDIRS) -g -O0 + endif + CLIBS := + LIBS := +# When compiling with netCDF support, the HDF5 libraries must also +# be linked in, so the user must specify HDF5HOME on the command line. +# jgf20101103: on Diamond, NETCDFHOME=/usr/local/usp/PETtools/CE/pkgs/netcdf-4.0.1-serial +# jgf20101103: on Diamond, HDF5HOME=${PET_HOME}/pkgs/hdf5-1.8.4-serial/lib + ifeq ($(NETCDF),enable) + NETCDFHOME :=/usr/local/usp/PETtools/CE/pkgs/netcdf-4.2.1.1-intel-serial + FFLAGS1 :=$(FFLAGS1) -I/usr/local/usp/PETtools/CE/pkgs/netcdf-4.2.1.1-intel-serial/include + FFLAGS2 :=$(FFLAGS1) + FFLAGS3 :=$(FFLAGS1) + #HDF5HOME :=/usr/local/usp/PETtools/CE/pkgs/hdf5-1.8.8-serial/lib + FLIBS := $(FLIBS) -L/usr/local/usp/PETtools/CE/pkgs/netcdf-4.2.1.1-intel-serial/lib -lnetcdff -lnetcdf #-L$(HDF5HOME) -lhdf5_hl -lhdf5 -lhdf5_fortran -lz + endif + MSGLIBS := -lmpi + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# Cray-XE6 (e.g., Garnet at ERDC) using standard compilers, added by jgf50.29 +ifeq ($(compiler),garnet) + PPFC := ftn + FC := ftn + PFC := ftn + CC := pgcc + CCBE := cc + FFLAGS1 := $(INCDIRS) -Mextend -Minform,inform -tp=shanghai-64 -fast + ifeq ($(DEBUG),full) + FFLAGS1 := $(INCDIRS) -Mextend -g -O0 -traceback -Mbounds -Mchkfpstk -Mchkptr -Mchkstk -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK -tp=shanghai-64 + endif + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) #-r8 -Mr8 -Mr8intrinsics + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCMPI -DCSCA + DPRE := -DREAL8 -DLINUX + ifeq ($(SWAN),enable) + DPRE := -DREAL8 -DLINUX -DADCSWAN + endif + CFLAGS := $(INCDIRS) -DLINUX + ifeq ($(DEBUG),full) + CFLAGS := $(INCDIRS) -DLINUX -g -O0 + endif + IMODS := -module + FLIBS := +# jgf20110728: on Garnet, NETCDFHOME=/opt/cray/netcdf/4.1.1.0/netcdf-pgi +# jgf20110815: on Garnet, HDF5HOME=/opt/cray/hdf5/default/hdf5-pgi +# jgf20130815: on Garnet, load module cray-netcdf, with the path to the +# installation being /opt/cray/netcdf/4.3.0 + ifeq ($(NETCDF),enable) + FLIBS := $(FLIBS) -lnetcdff + endif + FLIBS := $(FLIBS) + MSGLIBS := + BACKEND_EXEC := metis_be adcprep_be + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# +# Tennessee's Kraken +ifeq ($(compiler),kraken) + PPFC := ftn + FC := ftn + PFC := ftn + FFLAGS1 := $(INCDIRS) -O3 -static -132 + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA -DPOWELL + DP := -DREAL8 -DLINUX -DCSCA -DCMPI -DPOWELL + DPRE := -DREAL8 -DLINUX -DADCSWAN + IMODS := -I + CC := cc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -DLINUX + CLIBS := + LIBS := + MSGLIBS := + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# +# Compiler Flags for CircleCI Build Server +ifeq ($(compiler),circleci) + PPFC := ifort + FC := ifort + PFC := mpif90 + FFLAGS1 := $(INCDIRS) -O0 -132 + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX -DADCSWAN + IMODS := -I + CC := icx + CCBE := $(CC) + CFLAGS := $(INCDIRS) -O0 -mcmodel=medium -DLINUX -m64 + CLIBS := + LIBS := + MSGLIBS := + ifeq ($(NETCDF),enable) + FLIBS := $(FLIBS) -L${NETCDF_C_HOME}/lib -lnetcdff + endif + $(warning (INFO) Corresponding compilers and flags found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +endif +#$(MACHINE) +######################################################################## +# Compiler flags for Linux operating system on 32bit x86 CPU +# +ifeq ($(MACHINE)-$(OS),i686-linux-gnu) +# +# ***NOTE*** User must select between various Linux setups +# by commenting/uncommenting the appropriate compiler or +# by specifying on the make command line, e.g., +# make all compiler=gnu +# +#compiler=gnu +#compiler=intel +#compiler=pgi +#compiler=gfortran +# +# Portland Group +ifeq ($(compiler),pgi) + PPFC := pgf90 + FC := pgf90 + PFC := mpif90 + FFLAGS1 := $(INCDIRS) -O2 + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + IMODS := -I + CC := pgcc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -O2 -DLINUX + CLIBS := + FLIBS := + MSGLIBS := + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# Intel +ifeq ($(compiler),intel) + PPFC := ifort -w + FC := ifort -w + PFC ?= mpif90 + OPTLVL := -O2 + ifeq ($(ADC_DEBUG),yes) + OPTLVL := -g + endif + FFLAGS1 := $(INCDIRS) $(OPTLVL) -extend_source -Vaxlib -assume byterecl + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + IMODS := -I + CC := icc + CCBE := $(CC) + CFLAGS := $(INCDIRS) $(OPTLVL) -DLINUX + CLIBS := + FLIBS := + MSGLIBS := + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# g95 +ifeq ($(compiler),gnu) + PPFC := g95 + FC := g95 + PFC := mpif90 + FFLAGS1 := $(INCDIRS) -O2 -ffixed-line-length-132 + ifeq ($(DEBUG),full) + FFLAGS1 := $(INCDIRS) -g -O0 -ffixed-line-length-132 -ftrace=full -fbounds-check -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK -DWRITER_DEBUG -DDEBUG_HOLLAND + # g95 environment variables to set for enhanced debugging: + # G95_UNBUFFERED_ALL, G95_ABORT, G95_FPU_DENORMAL, G95_FPU_INVALID, + # G95_FPU_ZERODIV, G95_FPU_OVERFLOW, G95_FPU_UNDERFLOW, + # G95_FPU_EXCEPTIONS + endif + ifeq ($(DEBUG),netcdf) + FFLAGS1 := $(INCDIRS) -g -O0 -ffixed-line-length-132 -ftrace=full -fbounds-check -DNETCDF_TRACE -DFLUSH_MESSAGES -DFULL_STACK + endif + ifeq ($(DEBUG),valgrind) + FFLAGS1 := $(INCDIRS) -g -O0 -ffixed-line-length-132 + endif + ifeq ($(SWAN),enable) + FFLAGS1 := $(FFLAGS1) -freal-loops + endif + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + ifeq ($(SWAN),enable) + DPRE := -DREAL8 -DLINUX -DADCSWAN + endif + IMODS := -I + CC := gcc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -O2 -DLINUX + ifeq ($(DEBUG),full) + CFLAGS := $(INCDIRS) -g -O0 -DLINUX + endif + CLIBS := + FLIBS := + ifeq ($(NETCDF),enable) + ifeq ($(MACHINENAME),jason-desktop) + NETCDFHOME := /usr/local + HDF5HOME := /usr/local/hdf5/hdf5-1.8.8/hdf5 + endif + FLIBS := $(FLIBS) -L$(HDF5HOME)/lib -L$(NETCDFHOME) -lnetcdf -lhdf5_hl -lhdf5 -lhdf5_fortran -lz + endif + MSGLIBS := + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# gfortran +ifeq ($(compiler),gfortran) + ifeq ($(MACHINENAME),jason-desktop) + XDMFPATH := /home/jason/projects/XDMF/Code/latestCode + XDMFLIBPATH := /home/jason/projects/XDMF/Code/testLatest + endif + PPFC := gfortran + FC := gfortran + PFC := mpif90 + FFLAGS1 := $(INCDIRS) -O2 -ffixed-line-length-none + ifeq ($(PROFILE),enable) + FFLAGS1 := $(INCDIRS) -pg -O0 -fprofile-arcs -ftest-coverage -ffixed-line-length-none + endif + ifeq ($(DEBUG),full) + FFLAGS1 := $(INCDIRS) -g -O0 -ffixed-line-length-none -fbacktrace -fbounds-check -ffpe-trap=zero,invalid,overflow,denormal -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK -DDEBUG_HOLLAND -DDEBUG_WARN_ELEV + endif + ifeq ($(DEBUG),compiler-warnings) + FFLAGS1 := $(INCDIRS) -g -O0 -Wall -Wextra -ffixed-line-length-none -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK + endif + ifeq ($(DEBUG),full-not-warnelev) + FFLAGS1 := $(INCDIRS) -g -O0 -ffixed-line-length-none -fbacktrace -fbounds-check -ffpe-trap=zero,invalid,overflow,denormal -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK -DDEBUG_HOLLAND + endif + ifeq ($(DEBUG),full-not-fpe) + FFLAGS1 := $(INCDIRS) -g -O0 -ffixed-line-length-none -fbacktrace -fbounds-check -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK -DDEBUG_HOLLAND + endif + ifeq ($(DEBUG),trace) + FFLAGS1 := $(INCDIRS) -g -O0 -ffixed-line-length-none -fbacktrace -DALL_TRACE -DFLUSH_MESSAGES -DFULL_STACK + endif + ifneq ($(MACHINENAME),jason-desktop) + FFLAGS1 := $(FFLAGS1) -fno-underscoring + endif + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + ifeq ($(SWAN),enable) + DPRE := -DREAL8 -DLINUX -DADCSWAN + endif + FLIBS := + ifeq ($(NETCDF),enable) + ifeq ($(MACHINENAME),jason-desktop) + NETCDFHOME := /usr + endif + FLIBS := $(FLIBS) -lnetcdff + endif + IMODS := -I + CC := gcc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -O2 -DLINUX + ifeq ($(DEBUG),full) + CFLAGS := $(INCDIRS) -g -O0 -DLINUX + endif + CLIBS := + MSGLIBS := + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif + +endif + +######################################################################## +# Compiler flags for Linux operating system on 64bit Intel Itanium CPU +# +ifneq (,$(findstring ia64-linux,$(MACHINE)-$(OS))) +# +# ***NOTE*** User must select between various Linux setups +# by commenting/uncommenting the appropriate architecture +# +arch=pc +#arch=altix +# +# +ifeq ($(arch),pc) + PPFC := /opt/intel/compiler60/ia64/bin/efc + FC := /opt/intel/compiler60/ia64/bin/efc + PFC := mpif90 + FFLAGS1 := $(INCDIRS) -132 -IPF_fp_speculationfast -r8 + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DCSCA + DP := -DREAL8 -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + IMODS := -I + CC := gcc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -DLINUX -O2 + CLIBS := + FLIBS := + MSGLIBS := + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +# +# SGI Altix; Created by Brett Estrade, added by jgf45.12 +ifeq ($(arch),altix) + PPFC := ifort + FC := ifort + PFC := ifort + FFLAGS1 := $(INCDIRS) -O3 -tpp2 + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DCSCA + DP := -DREAL8 -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + IMODS := -I + CC := gcc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -DLINUX -O2 + FLIBS := + MSGLIBS := -lmpi + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +endif +######################################################################## +# IBM SP - AIX operating system on IBM RS/6000 hardware +# Contrib. TJC Jan 2006 +ifneq (,$(findstring rs6000-aix,$(MACHINE)-$(OS))) + export OBJECT_MODE=64 + PPFC := xlf90_r + FC := xlf90_r + PFC := mpxlf90_r + FFLAGS1 := $(INCDIRS) -q64 -w -O2 -qfixed=132 -qarch=auto -qcache=auto + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -WF,"-DREAL8,-DIBM,-DCSCA" + DP := -tF -WF,"-DREAL8,-DIBM,-DCSCA,-DCMPI" + DPRE := -tF -WF,"-DREAL8,-DIBM" + IMODS := -I + CC := mpcc_r + CCBE := $(CC) + CFLAGS := -q64 -I. -O2 -DIBM + LDFLAGS := -q64 + FLIBS := + MSGLIBS := -lm + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +######################################################################## + +######################################################################## +# IBM SP - AIX operating system on 32bit PowerPC CPU +# From vjp; added by jgf46.00 +# gcc by bde for IBM p5: bluedawg.loni.org; added by jgf46.04 +# +# jgf20110303: Added capability to specify ibm=p5 or ibm=p6 on make +# command line to get the appropriate compiler flags. It also possible +# to uncomment either ibm=p5 or ibm=p6 below and not specify it on the +# make command line. The ibm p6 compiler flags were inserted based on +# feedback from Yuji Funakoshi at NOAA CSDL. +# +ifneq (,$(findstring powerpc-aix,$(MACHINE)-$(OS))) +#IBM=p5 +#IBM=p6 +ifeq ($(IBM),p5) + PPFC := xlf90_r -q64 + FC := xlf90_r -q64 + PFC := mpxlf90_r -q64 + CC := mpcc_r -q64 + CCBE := $(CC) + FFLAGS0 := $(INCDIRS) -w -qfixed=132 -qarch=auto -qcache=auto + FFLAGS1 := $(FFLAGS0) -O2 + FFLAGS2 := $(FFLAGS0) -qhot -qstrict + FFLAGS3 := $(FFLAGS0) -O3 -qinitauto + DA := -WF,"-DREAL8,-DIBM,-DCSCA" + DP := -tF -WF,"-DREAL8,-DIBM,-DCSCA,-DCMPI" + DPRE := -tF -WF,"-DREAL8,-DIBM" + IMODS := -I + CFLAGS := $(INCDIRS) -O2 -DIBM + ARFLAGS := -X64 rv + FLIBS := + MSGLIBS := -lm + + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +ifeq ($(IBM),p6) + export OBJECT_MODE=64 + PPFC := xlf90_r + FC := xlf90_r + PFC := mpxlf90_r + FFLAGS1 := $(INCDIRS) -q64 -w -O2 -qfixed=132 -qarch=auto -qcache=auto + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + ifeq ($(NETCDF),enable)) + DA := -WF,"-DREAL8,-DIBM,-DNETCDF,-DCSCA" + DP := -tF -WF,"-DREAL8,-DIBM,-DNETCDF,-DCSCA,-DCMPI" + DPRE := -tF -WF,"-DREAL8,-DIBM,-DNETCDF" + else + DA := -WF,"-DREAL8,-DIBM,-DCSCA" + DP := -tF -WF,"-DREAL8,-DIBM,-DCSCA,-DCMPI" + DPRE := -tF -WF,"-DREAL8,-DIBM" + endif + IMODS := -I + CC := mpcc_r + CCBE := $(CC) + CFLAGS := -q64 -I. -O2 -DIBM + LDFLAGS := -q64 + FLIBS := + MSGLIBS := -lm +# When compiling with netCDF support, the HDF5 libraries must also +# be linked in, so the user must specify HDF5HOME on the command line. +# yf20110301: on Cirrus/Stratus, NETCDFHOME=/usrx/local/bin/ +# yf20110301: on Cirrus/Stratus, HDF5HOME=/usrx/local/hdf5/lib + HDF5HOME=/usrx/local/hdf5/lib + ifeq ($(NETCDF),enable) + FLIBS := $(FLIBS) -L$(HDF5HOME) -lhdf5_fortran -lhdf5_hl -lhdf5 -lz + endif + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +endif + +######################################################################## +# IBM BlueGene/L; Linux operating system on 64bit PowerPC CPU +# Contrib. by Brett Estrade added by jgf45.12 +ifeq ($(MACHINE)-$(OS),ppc64-unknown-linux-gnu) + PPFC := blrts_xlf90 + FC := blrts_xlf90 + PFC := $(FC) + FFLAGS1 := $(INCDIRS) -qmaxmem=64000 -qfixed -I/bgl/BlueLight/ppcfloor/bglsys/include -O5 -qtune=440 -qcache=440 -qarch=440 + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -WF,"-DREAL8,-DIBM" + DP := -tF -WF,"-DREAL8,-DIBM,-DCSCA,-DCMPI" + DPRE := -tF -WF,"-DREAL8,-DIBM" + IMODS := -I + CC := blrts_xlc + CCBE := $(CC) + CFLAGS := -I. -I../Lib -O5 + LDFLAGS := -q64 -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmsglayer.rts -lrts.rts -ldevices.rts + FLIBS := + MSGLIBS := -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts -lmsglayer.rts -lrts.rts -ldevices.rts + + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +######################################################################## + + + +######################################################################## +# Sun Solaris +# +#ifneq (,$(findstring sparc-solaris,$(MACHINE)-$(OS))) +# PPFC := f90 +# FC := f90 +# PFC := mpf90 +# LD := $(FC) +# FFLAGS1 := -O2 +# FFLAGS2 := -O2 +# FFLAGS3 := -O2 +# DA := -DREAL8 -DMACHSUN -DCSCA +# DP := -DREAL8 -DMACHSUN -DCSCA -DCMPI +# DPRE := -DREAL8 -DMACHSUN +# IMODS := -M +# CC := cc +# CCBE := $(CC) +# CFLAGS := -I. -xO2 -DMACHSUN +# LIBS := +# MSGLIBS := -lmpi +#endif + +######################################################################## +# Sun Solaris Using SUN MPI? + +ifneq (,$(findstring sparc-solaris,$(MACHINE)-$(OS))) + PPFC := tmf90 + FC := tmf90 + PFC := tmf90 + ARCH := v8plusa + LD := $(FC) + FFLAGS1 := $(INCDIRS) -fast -xO4 -xdepend -fsimple=1 -f -dalign -xtarget=ultra -xarch=$(ARCH) + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DMACHSUN -DCSCA + DP := -DREAL8 -DCMPI -DMACHSUN -DCSCA + DPRE := -DREAL8 -DMACHSUN + IMODS := -M + CC := tmcc + CCBE := $(CC) + CFLAGS := $(INCDIRS) + FLIBS := + MSGLIBS := -lmpi + + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif + +######################################################################## +# Alpha-Linux computers using Compaq (a.k.a. DEC) + +ifneq (,$(findstring alphaev6-linux,$(MACHINE)-$(OS))) + PPFC := fort + FC := fort + PFC := mpif90 + FFLAGS1 := $(INCDIRS) -fixed -O2 + FFLAGS2 := -fixed -O2 + FFLAGS3 := -fixed -O2 + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + IMODS := -I + CC := ccc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -O2 -DLINUX + CLIBS := + FLIBS := + MSGLIBS := + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif + +######################################################################## +# Compaq True64 computers + +ifneq (,$(findstring alphaev6-osf,$(MACHINE)-$(OS))) + PPFC := f90 + FC := f90 + PFC := f90 + FFLAGS1 := $(INCDIRS) -fixed -O2 + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DLINUX -DCSCA + DP := -DREAL8 -DLINUX -DCSCA -DCMPI + DPRE := -DREAL8 -DLINUX + IMODS := -I + CC := cc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -DLINUX -O2 + CLIBS := + FLIBS := + MSGLIBS := -lfmpi -lmpi -lelan + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif + + +######################################################################## +# CPQ SC40 - DEC using standard + +ifneq (,$(findstring alphaev6-dec-osf5.1,$(MACHINE)-$(VENDOR)-$(OS))) + PPFC := f90 + FC := f90 + PFC := f90 + FFLAGS1 := $(INCDIRS) -O5 -fast -pipeline -align dcommons -assume byterecl + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DCSCA + DP := -DREAL8 -DCMPI -DIBM -DCSCA + DPRE := -DREAL8 -DIBM + IMODS := -I + CC := cc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -O2 + FLIBS := + MSGLIBS := -lmpi -lelan + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif + +######################################################################## +# Cray SV1 - Cray +# written by MEB 04/01/04 added by jgf45.06 +ifneq (,$(findstring sv1-unicos,$(MACHINE)-$(OS))) + PPFC := f90 + FC := f90 + PFC := f90 + FFLAGS1 := $(INCDIRS) -dp -i32 -O2 + FFLAGS2 := $(INCDIRS) -dp -O2 -N 132 + FFLAGS3 := $(INCDIRS) -dp -O2 -N 132 + FIXED := -f fixed + FREE := -f free + DA := -DREAL8 -DCRAY -DCSCA + DP := -DREAL8 -DCRAY -DCSCA -DCMPI + DPRE := -DREAL8 -DCRAY + IMODS := -p + CFLAGS := $(INCDIRS) -I ../Lib -O2 -DCRAY + FLIBS := + MSGLIBS := -lmpi + C_LDFLAGS := + CCBE := $(CC) + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif + +######################################################################## +# Cray-X1- Cray-X1 +# written by MEB 04/01/04 added by jgf45.06 +ifneq (,$(findstring x1-unicos,$(MACHINE)-$(OS))) + PPFC := ftn + FC := ftn + PFC := ftn + FFLAGS1 := $(INCDIRS) -O2 -Oaggress + FFLAGS2 := $(INCDIRS) -O2 -Oaggress + FFLAGS3 := $(INCDIRS) -O2 -Oaggress + FIXED := -f fixed + FREE := -f free + DA := -DREAL8 -DCRAYX1 -DCVEC + DP := -DREAL8 -DCRAYX1 -DCVEC -DCMPI + DPRE := -DREAL8 -DCRAYX1 -UCRAY + IMODS := -p + CC := cc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -I ../Lib -O2 -DCRAYX1 -UCRAY + FLIBS := + MSGLIBS := -lmpi + C_LDFLAGS := + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif + +######################################################################## +# SGI Origin +ifneq (,$(findstring mips-irix,$(MACHINE)-$(OS))) + PPFC := f90 + FC := f90 + PFC := f90 + FFLAGS1 := $(INCDIRS) -O2 -OPT:Olimit=4257 -OPT:reorg_common=ON + FFLAGS2 := $(INCDIRS) -O2 -OPT:Olimit=4257 -OPT:reorg_common=ON + FFLAGS3 := $(INCDIRS) -O2 -OPT:Olimit=4257 -OPT:reorg_common=ON + DA := -DREAL8 -DSGI -DCSCA + DP := -DREAL8 -DSGI -DCSCA -DCMPI + DPRE := -DREAL8 -DSGI + IMODS := -I + CC := cc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -O2 -DSGI + FLIBS := + MSGLIBS := -lmpi + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +######################################################################## + + +######################################################################## +# powerpc-apple-darwin using absoft + +ifneq (,$(findstring powerpc-darwin,$(MACHINE)-$(OS))) + PPFC := f90 + FC := f90 + PFC := mpif77 + FFLAGS1 := $(INCDIRS) -w -O3 -m64 -cpu:g5 -f fixed -W132 -I. -DLINUX + FFLAGS2 := $(INCDIRS) -w -O3 -m64 -cpu:g5 -N11 -f fixed -W132 -I. + FFLAGS3 := $(INCDIRS) -w -O3 -m64 -cpu:g5 -N11 -f fixed -W132 -I. + DA := -DREAL8 -DCSCA -DLINUX + DP := -DREAL8 -DCSCA -DCMPI -DLINUX + DPRE := -DREAL8 -DLINUX + IMODS := -p + CC := gcc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -m64 -mpowerpc64 -O2 -DLINUX + LDFLAGS := + FLIBS := -lU77 + MSGLIBS := -lm + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +######################################################################## + + +######################################################################## +# i386-apple-darwin using intel + +ifneq (,$(findstring i386-darwin,$(MACHINE)-$(OS))) + PPFC := ifort + FC := ifort + PFC := mpif77 + FFLAGS1 := $(INCDIRS) -nowarn -O3 -fixed -132 -check all -traceback -DLINUX -DNETCDF_DEBUG -I. +# FFLAGS1 := $(INCDIRS) -nowarn -O3 -fixed -132 -DIBM -I. + FFLAGS2 := $(INCDIRS) -nowarn -O3 -fixed -132 -I. + FFLAGS3 := $(INCDIRS) -nowarn -O3 -fixed -132 -I. + DA := -DREAL8 -DCSCA -DLINUX + DP := -DREAL8 -DCSCA -DLINUX -DCMPI -DNETCDF_DEBUG + DPRE := -DREAL8 -DLINUX + IMODS := -I + CC := gcc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -O3 -DLINUX + LDFLAGS := + FLIBS := + MSGLIBS := + $(warning (INFO) Corresponding machine found in cmplrflags.mk.) + ifneq ($(FOUND),TRUE) + FOUND := TRUE + else + MULTIPLE := TRUE + endif +endif +######################################################################## +ifneq ($(FOUND), TRUE) + $(warning (WARNING) None of the platforms in cmplrflags.mk match your platform. As a result, the specific compilers and flags that are appropriate for you could not be specified. Please edit the cmplrflags.mk file to include your machine and operating system. Continuing with generic selections for compilers.) + PPFC := f90 + FC := f90 + PFC := mpif90 + FFLAGS1 := $(INCDIRS) + FFLAGS2 := $(FFLAGS1) + FFLAGS3 := $(FFLAGS1) + DA := -DREAL8 -DCSCA -DLINUX + DP := -DREAL8 -DCSCA -DLINUX -DCMPI + DPRE := -DREAL8 -DLINUX + IMODS := -I + CC := cc + CCBE := $(CC) + CFLAGS := $(INCDIRS) -DLINUX + LDFLAGS := + FLIBS := + MSGLIBS := +endif +ifeq ($(MULTIPLE),TRUE) + $(warning (WARNING) More than one match in cmplrflags.mk. This may result in the wrong compilers being selected. Please check the cmplrflags.mk file to ensure that only one set of compiler flags is specified for your platform.) +endif diff --git a/models/adcirc-cora/getS3packages.sh b/models/adcirc-cora/getS3packages.sh new file mode 100755 index 0000000..01090a6 --- /dev/null +++ b/models/adcirc-cora/getS3packages.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -e + +cd /save/$USERNAME || exit 1 + +files="2018.ioos_sb.tgz adcirc_built.tgz cora-runs.tgz" + +for f in $files +do + aws s3 cp s3://ioos-cloud-sandbox/public/cora-adcirc/$f . + tar -xvf $f +done diff --git a/models/adcirc-cora/install-adcirc-cora.sh b/models/adcirc-cora/install-adcirc-cora.sh new file mode 100755 index 0000000..63941c8 --- /dev/null +++ b/models/adcirc-cora/install-adcirc-cora.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +CURDIR=$PWD + +# Get the directory name parent to this repository +# e.g. /save/patrick, /save/ec2-user + +BASEDIR=$(dirname $(dirname $(dirname $PWD))) +cd $BASEDIR || exit 1 + +# Get the model and test files, the model is already built +# The full grid will use a different grid mesh + +files="2018.ioos_sb.tgz + adcirc_built.tgz + cora-runs.tgz" + +for f in $files +do + aws s3 cp s3://ioos-cloud-sandbox/public/cora-adcirc/$f . + tar -xvf $f +done + + + + diff --git a/models/adcirc-cora/intel_x86_64 b/models/adcirc-cora/intel_x86_64 new file mode 100644 index 0000000..e8b9b94 --- /dev/null +++ b/models/adcirc-cora/intel_x86_64 @@ -0,0 +1,59 @@ +#%Module + +############################################################## +### Machuan Peng and Aijun Zhang Aijun.Zhang@noaa.gov +### NOS' Center for Operational Oceanographic Products and Services (CO-OPS) +### NOS_SHARED +############################################################## +proc ModulesHelp { } { +puts stderr "Set environment veriables for NOSOFS" +} + +module-whatis "This module sets the environment variables for \ + nosofs_shared production utilities:" + +setenv COMP_F ifort +setenv COMP_F_MPI90 mpif90 +setenv COMP_F_MPI mpif90 +setenv COMP_ICC icc +setenv COMP_CC icc +setenv COMP_CPP cpp +setenv COMP_MPCC "mpicc -fc=icc" + +module purge +module use -a /mnt/efs/fs1/save/environments/spack/share/spack/modules/linux-rhel8-x86_64 +module load intel-oneapi-compilers/2023.1.0-gcc-11.2.1-3a7dxu3 +module load intel-oneapi-mpi/2021.9.0-intel-2021.9.0-egjrbfg +setenv MPI_INC "$env(I_MPI_ROOT)/include" + +module load zlib-ng/2.1.4-intel-2021.9.0-57ptxrw +module load libszip/2.1.1-intel-2021.9.0-s3p3pgl +module load hdf5/1.14.3-intel-2021.9.0-4xskthb +module load netcdf-fortran/4.6.1-intel-2021.9.0-meeveoj +module load netcdf-c/4.9.2-intel-2021.9.0-vznmeik + +module use -a /usrx/modulefiles + +# Loding nceplibs modules +#module load produtil/1.0.18 +#module load wgrib2 +#module load bacio/v2.1.0 +#module load bufr/v11.0.2 +#module load w3nco/v2.0.6 +#module load w3emc/v2.2.0 +#module load g2/v3.1.0 + + +## HACK HERE WITH SPACK - use 'module show ' to get the full path +# NETCDF_INCDIR ?= $(shell $(NF_CONFIG) --prefix)/include +setenv NETCDF "/mnt/efs/fs1/save/environments/spack/opt/spack/linux-rhel8-x86_64/intel-2021.9.0/netcdf-fortran-4.6.1-meeveojv5q6onmj6kitfb2mwfqscavn6" +setenv NETCDFC "/mnt/efs/fs1/save/environments/spack/opt/spack/linux-rhel8-x86_64/intel-2021.9.0/netcdf-c-4.9.2-vznmeikm7cp5ht2ktorgf2ehhzgvqqel" + +# setenv LD_LIBRARY_PATH "$env(NETCDF)/lib:$LD_LIBRARY_PATH +prepend-path LD_LIBRARY_PATH "$env(NETCDF)/lib" +prepend-path LD_LIBRARY_PATH "$env(NETCDFC)/lib" + +setenv NETCDF_INCDIR "$env(NETCDF)/include" + +setenv JASPER_LIB "-L/lib64 -ljasper" + diff --git a/models/adcirc-cora/load_modules b/models/adcirc-cora/load_modules new file mode 100644 index 0000000..f633c7e --- /dev/null +++ b/models/adcirc-cora/load_modules @@ -0,0 +1,10 @@ +module use -a /mnt/efs/fs1/save/environments/spack/share/spack/modules/linux-rhel8-x86_64 +module load intel-oneapi-compilers/2023.1.0-gcc-11.2.1-3a7dxu3 +module load intel-oneapi-mpi/2021.9.0-intel-2021.9.0-egjrbfg +setenv MPI_INC "$env(I_MPI_ROOT)/include" + +module load zlib-ng/2.1.4-intel-2021.9.0-57ptxrw +module load libszip/2.1.1-intel-2021.9.0-s3p3pgl +module load hdf5/1.14.3-intel-2021.9.0-4xskthb +module load netcdf-fortran/4.6.1-intel-2021.9.0-meeveoj +module load netcdf-c/4.9.2-intel-2021.9.0-vznmeik diff --git a/models/adcirc-cora/loadmodules.sh b/models/adcirc-cora/loadmodules.sh new file mode 100644 index 0000000..c9e36f4 --- /dev/null +++ b/models/adcirc-cora/loadmodules.sh @@ -0,0 +1,2 @@ +module use -a . +module load intel_x86_64 diff --git a/models/liveocean/README b/models/liveocean/README new file mode 100644 index 0000000..dfa2610 --- /dev/null +++ b/models/liveocean/README @@ -0,0 +1,2 @@ +Instructions and scripts to help install the LiveOcean model will go here. + diff --git a/models/nosofs/README b/models/nosofs/README new file mode 100644 index 0000000..06e99bb --- /dev/null +++ b/models/nosofs/README @@ -0,0 +1 @@ +Scripts to help install the NOSOFS models will go here. diff --git a/patches/adcirc-cora/fix4cora.sh b/patches/adcirc-cora/fix4cora.sh new file mode 100755 index 0000000..ea79554 --- /dev/null +++ b/patches/adcirc-cora/fix4cora.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -x + +# This is a file to update an existing sandbox deployment +# in order to run CORA ADCIRC + +# Uninstall the existing netcdf-fortran and reinstall using updated mirror + +sudo yum -y install bc +spack uninstall -y --dependents netcdf-fortran@4.6.1 + +# Rebuild mirror + +export SPACK_DIR='/save/environments/spack' +export SPACK_MIRROR='s3://ioos-cloud-sandbox/public/spack/mirror' +export SPACK_KEY_URL='https://ioos-cloud-sandbox.s3.amazonaws.com/public/spack/mirror/spack.mirror.gpgkey.pub' + +# These are to write changes to the S3 bucket +# spack buildcache rebuild-index $SPACK_MIRROR # Full sync with build cache - Pushes it to S3 +# spack buildcache update-index $SPACK_MIRROR # use only when adding NEW items + +./reinstall-esmf-netcdf.sh + +# create symbolic links to fortran libraries in fortran-c folder +# adcirc make expects them to be in same folder - can fix that later +cd /save/environments/spack/opt/spack/linux-rhel8-x86_64/intel-2021.9.0/netcdf-c-4.9.2-vznmeikm7cp5ht2ktorgf2ehhzgvqqel/lib || exit 1 + +ln -s ../../netcdf-fortran-4.6.1-meeveojv5q6onmj6kitfb2mwfqscavn6/lib/lib* . + +cd /save/environments/spack/opt/spack/linux-rhel8-x86_64/intel-2021.9.0/netcdf-c-4.9.2-vznmeikm7cp5ht2ktorgf2ehhzgvqqel/include || exit 1 + +ln -s ../../netcdf-fortran-4.6.1-meeveojv5q6onmj6kitfb2mwfqscavn6/include/* . diff --git a/patches/adcirc-cora/reinstall-esmf-netcdf.sh b/patches/adcirc-cora/reinstall-esmf-netcdf.sh new file mode 100755 index 0000000..d8ab7a2 --- /dev/null +++ b/patches/adcirc-cora/reinstall-esmf-netcdf.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +#__copyright__ = "Copyright © 2023 RPS Group, Inc. All rights reserved." +#__license__ = "BSD 3-Clause" + +GCC_VER=11.2.1 + +# Current versions +ONEAPI_VER=2023.1.0 + +# There is no oneapi mpi version 2023.1.0 +INTEL_VER=2021.9.0 +# MPI_VER=2021.9.0 +ESMF_VER=8.5.0 + +SPACK_VER='v0.21.0' +SPACK_DIR='/save/environments/spack' + +SPACKOPTS='-v -y' + +SPACKTARGET="arch=linux-rhel8-x86_64" + +# 1 = Don't build any packages. Only install packages from binary mirrors +# 0 = Will build if not found in mirror/cache +# -1 = Don't check pre-built binary cache +SPACK_CACHEONLY=1 +#SPACK_CACHEONLY=-1 + +########################################################## + +# source include the functions +source ../../scripts/funcs-setup-instance.sh + +module use -a /save/environments/modulefiles +source /opt/rh/gcc-toolset-11/enable + +install_esmf_spack + +echo "Setup completed!" diff --git a/scripts/aws_ec2meta.sh b/scripts/aws_ec2meta.sh deleted file mode 100755 index b494552..0000000 --- a/scripts/aws_ec2meta.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -INSTANCEID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) -IFACE=$(curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs) -SUBNET_ID=$(curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${IFACE}/subnet-id) -VPC_ID=$(curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${IFACE}/vpc-id) -REGION=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed 's/[a-z]$//') -MAC=$(curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs | head -1) -SGIDS=$(curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MAC}/security-group-ids) - -AMIID=`tail /tmp/setup.log | grep ImageId` - -PLACEMENT_GROUP=`aws ec2 describe-placement-groups | grep GroupId | awk -F\" '{print $4}'` - -#echo "instanceid: $INSTANCEID" -#echo "iface: $IFACE" -echo "region: $REGION" -echo "vpc_id: $VPC_ID" -echo "image_id: $AMIID" -echo "sg_ids: " -echo "$SGIDS" -echo "subnet_id: $SUBNET_ID" -echo "placement_group: $PLACEMENT_GROUP" - -#tail /tmp/setup.log | grep ImageId - -# Can manually create an AMI here -# ami_name="IOOS Cloud Sandbox AMI" -# project="IOOS-cloud-sandbox" - -# /usr/local/bin/aws --region ${REGION} ec2 create-image --instance-id $INSTANCEID --name "${ami_name}" \ -# --tag-specification "ResourceType=image,Tags=[{Key=\"Name\",Value=\"${ami_name}\"},{Key=\"Project\",Value=\"${project}\"}]" diff --git a/scripts/funcs-setup-instance.sh b/scripts/funcs-setup-instance.sh index 61d7f6f..ed1217f 100644 --- a/scripts/funcs-setup-instance.sh +++ b/scripts/funcs-setup-instance.sh @@ -49,6 +49,7 @@ setup_environment () { sudo yum -y install automake sudo yum -y install vim-enhanced sudo yum -y install subversion + sudo yum -y install bc sudo yum -y install python3.11-devel sudo alternatives --set python3 /usr/bin/python3.11 @@ -1005,7 +1006,9 @@ install_python_modules_user () { #python3 -m venv /save/$USER/csvenv #source /save/$USER/csvenv/bin/activate - python3 -m pip install pip install prefect==0.15.13 + # https://docs-v1.prefect.io/api/0.15.13/ + + python3 -m pip install prefect==0.15.13 python3 -m pip install --upgrade pip python3 -m pip install --upgrade wheel python3 -m pip install --upgrade dask @@ -1301,6 +1304,8 @@ setup_aliases () { #git config user.name "Patrick Tripp" #git config user.email "44276748+patrick-tripp@users.noreply.github.com" + #git config user.name "Michael Lalime" + #git config user.email "75450912+Michael-Lalime@users.noreply.github.com" cd $home } diff --git a/cloudflow/cluster/configs/newamised.sh b/scripts/newamised.sh similarity index 100% rename from cloudflow/cluster/configs/newamised.sh rename to scripts/newamised.sh diff --git a/scripts/scp-secret.sh b/scripts/scp-secret.sh index 349cfab..d8e27b1 100755 --- a/scripts/scp-secret.sh +++ b/scripts/scp-secret.sh @@ -1,8 +1,13 @@ #!/usr/bin/env bash -# ssh -i ~/.ssh/ioos-sandbox.pem ec2-user@ec2-3-128-236-96.us-east-2.compute.amazonaws.com -host='ec2-3-130-117-202.us-east-2.compute.amazonaws.com' +# Patrick owns the secret key used for the mirror +if [ $# -ne 1 ]; then + echo "Must provide hostname or IP" + exit 1 +fi + +host=$1 user='ec2-user' scp -p -i ~/.ssh/ioos-sandbox.pem ~/OD/SPACK/spack.mirror.gpgkey.secret ${user}@${host}:/save/environments/spack/opt/spack/gpg diff --git a/scripts/spack-update-mirror.sh b/scripts/spack-update-mirror.sh index 9d908d2..0b2e052 100755 --- a/scripts/spack-update-mirror.sh +++ b/scripts/spack-update-mirror.sh @@ -1,10 +1,19 @@ #!/usr/bin/env bash +set -x +SPACK_DIR='/save/environments/spack' SPACK_MIRROR='s3://ioos-cloud-sandbox/public/spack/mirror' +SPACK_KEY_URL='https://ioos-cloud-sandbox.s3.amazonaws.com/public/spack/mirror/spack.mirror.gpgkey.pub' +SPACK_KEY="$SPACK_DIR/opt/spack/gpg/spack.mirror.gpgkey.pub" JOBS=4 -#SPEC='%gcc@4.8' +echo "Using SPACK s3-mirror $SPACK_MIRROR" +spack mirror add s3-mirror $SPACK_MIRROR + +spack buildcache keys --install --trust --force +spack buildcache update-index $SPACK_MIRROR +#SPEC='%gcc@4.8' #SPEC=%intel@2021.3.0 #SPEC='%gcc@8.5' @@ -12,15 +21,24 @@ JOBS=4 #SPEC_LIST='%dpcpp@2023.1.0 %gcc@11.2.1 %intel@2021.9.0 %oneapi@2023.1.0' SPEC_LIST='%gcc@11.2.1 %intel@2021.9.0' -### MAKESURE TO IMPORT THE PRIVATE KEY FIRST! -#SECRET=/mnt/efs/fs1/save/environments/spack/opt/spack/gpg/spack.mirror.gpgkey.secret -#spack gpg trust $SECRET -#exit +SECRET=/mnt/efs/fs1/save/environments/spack/opt/spack/gpg/spack.mirror.gpgkey.secret + +### MAKESURE TO IMPORT/UPLOAD THE PRIVATE KEY FIRST! +if [ ! -e $SECRET ]; then + echo "Could not find $SECRET" + exit 1 +fi + +spack gpg trust $SECRET KEY=F525C05B06DCA266 +spack buildcache --rebuild-index $SPACK_MIRROR +spack buildcache --update-index $SPACK_MIRROR + # Rebuild PKGLIST=`spack find --format "{name}@{version}%{compiler}/{hash}" $SPEC` +#echo "$PKGLIST" for SPEC in $SPEC_LIST do @@ -28,6 +46,7 @@ do for PKG in $PKGLIST do echo "PACKAGE: $PKG" - spack buildcache push -k $KEY -j $JOBS --only package $SPACK_MIRROR $PKG + spack buildcache push -f -k $KEY -j $JOBS --only package $SPACK_MIRROR $PKG + #spack buildcache push -f -k $KEY -j $JOBS $SPACK_MIRROR $PKG done done diff --git a/scripts/system/.bashrc b/scripts/system/.bashrc new file mode 100644 index 0000000..67fff13 --- /dev/null +++ b/scripts/system/.bashrc @@ -0,0 +1,40 @@ +# .bashrc + +# Source global definitions +if [ -f /etc/bashrc ]; then + . /etc/bashrc +fi + +# User specific environment +if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]] +then + PATH="$HOME/.local/bin:$HOME/bin:$PATH" +fi + +# Uncomment the following line if you don't like systemctl's auto-paging feature: +# export SYSTEMD_PAGER= + +# User specific aliases and functions + +export MXNAME="IOOS(RPS)" + +. /usr/share/Modules/init/bash +module use -a /usrx/modulefiles + +. /save/environments/spack/share/spack/setup-env.sh + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +# __conda_setup="$('/save/ec2-user/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" +#if [ $? -eq 0 ]; then +# eval "$__conda_setup" +#else +# if [ -f "/save/ec2-user/miniconda3/etc/profile.d/conda.sh" ]; then +# . "/save/ec2-user/miniconda3/etc/profile.d/conda.sh" +# else +# export PATH="/save/ec2-user/miniconda3/bin:$PATH" +# fi +#fi +#unset __conda_setup +## <<< conda initialize <<< + diff --git a/scripts/system/.tcshrc b/scripts/system/.tcshrc new file mode 100644 index 0000000..b7f1ae3 --- /dev/null +++ b/scripts/system/.tcshrc @@ -0,0 +1,21 @@ +alias lsl ls -al +alias lst ls -altr +alias h history +alias cds cd /save/ec2-user +alias cdc cd /com/ec2-user +alias cdpt cd /ptmp/ec2-user +alias cdsp cd /save/RPS/patrick +alias cdcp cd /com/RPS/patrick + +source /usr/share/Modules/init/tcsh +source /save/environments/spack/share/spack/setup-env.csh + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +# if ( -f "/save/ec2-user/miniconda3/etc/profile.d/conda.csh" ) then +# source "/save/ec2-user/miniconda3/etc/profile.d/conda.csh" +# else +# setenv PATH "/save/ec2-user/miniconda3/bin:$PATH" +# endif +# <<< conda initialize <<< + diff --git a/scripts/system/patrick.gitconfig b/scripts/system/patrick.gitconfig new file mode 100644 index 0000000..9fb4417 --- /dev/null +++ b/scripts/system/patrick.gitconfig @@ -0,0 +1,3 @@ +[user] + name = Patrick Tripp + email = 44276748+patrick-tripp@users.noreply.github.com diff --git a/scripts/test-setup.sh b/scripts/test-setup.sh index 628c7f0..9709838 100755 --- a/scripts/test-setup.sh +++ b/scripts/test-setup.sh @@ -18,27 +18,22 @@ ESMF_VER=8.5.0 SPACK_VER='v0.21.0' SPACK_DIR='/save/environments/spack' -#sudo mkdir -p $SPACK_DIR -#sudo chown ec2-user:ec2-user $SPACK_DIR SPACKOPTS='-v -y' -# SPACKTARGET is only used for some model libraries such as MPI, #SPACKTARGET='target=skylake_avx512' # default on skylake intel instances t3.xxxx #export SPACKTARGET='target=haswell' # works on AMD also - has no avx512 extensions #SPACKTARGET='target=x86_64' # works on anything SPACKTARGET="arch=linux-rhel8-x86_64" - # 1 = Don't build any packages. Only install packages from binary mirrors # 0 = Will build if not found in mirror/cache # -1 = Don't check pre-built binary cache -SPACK_CACHEONLY=0 - +#SPACK_CACHEONLY=1 +SPACK_CACHEONLY=-1 ########################################################## - # source include the functions . funcs-setup-instance.sh @@ -65,12 +60,14 @@ module use -a /save/environments/modulefiles source /opt/rh/gcc-toolset-11/enable #install_spack -# install_intel_oneapi_spack +#install_intel_oneapi_spack +install_esmf_spack + +exit -#install_esmf_spack +install_base_rpms +install_ncep_rpms -#install_base_rpms -# install_ncep_rpms # install_ffmpeg # TODO: create an output file to contain all of this state info - json @@ -89,6 +86,6 @@ project_tag=${project_tag:="IOOS-Cloud-Sandbox"} # create node image ################################### -#./create_image.sh $ami_name $project_tag +./create_image.sh $ami_name $project_tag echo "Setup completed!" diff --git a/terraform/init_template.tpl b/terraform/init_template.tpl index f333067..273ee28 100644 --- a/terraform/init_template.tpl +++ b/terraform/init_template.tpl @@ -1,16 +1,20 @@ #!/usr/bin/env bash set -x -echo `date` > /tmp/setup.log +echo `date` > ~/setup.log # RHEL8+ RUNUSER="ec2-user" -#BRANCH=origin/x86_64 -BRANCH=main # CentOS 7 - Stream 8 #RUNUSER="centos" +BRANCH=main +#BRANCH=origin/x86_64 +#BRANCH=origin/formainpr + +EFS_VERS='v1.36.0' + # Mount the EFS volume mkdir -p /mnt/efs/fs1 @@ -22,11 +26,13 @@ if [ $? -ne 0 ]; then # Error: Unable to find a match: amazon-efs-utils # Alternate method sudo yum -y install rpm-build + sudo yum -y install make +# sudo yum -y install openssl-devel +# sudo yum -y install cargo +# sudo yum -y install rust cd /tmp - git clone https://github.com/aws/efs-utils + git clone -b $EFS_VERS https://github.com/aws/efs-utils cd efs-utils - sudo yum -y install make - sudo yum -y install rpm-build sudo make rpm sudo yum -y install ./build/amazon-efs-utils*rpm cd /tmp @@ -57,9 +63,9 @@ export ami_name=${ami_name} echo "ami name : $ami_name" # Install all of the software and drivers -sudo -E -u $RUNUSER ./setup-instance.sh >> /mnt/efs/fs1/save/$RUNUSER/Cloud-Sandbox/setup.log 2>&1 +sudo -E -u $RUNUSER ./setup-instance.sh >> ~/setup.log 2>&1 # TODO: Check for errors returned from any step above -echo "Installation completed!" >> /mnt/efs/fs1/save/$RUNUSER/Cloud-Sandbox/setup.log -echo `date` >> /mnt/efs/fs1/save/$RUNUSER/Cloud-Sandbox/setup.log +echo "Installation completed!" >> ~/setup.log +echo `date` >> ~/setup.log diff --git a/terraform/login b/terraform/login old mode 100644 new mode 100755 diff --git a/terraform/main.tf b/terraform/main.tf index 3e95f6f..ed734a6 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -21,12 +21,10 @@ resource "aws_iam_role" "sandbox_iam_role" { "Version" : "2012-10-17", "Statement" : [ { + "Sid" : "AttachedIAMRole", + "Effect" : "Allow" "Action" : "sts:AssumeRole", - "Principal" : { - "Service" : "ec2.amazonaws.com" - }, - "Effect" : "Allow", - "Sid" : "" + "Principal" : { "Service" : "ec2.amazonaws.com" }, }, { "Sid": "ListObjectsInBucket", @@ -289,8 +287,6 @@ resource "aws_instance" "head_node" { key_name = var.key_name iam_instance_profile = aws_iam_instance_profile.cloud_sandbox_iam_instance_profile.name - # user_data = data.template_file.init_instance.rendered - user_data = templatefile("init_template.tpl", { efs_name = aws_efs_file_system.main_efs.dns_name, ami_name = "${var.name_tag}-${random_pet.ami_id.id}", aws_region = var.preferred_region, project = var.project_tag }) # associate_public_ip_address = true