diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c710e34..5cebab87 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,37 +1,42 @@ version: 2.1 + +orbs: + circleci-tools: geos-esm/circleci-tools@0.10.0 + +workflows: + build-test: + jobs: + - build-GEOSgcm: + name: build-GEOSgcm-on-<< matrix.compiler >> + matrix: + parameters: + compiler: [gfortran, ifort] + context: + - docker-hub-creds + jobs: - build: - docker: - - image: gmao/ubuntu20-geos-env-mkl:6.0.16-openmpi_4.0.5-gcc_10.2.0 - resource_class: xlarge + build-GEOSgcm: + parameters: + compiler: + type: string + executor: + name: circleci-tools/<< parameters.compiler >> + resource_class: large working_directory: /root/project steps: - run: - name: "GEOS_Shared branch" + name: "GMAO_Shared branch" command: echo ${CIRCLE_BRANCH} - - checkout - - run: - name: "Checkout GEOSgcm fixture and update GEOS_Shared branch" - command: | - cd ${CIRCLE_WORKING_DIRECTORY} - git clone git@github.com:GEOS-ESM/GEOSgcm.git - cd GEOSgcm - mepo clone - mepo develop GEOSgcm_GridComp GEOSgcm_App - if [ "${CIRCLE_BRANCH}" != "develop" ] && [ "${CIRCLE_BRANCH}" != "master" ] && [ "${CIRCLE_BRANCH}" != "main" ] - then - mepo checkout-if-exists ${CIRCLE_BRANCH} - fi - mepo status - - run: - name: "CMake" - command: | - cd ${CIRCLE_WORKING_DIRECTORY}/GEOSgcm - mkdir build - cd build - cmake .. -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_BUILD_TYPE=Debug - - run: - name: "Build" - command: | - cd ${CIRCLE_WORKING_DIRECTORY}/GEOSgcm/build - make -j"$(nproc)" install + - circleci-tools/versions: + compiler: << parameters.compiler >> + - circleci-tools/checkout_fixture + - circleci-tools/mepoclone + - circleci-tools/mepodevelop + - circleci-tools/checkout_if_exists + - circleci-tools/cmake: + compiler: << parameters.compiler >> + - circleci-tools/buildinstall + - circleci-tools/compress_artifacts + - store_artifacts: + path: /logfiles + diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ba1b7521..d07238b3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -18,5 +18,9 @@ # Yuri owns the coupled plots /GEOS_Util/coupled_diagnostics/ @yvikhlya +# The Python Transition Team will own Python files +# until the Python 3 transition is completed +*.py @GEOS-ESM/python-transition-team + # The GEOS CMake Team is the CODEOWNER for the CMakeLists.txt files in this repository CMakeLists.txt @GEOS-ESM/cmake-team diff --git a/.github/workflows/changelog-enforcer.yml b/.github/workflows/changelog-enforcer.yml index b8407dd1..6e46cfc2 100644 --- a/.github/workflows/changelog-enforcer.yml +++ b/.github/workflows/changelog-enforcer.yml @@ -8,9 +8,16 @@ jobs: changelog: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: dangoslen/changelog-enforcer@v1.2.0 + - uses: actions/checkout@v2 + - uses: dangoslen/changelog-enforcer@v2 with: changeLogPath: 'CHANGELOG.md' - skipLabel: '0 diff trivial' + skipLabels: 'Skip Changelog' + missingUpdateErrorMessage: > + No update to CHANGELOG.md found! Please add a changelog + entry to it describing your change. Please note that the + keepachangelog (https://keepachangelog.com) format is + used. If your change is very trivial not applicable for a + changelog entry, add a 'Skip Changelog' label to the pull + request to skip the changelog enforcer. diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d75a6ce..47eedc4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,17 +5,308 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## Unreleased + +### Added ### Changed -- Updated the CircleCI Image +- Compress CircleCI artifacts +- Updated CircleCI to use Orb ### Fixed ### Removed +## [1.5.0] - 2021-12-16 + +### Added + +- Add support for GOCART2G restarts in `regrid.pl` + +### Removed + +- Moved lightning files to Chem_Shared + +## [1.4.13] - 2021-12-15 + +### Fixed +- Quickplot and quickstat bugs + ### Added +- Quickplot now supports plotting GOCART-2G collections +- Support for Three Corner Hat (3CH) Analysis + +## [1.4.12] - 2021-12-09 + +### Changed + +- Update `regrid.pl` + - Add options for MOM5 and MOM6 tile files + - Add ability to use git tags for "tagin" and "tagout" + +### Fixed + +- Update to `idcheck.pl` to allow fvsetup to check whether the expid already exists in the SemperPy databases + +- Moved Lightning_mod.F90 and lightning_toolbox_mod.F90 from GEOS_Shared to a different repository (GEOSchem_GridComp) + +## [1.4.11] - 2021-11-03 + +### Changed + +- add Cascade knob to g5fcst_stats.pl and regrid.pl +- revised dyn_blob: more general on the blobs +- make sure echorc.x exits w/ success code when applicable +- Updated CI to use Baselibs 6.2.8 +- Updated `pyrob` to work with GEOS-IT files +- Changed the Intel MPI and MVAPICH2 flags in `regrid.pl` to be modern + +## [1.4.10] - 2021-10-08 + +### Added + +- Added a new `GMAO_eu` target to create a `libGMAO_eu.a` like in GNU Make days +- Added `parallel_untar.py` script +- Added `dyn_blob.x` and `dyn_fsens_conv.x` to Hermes + +### Fixed + +- CMake fix for non-Intel compilers in GMAO_ods + +### Changed + +- Updates to documentation tables for KX values +- Updates to `obsys-nccs.rc` +- Updates to `g5fcst_stats.pl` +- Updated the CI for GMAO_Shared to do Intel and GNU + +## [1.4.9] - 2021-10-06 + +### Fixed + +- Fixed issue with `regrid.pl` and regridding `catch_internal_rst` + +## [1.4.8] - 2021-10-05 + +### Fixed + +- Fixed issue with CICE4 by compiling with old non-vectorized `Release` flags when compiling with Intel. Requires ESMA_cmake v3.6.1 + +## [1.4.7] - 2021-10-04 + +### Added + +- Added `pyrob_CF` script + +### Changed + +- Updates to support Catchment-CN.4.5 in addition to Catchment-CN.4.0 + +## [1.4.6] - 2021-09-15 + +### Changed + +- Updates to `regrid.pl` to allow processing of restarts for two different versions of Catchment-CN land model +- change is zero-diff for Catchment and Catchment-CN4.0 + +## [1.4.6] - 2021-07-21 + +### Changed + +- Updates to plots package from L. Takacs + +## [1.4.5] - 2021-06-25 + +### Fixed + +- Fix for IASI (#202) + +## [1.4.4] - 2021-06-25 + +### Added + +- Add new `echorc.pl` script (alternative to `echorc.x`) +- Added 181 levs to `GMAO_hermes/dyn2dyn.f90` and a frequency change in `GMAO_etc/obsys-nccs.rc` + +### Changed + +- Changed `esma_mpirun` for MVAPICH2 + +## [1.4.3] - 2021-06-11 + +### Added + +- Add changes consistent with what is in GEOSadas 5.28 + +## [1.4.2] - 2021-05-25 + +### Added + +Add ability to write out energy components to file. + +### Fixed + +Bugfix to prevent a seg-fault when calculating the lightning flash rate implemented in HEMCO/GEOS-Chem. + +## [1.4.1] - 2021-05-14 + +- Renamed `LANL_Shared/LANL_cice` to `LANL_Shared/CICE4` + +### Fixed + +- In `regrid.pl`: Fixed the -wemin and -wemout options so that they will accept integer values; Also added Jason-NL BCS tag choice +- Fixes for PSAS code and Intel MPI + +### Changed + +- Multiple updates brought over from GEOSadas work (see #166) +- Update F2PY module calls to support both Python2 and Python3 loaded at same time + +## [1.4.0] - 2021-04-15 + +### Fixed + +- Sync atmOcnIntlayer with that in GEOS-FP GEOS-5.27.1 (02/2021) GEOSadas-5_27_1_p3 +- Fixed build for directories that are built as part of the GEOSdas + +## [1.3.10] - 2021-04-02 + +### Changed + +- Multiple updates brought over from GEOSadas work (see #166) + +## [1.3.9] - 2021-03-17 + +### Fixed + +- Fix for out-of-bounds error in lightning module (#99) + +### Changed + +- Stats plot updates + +### Added + +- Extend binary tile to supprot future river route component development + +### Removed + +- Remove `CMIP_1977_1982` directory in `GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend` + +## [1.3.8] - 2021-02-12 + +### Changed + +- Plot and stats updates + +### Removed + +- Eliminated references to MAPL_COMM - these are no longer used and will +be deleted in future releases of MAPL + +## [1.3.7] - 2021-01-29 + +### Changed + +- Plot and stats updates + +### Fixed + +- Fix flags for `zonal.f` compilation + +## [1.3.6] - 2021-01-12 + +### Changed + +- Added `-partition` option to `regrid.pl` + +### Fixed + +- Fixed compilation flags for `zonal.f` to match that of CVS +- Fixed bug in `res/zonal.gs` for `zonal.x` location +- Added flag to regrid_forcing_esmf.x to force a 0 to 1 range when regridding files that should use fractions + +### Added + +- Allows PRs with "0-diff trivial" labels to skip updating `CHANGELOG.md` + +## [1.3.5] - 2020-12-10 + +### Fixed + +- Use `CONFIGURE_DEPENDS` with `file(GLOB)` calls +- Fix OpenMP in GMAO_stoch + +### Added + +- Add support for `Aggressive` build type + +## [1.3.4] - 2020-11-25 + +### Fixed + +- Updates for DSO work + +### Changed + +- Update plots consistent with latest cvs tags + +## [1.3.3] - 2020-10-28 + +### Changed + +- Added Docker authentication for CI +- Update CI images for Baselibs 6.0.22 + +### Fixed + +- Updates to `plots/configure` so that it is run at install time. This + should allow others to then run plots on another person's build + +### Removed +### Added + +- Add warning-level loggers to `GEOS_Utilities` (D)QSAT code for NaN detection + +## [1.3.2] - 2020-10-14 + +### Fixed + +- Fixed regrid_forcing.x and regrid_forcing_esmf.x so they will work with MAPL2.2 and beyond + +### Changed + +- Updated the NCPUs detection in various post scripts to be SLURM-aware + +## [1.3.1] - 2020-10-13 + +### Changed + +- Updated `changelog-enforcer.yml` to v1.4.0 + +### Added + +- Modify plots to display new constraint diagnostics +- Update `atmOceanIntLayer.F90` add AVOIL_v0 which wraps the update of surface skin variables (temperature, water mass, salinity, etc) into a single call. + +## [1.3.0] - 2020-09-28 + +### Fixed + +- Undo the change to `GEOS_Utilities.F90` in v1.2.0. This has a bug at the end of the table (#123) + +## [1.2.0] - 2020-09-25 + +### Changed + +- Update `GEOS_Utilities.F90` to match `GEOSadas-5_27_0` (#115) + +## [1.1.10] - 2020-09-25 + +### Changed + +- Updated the CircleCI Image ## [1.1.9] - 2020-09-15 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..704e6d1f --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,133 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +thomas.l.clune@nasa.gov. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available +at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..afa84211 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,16 @@ +# Contributing to GMAO_Shared + +Contributing code to GMAO_Shared should be done via a Pull Request to this repository. + +## Contributor License Agreement (CLA) + +All external developers contributing to GEOS-ESM projects must complete a [Contributor License +Agreement](https://github.com/GEOS-ESM/cla). + +NOTE: Internal NASA contributors associated with GEOS, including contractors, +are covered by other agreements and do not need to sign a CLA. + +## License + +By contributing to GEOS-ESM projects, you agree your contributions will be +licensed under the [Apache 2.0 License](LICENSE) diff --git a/COPYRIGHT b/COPYRIGHT new file mode 100644 index 00000000..26a5bfb0 --- /dev/null +++ b/COPYRIGHT @@ -0,0 +1,15 @@ +NASA Docket No. GSC-15,354-1, and identified as "GEOS-5 GCM Modeling Software” + +“Copyright © 2008 United States Government as represented by the Administrator +of the National Aeronautics and Space Administration. All Rights Reserved.” + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed +under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. diff --git a/GEOS_Pert/GEOS_PertShared/CMakeLists.txt b/GEOS_Pert/GEOS_PertShared/CMakeLists.txt index 9d3e8494..0ffb35eb 100644 --- a/GEOS_Pert/GEOS_PertShared/CMakeLists.txt +++ b/GEOS_Pert/GEOS_PertShared/CMakeLists.txt @@ -2,6 +2,6 @@ esma_set_this () esma_add_library (${this} SRCS GEOS_PertSharedMod.F90 - DEPENDENCIES MAPL_cfio_r4 MAPL_Base GMAO_mpeu GMAO_hermes + DEPENDENCIES MAPL_cfio_r4 MAPL GMAO_mpeu GMAO_hermes INCLUDES ${INC_ESMF}) diff --git a/GEOS_Pert/GEOS_PertSvecs/CMakeLists.txt b/GEOS_Pert/GEOS_PertSvecs/CMakeLists.txt index ad827b09..6d041b05 100644 --- a/GEOS_Pert/GEOS_PertSvecs/CMakeLists.txt +++ b/GEOS_Pert/GEOS_PertSvecs/CMakeLists.txt @@ -11,5 +11,5 @@ set (SRCS esma_add_library (${this} SRCS ${SRCS} - DEPENDENCIES MAPL_cfio_r4 MAPL_Base GMAO_mpeu GEOS_PertShared + DEPENDENCIES MAPL_cfio_r4 MAPL GMAO_mpeu GEOS_PertShared INCLUDES ${INC_ESMF}) diff --git a/GEOS_Shared/CMakeLists.txt b/GEOS_Shared/CMakeLists.txt index 73a1f119..25751705 100644 --- a/GEOS_Shared/CMakeLists.txt +++ b/GEOS_Shared/CMakeLists.txt @@ -5,8 +5,7 @@ set (srcs tropovars.F90 surfacelayer.F90 GEOS_TopoGet.F90 GEOS_GmapMod.F90 GEOS_RemapMod.F90 G3_MPI_Util_Mod.F90 windfix.F90 PWSSSP.F sphere.F calcdbz.F OVP.F90 - getco2.F90 Lightning_mod.F90 lightning_toolbox_mod.F90 - atmOceanIntLayer.F90 + getco2.F90 atmOceanIntLayer.F90 ) esma_add_library(${this} SRCS ${srcs} DEPENDENCIES MAPL) diff --git a/GEOS_Shared/GEOS_Utilities.F90 b/GEOS_Shared/GEOS_Utilities.F90 index 773759ec..137db95d 100644 --- a/GEOS_Shared/GEOS_Utilities.F90 +++ b/GEOS_Shared/GEOS_Utilities.F90 @@ -10,6 +10,8 @@ module GEOS_UtilsMod ! !USES: use MAPL_ConstantsMod + use pFlogger + use ieee_arithmetic ! #include "qsatlqu.code" ! #include "qsatice.code" @@ -150,6 +152,9 @@ module GEOS_UtilsMod real, save :: TMINLQU = ZEROC - 40.0 real, save :: TMINICE = ZEROC + TMINSTR + class(Logger), pointer :: lgr + logical :: debugIsEnabled + contains !BOPI @@ -503,6 +508,11 @@ function QSAT0(TL,PL,RAMP,PASCALS,DQSAT) result(QSAT) real :: URAMP, DD, QQ, TI, DQ, PP integer :: IT + if (debugIsEnabled) then + if (ieee_is_nan(TL)) call lgr%warning(' QSAT0: TL contains NaN') + if (ieee_is_nan(PL)) call lgr%warning(' QSAT0: PL contains NaN') + end if + if(present(RAMP)) then URAMP = -abs(RAMP) else @@ -519,11 +529,12 @@ function QSAT0(TL,PL,RAMP,PASCALS,DQSAT) result(QSAT) PP = PL*100. end if - if(URAMP==TMIX .OR. URAMP==0. .and. UTBL) then + if((URAMP==TMIX .OR. URAMP==0.) .and. UTBL) then if(FIRST) then FIRST = .false. call ESINIT + call LOGGER_INIT end if if (TL<=TMINTBL) then @@ -558,6 +569,11 @@ function QSAT0(TL,PL,RAMP,PASCALS,DQSAT) result(QSAT) else + if(FIRST) then + FIRST = .false. + call LOGGER_INIT + end if + TI = TL - ZEROC if (TI <= URAMP) then @@ -583,6 +599,12 @@ function QSAT1(TL,PL,RAMP,PASCALS,DQSAT) result(QSAT) real, optional, intent(OUT):: DQSAT(:) real :: QSAT(size(TL,1)) integer :: I + + if (debugIsEnabled) then + if (any(ieee_is_nan(TL))) call lgr%warning(' QSAT1: TL contains NaN') + if (any(ieee_is_nan(PL))) call lgr%warning(' QSAT1: PL contains NaN') + end if + do I=1,SIZE(TL,1) if (present(DQSAT)) then QSAT(I) = QSAT0(TL(I),PL(I),RAMP,PASCALS,DQSAT(I)) @@ -599,6 +621,12 @@ function QSAT2(TL,PL,RAMP,PASCALS,DQSAT) result(QSAT) real, optional, intent(OUT):: DQSAT(:,:) real :: QSAT(size(TL,1),size(TL,2)) integer :: I, J + + if (debugIsEnabled) then + if (any(ieee_is_nan(TL))) call lgr%warning(' QSAT2: TL contains NaN') + if (any(ieee_is_nan(PL))) call lgr%warning(' QSAT2: PL contains NaN') + end if + do J=1,SIZE(TL,2) do I=1,SIZE(TL,1) if (present(DQSAT)) then @@ -617,6 +645,12 @@ function QSAT3(TL,PL,RAMP,PASCALS,DQSAT) result(QSAT) real, optional, intent(OUT):: DQSAT(:,:,:) real :: QSAT(size(TL,1),size(TL,2),size(TL,3)) integer :: I, J, K + + if (debugIsEnabled) then + if (any(ieee_is_nan(TL))) call lgr%warning(' QSAT3: TL contains NaN') + if (any(ieee_is_nan(PL))) call lgr%warning(' QSAT3: PL contains NaN') + end if + do K=1,SIZE(TL,3) do J=1,SIZE(TL,2) do I=1,SIZE(TL,1) @@ -692,6 +726,11 @@ function DQSAT0(TL,PL,RAMP,PASCALS,QSAT) result(DQSAT) real :: URAMP, TT, DD, DQQ, QQ, TI, DQI, QI, PP integer :: IT + if (debugIsEnabled) then + if (ieee_is_nan(TL)) call lgr%warning('DQSAT0: TL contains NaN') + if (ieee_is_nan(PL)) call lgr%warning('DQSAT0: PL contains NaN') + end if + if(present(RAMP)) then URAMP = -abs(RAMP) else @@ -708,11 +747,12 @@ function DQSAT0(TL,PL,RAMP,PASCALS,QSAT) result(DQSAT) PP = PL*100. end if - if(URAMP==TMIX .OR. URAMP==0. .and. UTBL) then + if((URAMP==TMIX .OR. URAMP==0.) .and. UTBL) then if(FIRST) then FIRST = .false. call ESINIT + call LOGGER_INIT end if if (TL<=TMINTBL) then @@ -745,6 +785,11 @@ function DQSAT0(TL,PL,RAMP,PASCALS,QSAT) result(DQSAT) else + if(FIRST) then + FIRST = .false. + call LOGGER_INIT + end if + TI = TL - ZEROC if (TI <= URAMP) then @@ -772,6 +817,12 @@ function DQSAT1(TL,PL,RAMP,PASCALS,QSAT) result(DQSAT) real, optional, intent(OUT):: QSAT(:) real :: DQSAT(size(TL,1)) integer :: I + + if (debugIsEnabled) then + if (any(ieee_is_nan(TL))) call lgr%warning('DQSAT1: TL contains NaN') + if (any(ieee_is_nan(PL))) call lgr%warning('DQSAT1: PL contains NaN') + end if + do I=1,SIZE(TL,1) if (present(QSAT)) then DQSAT(I) = DQSAT0(TL(I),PL(I),RAMP,PASCALS,QSAT(I)) @@ -788,6 +839,12 @@ function DQSAT2(TL,PL,RAMP,PASCALS,QSAT) result(DQSAT) real, optional, intent(OUT):: QSAT(:,:) real :: DQSAT(size(TL,1),size(TL,2)) integer :: I, J + + if (debugIsEnabled) then + if (any(ieee_is_nan(TL))) call lgr%warning('DQSAT2: TL contains NaN') + if (any(ieee_is_nan(PL))) call lgr%warning('DQSAT2: PL contains NaN') + end if + do J=1,SIZE(TL,2) do I=1,SIZE(TL,1) if (present(QSAT)) then @@ -806,6 +863,12 @@ function DQSAT3(TL,PL,RAMP,PASCALS,QSAT) result(DQSAT) real, optional, intent(OUT):: QSAT(:,:,:) real :: DQSAT(size(TL,1),size(TL,2),size(TL,3)) integer :: I, J, K + + if (debugIsEnabled) then + if (any(ieee_is_nan(TL))) call lgr%warning('DQSAT3: TL contains NaN') + if (any(ieee_is_nan(PL))) call lgr%warning('DQSAT3: PL contains NaN') + end if + do K=1,SIZE(TL,3) do J=1,SIZE(TL,2) do I=1,SIZE(TL,1) @@ -862,7 +925,10 @@ subroutine GEOS_QsatSet(USETABLE,FORMULATION) TMINICE = ZEROC + TMINSTR endif - if(UTBL) call ESINIT + if(UTBL) then + call ESINIT + call LOGGER_INIT + end if return end subroutine GEOS_QsatSet @@ -911,6 +977,14 @@ subroutine ESINIT end subroutine ESINIT + subroutine LOGGER_INIT + + implicit none + + lgr => logging%get_logger('SHARED.GMAOSHARED.GEOSSHARED.QSAT') + debugIsEnabled = lgr%isEnabledFor(DEBUG) + + end subroutine LOGGER_INIT diff --git a/GEOS_Shared/Lightning_mod.F90 b/GEOS_Shared/Lightning_mod.F90 deleted file mode 100644 index 1bb1ffc8..00000000 --- a/GEOS_Shared/Lightning_mod.F90 +++ /dev/null @@ -1,1855 +0,0 @@ - -! $Id: Lightning_mod.F90,v 0.1 2019/10/07 15:52:00 mrdamon Exp $ - -module Lightning_mod - -#include "MAPL_Generic.h" - -!---------------------------------------------------------------------- -!BOP - -! !MODULE: - -! Lightning_mod -- Container for the GEOS lightning utilities. - -! !USES: - -use MAPL_Mod -use Lightning_Toolbox_Mod, only : CalcFlashRate - - implicit none - private - - -! PUBLIC MEMBER FUNCTIONS: -! - - PUBLIC :: getLightning - PUBLIC :: computeFlashRate - PUBLIC :: flashfit_flipped ! fields passed are vertially flipped from GEOS orientation - PUBLIC :: hemcoFlashrate - PUBLIC :: flash_rate_Lopez - PUBLIC :: emiss_lightning - PUBLIC :: partition - PUBLIC :: computeCAPE - PUBLIC :: readLightRatioGlobalData - PUBLIC :: BUOYANCY - - -! !PARAMETERS: - - real*8, parameter :: AVOGAD = 6.0221367d+23 ! Avogadro number (mole^-1) - real*8, parameter :: CONVFAC = 2.33e-23 ! 14g of N per mole of NO/ 6.02e23 molecules of NO/mole of NO. - real*8, parameter :: PRODFAC = 1.0e26 ! (joules per flash) * molecules of NO per joule - real*8, parameter :: Pa2hPa = 0.01 - integer,parameter :: hp = KIND( REAL( 0.0, 8 ) ) ! HEMCO type - - -! !DESCRIPTION: - -! This module contains parametereizations and utilities pertaining to the calculation of -! flashrate (or strokerate) and NOx from lightning in the Earth's atmosphere. -! The routines for calculation flashrate / stroke rate are: -! -! flashfit_flipped - adapted from the offline GMI-CTM model (Dale Allen) -! computeFlashRate - adapted from MOIST / CTM cinderalla component -! hemcoFlashrate - GEOS-Chem's flashrate calculation -! flash_rate_Lopez (WARNING: this routine is producing invalid results!) -! -! Please review the documentation below for each routine carefully. -! -! -! -! !REVISION HISTORY: -! -! March 17 2018 - Megan Damon. Integrating code from the GMI-CTM. -! October 15 2018 - Megan Damon. Integrating code from GEOS-5 for computeFlashRate -! November 17 2018 - Megan Damon. Bringing into GEOS from standalone development -! Ocotober 7 2019 - Megan Damon. Preparing delivery to Christoph Keller -! -!EOP -!------------------------------------------------------------------------- - - -contains - - -!----------------------------------------------------------------------- -!BOP -! !IROUTINE: getLightning -! -! !DESCRIPTION: -! -! -! -! ORIGIN AND CONTACT -! -! !REVISION HISTORY: -! 7 Nov 2019 Damon First crack -!EOP -!----------------------------------------------------------------------- - -subroutine getLightning (flashSource, Q, TH, PLE, CAPE, BYNCY) - - character(len=*), intent(in) :: flashSource ! MOIST, FIT, HEMCO, or Lopez - - real, dimension(:,:,:), intent(in) :: Q ! specific humidity (kg kg-1) - real, dimension(:,:,:), intent(in) :: TH ! potential temperature (K) - real, dimension(:,:,:), intent(in) :: PLE ! edge pressures (Pa) - - real, dimension(:,:), intent(out) :: CAPE ! - real, dimension(:,:,:), intent(out) :: BYNCY - - logical, save :: first = .true. - integer, save :: IM, JM, LM, KM - - integer :: STATUS - - integer :: shape3d (3) - - - print*, "I am getLightning, flash source: ", flashSource - - if (first) then - - print*, flashSource(1:5), " flash rate calculation" - -! shape3d = shape(TH) - -! IM = shape3d(1) -! JM = shape3d(2) -! LM = shape3d(3) -! KM = LM + 1 - - first = .False. - endif - - !----------------------------------------------------------------------- - ! MOIST-derived flashrate calculation (Dale Allen, old) - !----------------------------------------------------------------------- - if (flashSource == "MOIST") then - - print*, "I will call: computeCAPE, computeFlashRate" - - !call computeCAPE (TH, Q, PLE, CAPE, BYNCY, IM, JM, LM) - - !----------------------------------------------------------------------- - ! Dale Allen flashrate calculation adapted from the GMI-CTM - !----------------------------------------------------------------------- - else if (flashSource == "FIT") then - - print*, "I will call ExtData?" - print*, "I will call flashfit" - - - !----------------------------------------------------------------------- - ! HEMCO flash rate - !----------------------------------------------------------------------- - else if (flashSource == "HEMCO") then - - print*, "I will call computeCAPE" - print*, "I will call the wrapper routine: hemcoFlashrate" - - - !----------------------------------------------------------------------- - ! Lopez (2016?) flash rate from ECMWF - !----------------------------------------------------------------------- - else if (flashSource == "LOPEZ") then - - print*, "I will call BUOYANCY" - print*, "I will call flash_rate_Lopez" - - - else - print*, "" - print*, "Flashrate source not supported!" - print*, "" - stop - endif - -end subroutine getLightning - -!----------------------------------------------------------------------- -!BOP -! !IROUTINE: BUOYANCY -! -! !DESCRIPTION: -! Calculates buoyancy, CAPE (Joule/kg), and the inhibition. -! -! -! ORIGIN AND CONTACT -! Extracted from GEOS_MoistGridCompMod -! Guidance from Saulo Freitas: -! I’d recommend you stick with the Max’s version (1.135). -! However, to get units for CAPE as Joule/kilogram you need to divide -! “HC” (line 9122) and “HSe” (line 9125) by MAPL_CP. -! -! !REVISION HISTORY: -! 1 Nov 2019 Damon Bringing routine to GEOS_Shared -!EOP -!----------------------------------------------------------------------- - - - subroutine BUOYANCY( T, QLM, QS, DQS, DZ, ZLO, BUOY, CAPE, INHB ) - - - - ! !DESCRIPTION: Computes the buoyancy $ g \frac{T_c-T_e}{T_e} $ at each level - ! for a parcel raised from the surface. $Hc$ is the MSE of - ! the parcel and $HSe$ is the MSE of the environment. - -! integer, intent(in) :: IM,JM,LM - real, dimension(:,:,:), intent(in) :: T, QS, DQS, DZ, ZLO - real, dimension(:,: ), intent(in) :: QLM - real, dimension(:,:,:), intent(out) :: BUOY - real, dimension(:,:), intent(out) :: CAPE, INHB - - integer :: I,J,L, LM - real :: HC, HSe, DelT - logical :: UNSTABLE - - print*, "min/max T: ", minval(T), maxval(T) - print*, "min/max QLM: ", minval(QLM), maxval(QLM) - print*, "min/max QS: ", minval(QS), maxval(QS) - print*, "min/max DQS: ", minval(DQS), maxval(DQS) - print*, "min/max DZ: ", minval(DZ), maxval(DZ) - print*, "min/max ZLO: ", minval(ZLO), maxval(ZLO) - - - - LM = size(BUOY,3) - - BUOY = MAPL_UNDEF - - do J=1,size(BUOY,2) - do I=1,size(BUOY,1) - - CAPE(I,J) = 0.0 - INHB(I,J) = 0.0 - -! print*, "I,J,LM: ", I,J,LM -! print*, "CAPE, INHB is zero" - - UNSTABLE = .false. - HC = MAPL_CP*T(I,J,LM) + MAPL_GRAV*ZLO(I,J,LM) + MAPL_ALHL*QLM(I,J) - HC = HC / MAPL_CP - -! print*, "Before loop: ', HC: ", Hc - do L=LM-1,1,-1 - HSe = MAPL_CP*T(I,J,L ) + MAPL_GRAV*ZLO(I,J,L ) + MAPL_ALHL*QS(I,J,L) - HSe = HSe / MAPL_CP - -! print*, "After loop HC, HSe: ", HC, HSe - - if(HC > HSe) then -! print*, "HC > HSe" - DelT = (HC - HSe) / (1.+ (MAPL_ALHL/MAPL_CP)*DQS(I,J,L)) - BUOY(I,J,L) = MAPL_GRAV * (DelT/T(I,J,L)) - CAPE(I,J) = CAPE(I,J) + BUOY(I,J,L)*DZ(I,J,L) - UNSTABLE = .true. - else - if(.not.UNSTABLE) then - if(ZLO(I,J,L)>1000.0) then -! print*, "ZLO > 1000" - exit ! for economy, since CAPE is non-sense if there is this much inhibition - else -! print*, "Not exiting" - DelT = (HC - HSe) / (1.+ (MAPL_ALHL/MAPL_CP)*DQS(I,J,L)) - BUOY(I,J,L) = MAPL_GRAV * (DelT/T(I,J,L)) - INHB(I,J) = CAPE(I,J) + BUOY(I,J,L)*DZ(I,J,L) - end if - else - ! print*, "UNSTABLE" - exit ! if UNSTABLE and delt is negative (i.e., Stop at first LNB) - end if - end if - end do - - if(CAPE(I,J) == 0.0) then - CAPE(I,J) = MAPL_UNDEF - INHB(I,J) = MAPL_UNDEF - end if - - end do - end do - - print*, "min/max BUOY: ", minval(BUOY), maxval(BUOY) - print*, "min/max CAPE: ", minval(CAPE), maxval(CAPE) - print*, "min/max INHB: ", minval(INHB), maxval(INHB) - - end subroutine BUOYANCY -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - -!----------------------------------------------------------------------- -!BOP -! !IROUTINE: computeFlashRate -! -! !DESCRIPTION: -! Generate lightning flash rates [km$^{-2}$ s$^{-1}$] using a six-variable polynomial fit.\\ -! -! -! ORIGIN AND CONTACT -! Dr. Dale Allen, Associate Research Scientist -! Dept. of Atmospheric and Oceanic Science -! University of Maryland -! College Park, MD 20742 -! 301-405-7629 (ph); 301-314-9482 (fax) -! http://www.meto.umd.edu/~allen -! -! -! !FORMULATION NOTES -! Predictor variables are set to zero where CN_PRCP is zero or where the -! optical depth cloud top height is less than 5.5 km. -! The fit returns flash rates in units km$^{-2}$ day$^{-1}$. Convert to -! km$^{-2}$ s$^{-1}$ for the export state. -! -! -! OTHER NOTES OF INTEREST -! MOIST sets CNV_TOPP to zero if there is an absence of convection. -! -! !REVISION HISTORY: -! 30 Nov 2011 Nielsen First crack -! 29 Feb 2012 Nielsen Accomodate CNV\_TOPP MAPL\_UNDEF for and after Fortuna-2\_5\_p4 -! 04 Nov 2014 Kouatchou Adapted the subroutine for GEOSctm -! 18 Nov 2018 Damon Bringing routine to GEOS_Shared -!EOP -!----------------------------------------------------------------------- - - subroutine computeFlashRate (STATE, nc, lm, TS, CCTP, FROCEAN, CN_PRCP, CAPE, & - CNV_MFC, TH, PLE, ZLE, strokeRate, RC) - -! ! USES - implicit none -! -! !INPUT PARAMETERS: - integer, intent(in) :: nc ! Number of cells - integer, intent(in) :: lm ! Number of layers - - real, intent(in), dimension(nc) :: TS ! Surface temperature [K] - real, intent(in), dimension(nc) :: CCTP ! Convective cloud top pressure [Pa] with MAPL_UNDEFS - real, intent(in), dimension(nc) :: FROCEAN ! Areal ocean fraction - real, intent(in), dimension(nc) :: CN_PRCP ! Convective precipation [kg m^{-2} s^{-1}] - REAL, INTENT(IN), DIMENSION(nc) :: CAPE ! Convective available potential energy [J m^{-2}] - - real, intent(in), dimension(nc,lm) :: TH ! Potential temperature [K] - real, intent(in), dimension(nc,0:lm) :: CNV_MFC ! Convective mass flux [kg m^{-2} s^{-1}] - real, intent(in), dimension(nc,0:lm) :: PLE ! Layer interface pressures [Pa] - real, intent(in), dimension(nc,0:lm) :: ZLE ! Layer depths [m] - -! -! !OUTPUT PARAMETERS: - real, intent(out), dimension(nc) :: strokeRate ! Flashes per second - integer, optional, intent(out) :: RC - -! -! !INPUT/OUTPUT PARAMETERS: - TYPE(MAPL_MetaComp), POINTER :: STATE ! Internal MAPL_Generic state - -!BOC -! -! !LOCAL VARIABLES: - - - REAL, DIMENSION(nc) :: A1X1 - REAL, DIMENSION(nc) :: A2X2 - REAL, DIMENSION(nc) :: A3X3 - REAL, DIMENSION(nc) :: A4X4 - REAL, DIMENSION(nc) :: A5X5 - - real :: a0c,a0m ! Coefficients at continental and marine locations - REAL :: a1c,a1m - REAL :: a2c,a2m - REAL :: a3c,a3m - REAL :: a4c,a4m - REAL :: a5c,a5m - - REAL :: x1Divisor ! Divisors for x1-x5. - REAL :: x2Divisor - REAL :: x3Divisor - REAL :: x4Divisor - REAL :: x5Divisor - - real :: x5Power ! Exponent for the surface temperature deviation predictor - - - REAL :: sfcTLimit ! Temperature thresholds - REAL :: airTLimit - - REAL :: hPaCldTop ! Cloud top limiter for weak/no convection - - REAL, ALLOCATABLE, DIMENSION(:) :: x1 ! Five independent variables - REAL, ALLOCATABLE, DIMENSION(:) :: x2 - REAL, ALLOCATABLE, DIMENSION(:) :: x3 - REAL, ALLOCATABLE, DIMENSION(:) :: x4 - REAL, ALLOCATABLE, DIMENSION(:) :: x5 - - - REAL, ALLOCATABLE, DIMENSION(:) :: cloudTopAG ! Cloud top height above ground - REAL, ALLOCATABLE, DIMENSION(:) :: cnv_topp ! Convective cloud top pressure with MAPL_UNDEFs - ! changed to zero - - - REAL, ALLOCATABLE, DIMENSION(:,:) :: dZ ! Layer depths [m] - REAL, ALLOCATABLE, DIMENSION(:,:) :: p ! Pressure at middle of layer [Pa] - REAL, ALLOCATABLE, DIMENSION(:,:) :: T ! Air temperature at middle of layer [K] - - INTEGER, ALLOCATABLE, DIMENSION(:) :: weakCnvMask ! Weak or no convection mask - INTEGER, ALLOCATABLE, DIMENSION(:,:) :: mask ! Working mask - INTEGER, ALLOCATABLE, DIMENSION(:,:) :: cloudTopMask ! Mask is 1 below cloud top - - - integer :: STATUS, k, i, n - CHARACTER(LEN=*), PARAMETER :: Iam = "computeFlashRate" - - - - - - ! Preliminaries - ! ------------- - RC = 0 - strokeRate(:) = 0.0 - - - print*, "after strokeRate" - - ! Coefficients of the predictors, marine locations - ! ------------------------------------------------ - CALL MAPL_GetResource(STATE,a0m,'MARINE_A0:',DEFAULT= 0.0139868,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,a1m,'MARINE_A1:',DEFAULT= 0.0358764,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,a2m,'MARINE_A2:',DEFAULT=-0.0610214,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,a3m,'MARINE_A3:',DEFAULT=-0.0102320,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,a4m,'MARINE_A4:',DEFAULT= 0.0031352,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,a5m,'MARINE_A5:',DEFAULT= 0.0346241,RC=STATUS) - VERIFY_(STATUS) - - - ! Coefficients of the predictors, continental locations - ! ----------------------------------------------------- - CALL MAPL_GetResource(STATE,a0c,'CONTINENT_A0:',DEFAULT=-0.0183172,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,a1c,'CONTINENT_A1:',DEFAULT=-0.0562338,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,a2c,'CONTINENT_A2:',DEFAULT= 0.1862740,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,a3c,'CONTINENT_A3:',DEFAULT=-0.0023363,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,a4c,'CONTINENT_A4:',DEFAULT=-0.0013838,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,a5c,'CONTINENT_A5:',DEFAULT= 0.0114759,RC=STATUS) - VERIFY_(STATUS) - - ! Divisors for nondimensionalization of the predictors - ! ---------------------------------------------------- - CALL MAPL_GetResource(STATE,x1Divisor,'X1_DIVISOR:',DEFAULT=4.36,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,x2Divisor,'X2_DIVISOR:',DEFAULT=9.27,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,x3Divisor,'X3_DIVISOR:',DEFAULT=34.4,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,x4Divisor,'X4_DIVISOR:',DEFAULT=21.4,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,x5Divisor,'X5_DIVISOR:',DEFAULT=14600.,RC=STATUS) - VERIFY_(STATUS) - - - ! Exponent for the surface temperature deviation predictor - ! -------------------------------------------------------- - CALL MAPL_GetResource(STATE,x5Power,'X5_EXPONENT:',DEFAULT=3.00,RC=STATUS) - VERIFY_(STATUS) - - ! Threshold temperatures - ! ---------------------- - CALL MAPL_GetResource(STATE,sfcTLimit,'SFC_T_LIMIT:',DEFAULT=273.0,RC=STATUS) - VERIFY_(STATUS) - CALL MAPL_GetResource(STATE,airTLimit,'AIR_T_LIMIT:',DEFAULT=263.0,RC=STATUS) - VERIFY_(STATUS) - - ! Cloud-top pressure limiter - ! -------------------------- - CALL MAPL_GetResource(STATE,hPaCldTop,'CLOUD_TOP_LIMIT:',DEFAULT=500.,RC=STATUS) - VERIFY_(STATUS) - - print*, "After Resources" - - ! Layer depths [m] - ! ---------------- - ALLOCATE(dZ(nc,lm),STAT=STATUS) - VERIFY_(STATUS) - dZ = zle(:,0:lm-1)-zle(:,1:lm) - - - ! Pressure at mid-layer [Pa] - ! -------------------------- - ALLOCATE(p(nc,lm),STAT=STATUS) - VERIFY_(STATUS) - p = (ple(:,1:lm)+ple(:,0:lm-1))*0.50 - - - ! Temperature at mid-layer [K] - ! ---------------------------- - ALLOCATE(T(nc,lm),STAT=STATUS) - VERIFY_(STATUS) - T = TH*((p*1.00E-05)**(MAPL_RGAS/MAPL_CP)) - - ! Reset CNV_TOPP's MAPL_UNDEFs to zeroes - ! -------------------------------------- - ALLOCATE(cnv_topp(nc),STAT=STATUS) - WHERE(CCTP == MAPL_UNDEF) - cnv_topp = 0.00 - ELSEWHERE - cnv_topp = CCTP - END WHERE - - - ! Set weak/no convection mask - ! --------------------------- - ALLOCATE(weakCnvMask(nc),STAT=STATUS) - VERIFY_(STATUS) - weakCnvMask = 0 - WHERE(cn_prcp == 0.00 .OR. cnv_topp >= hPaCldTop*100.00 .OR. CAPE >= MAPL_UNDEF) weakCnvMask = 1 - - ! Convective cloud top mask - ! ------------------------- - ALLOCATE(cloudTopMask(nc,lm),STAT=STATUS) - VERIFY_(STATUS) - cloudTopMask = 0 - DO k = 1,lm - WHERE(ple(1:nc,k) > cnv_topp(1:nc) .AND. cnv_topp(1:nc) > 0.00) cloudTopMask(1:nc,k) = 1 - END DO - - print*, "Before cloud top distance" - - ! Cloud top distance above ground [m] - ! ----------------------------------- - ALLOCATE(cloudTopAG(nc),STAT=STATUS) - VERIFY_(STATUS) - cloudTopAG = 0.00 - DO i = 1,nc - n = SUM(cloudTopMask(i,1:lm)) - IF(n > 0) cloudTopAG(i) = SUM(dZ(i,lm-n+1:lm)) - END DO - - - ! X1: Cold cloud depth: Vertical extent [km] where T < airTLimit and p > cnv_topp - ! ------------------------------------------------------------------------------- - ALLOCATE(x1(nc),STAT=STATUS) - VERIFY_(STATUS) - ALLOCATE(mask(nc,lm),STAT=STATUS) - VERIFY_(STATUS) - - mask = 0 - WHERE(T < airTLimit .AND. cloudTopMask == 1) mask = 1 - - x1 = 0.00 - DO i = 1,nc - DO k = 1,lm - IF(mask(i,k) == 1) x1(i) = x1(i)+dZ(i,k)*0.001 - END DO - END DO - WHERE(weakCnvMask == 1) x1 = 0.00 - x1 = x1/x1Divisor - - - print*, "Before X4" - - ! X4: Integrated convective mass flux - ! ----------------------------------- - ALLOCATE(x4(nc),STAT=STATUS) - VERIFY_(STATUS) - x4 = 0.00 - DO i = 1,nc - DO k = 1,lm - IF(mask(i,k) == 1) x4(i) = x4(i)+cnv_mfc(i,k)*dZ(i,k) - END DO - END DO - WHERE(weakCnvMask == 1) x4 = 0.00 - x4 = x4/x4Divisor - - - ! X5: Surface temperature deviation from sfcTLimit, positive only. - ! Note: UNDEF TS test retains the ability to boot-strap moist_import_rst. - ! ----------------------------------------------------------------------- - ALLOCATE(x5(nc),STAT=STATUS) - VERIFY_(STATUS) - WHERE(TS == MAPL_UNDEF) - x5 = 0.00 - ELSEWHERE - x5 = TS-sfcTLimit - END WHERE - WHERE(weakCnvMask == 1) x5 = 0.00 - WHERE(x5 < 0.00) x5 = 0.00 - x5 = x5**x5Power/x5Divisor - - - ! X2: Total cloud depth [km] - ! -------------------------- - ALLOCATE(x2(nc),STAT=STATUS) - VERIFY_(STATUS) - x2 = cloudTopAG*0.001 - WHERE(weakCnvMask == 1) x2 = 0.00 - x2 = x2/x2Divisor - - - print*, "Before CAPE" - - ! X3: CAPE - ! -------- - ALLOCATE(x3(nc),STAT=STATUS) - VERIFY_(STATUS) - x3 = CAPE - WHERE(weakCnvMask == 1) x3 = 0.00 - x3 = x3/x3Divisor - - ! Polynomial fit [units: km^{-2} s^{-1}] and individual - ! terms including marine and continental discrimination - ! ----------------------------------------------------- - WHERE(frOcean >= 0.01) - strokeRate = (a0m + a1m*x1 + a2m*x2 + a3m*x3 + a4m*x4 + a5m*x5)/86400.00 - A1X1 = a1m*x1/86400.00 - A2X2 = a2m*x2/86400.00 - A3X3 = a3m*x3/86400.00 - A4X4 = a4m*x4/86400.00 - A5X5 = a5m*x5/86400.00 - ELSEWHERE - strokeRate = (a0c + a1c*x1 + a2c*x2 + a3c*x3 + a4c*x4 + a5c*x5)/86400.00 - A1X1 = a1c*x1/86400.00 - A2X2 = a2c*x2/86400.00 - A3X3 = a3c*x3/86400.00 - A4X4 = a4c*x4/86400.00 - A5X5 = a5c*x5/86400.00 - END WHERE - - - print*, "Before elim negatives" - - ! Eliminate negatives - ! ------------------- - WHERE(strokeRate < 0.00) strokeRate = 0.00 - - ! Set rate to zero where any of x1 through x5 are zero - ! ---------------------------------------------------- - WHERE(x1 == 0.00) strokeRate = 0.00 - WHERE(x2 == 0.00) strokeRate = 0.00 - WHERE(x3 == 0.00) strokeRate = 0.00 - WHERE(x4 == 0.00) strokeRate = 0.00 - WHERE(x5 == 0.00) strokeRate = 0.00 - -! print*, "nc = ", nc -! print*, "min/max TS: ", minval(TS), maxval(TS) -! print*, "min/max PLE: ", minval(PLE), maxval(PLE) -! print*, "min/max ZLE: ", minval(ZLE), maxval(ZLE) -! print*, "min/max CCTP: ", minval(CCTP), maxval(CCTP) -! print*, "min/max FROCEAN: ", minval(FROCEAN), maxval(FROCEAN) -! print*, "min/max CN_PRCP: ", minval(CN_PRCP), maxval(CN_PRCP) -! print*, "a0m-5m: ", a0m, a1m, a2m, a3m, a4m, a5m -! print*, "a0m-5m: ", a0c, a1c, a2c, a3c, a4c, a5c -! print*, "x1Divisor-x5: ", x1Divisor, x2Divisor, x3Divisor, x4Divisor, & -! x5Divisor -! print*, "Threshold temperatures: ", sfcTLimit, airTLimit -! print*, "Cloud-top pressure limiter: ", hPaCldTop -! print*, "Size of dZ: ", shape(dZ) -! print*, "Layer depths 1, lm: ", dZ(1,1), dZ(1,lm) -! print*, "Pressure [Pa] at mid-layer 1, lm: ", p(1,1), p(1,lm) -! print*, "Temperature [K] at mid-layer 1, lm: ", T(1,1), T(1,lm) -! print*, "min/max cnv_topp: ", minval(cnv_topp), maxval(cnv_topp) -! print*, "min/max strokeRate:", minval(strokeRate), maxval(strokeRate) -! print*, "min/max weakCnvMask: ", minval(weakCnvMask), maxval(weakCnvMask) -! print*, "min/max cloudTopMask: ", minval(cloudTopMask), maxval(cloudTopMask) -! print*, "min/max cloudTopAG: ", minval(cloudTopAG), maxval(cloudTopAG) -! print*, "x1(1): ", x1(1) -! print*, "x2(1): ", x2(1) -! print*, "x3(1): ", x3(1) -! print*, "x4(1): ", x4(1) -! print*, "x5(1): ", x5(1) -! print*, "computeFlashRate: A1X1-5(1): ", A1X1(1), A2X2(1), A3X3(1), A4X4(1), A5X5(1) - - - DEALLOCATE(x1,STAT=STATUS) - VERIFY_(STATUS) - DEALLOCATE(x2,STAT=STATUS) - VERIFY_(STATUS) - DEALLOCATE(x3,STAT=STATUS) - VERIFY_(STATUS) - DEALLOCATE(x4,STAT=STATUS) - VERIFY_(STATUS) - DEALLOCATE(x5,STAT=STATUS) - VERIFY_(STATUS) - DEALLOCATE(cnv_topp,STAT=STATUS) - VERIFY_(STATUS) - DEALLOCATE(dZ,STAT=STATUS) - VERIFY_(STATUS) - DEALLOCATE(p,STAT=STATUS) - VERIFY_(STATUS) - DEALLOCATE(T,STAT=STATUS) - VERIFY_(STATUS) - DEALLOCATE(cloudTopAG,STAT=STATUS) - VERIFY_(STATUS) - DEALLOCATE(mask,STAT=STATUS) - VERIFY_(STATUS) - DEALLOCATE(cloudTopMask,STAT=STATUS) - VERIFY_(STATUS) - DEALLOCATE(weakCnvMask,STAT=STATUS) - VERIFY_(STATUS) - - return - - end subroutine computeFlashRate - -!------------------------------------------------------------------------- -!EOP - - -!------------------------------------------------------------------------- -!BOP -! -! !ROUTINE: flashfit_flipped - -! -! !INTERFACE: -! - subroutine flashfit_flipped (cldmas, threshold, ratio_local, ratio_global, midlatAdj, & - desired_g_N_prod_rate, flashrate) - -! !USES - implicit none - -! !INPUT PARAMETERS: - - ! Convective mass flux at desired layer (kg m-2 min-1) - ! Warning: Make sure units are correct and that you've accessed the proper vertical layer. - real*8, intent(in) :: cldmas(:, :) - - ! Desired mean lightning NO production rate (Tg yr-1) (specified in namelist) - real*8, intent(in) :: desired_g_N_prod_rate - - ! Mass flux threshold (kg m-2 min-1) below which flash rate is assumed to be zero (Read in from file) - real*8, intent(in) :: threshold - - ! Adjustment factor local flash rates must be multiplied so that monthly average local flash rates (after - ! "ratio_global" adjustment) match monthly average local v2.2 climatological OTD/LIS flash rates (Read in from file). - ! Note: ratio_local varies monthly. - real*8, intent(inout) :: ratio_local(:,:) - - real*8, intent(in) :: midLatAdj(:,:) - - ! Adjustment factor local flash rates must be multiplied so that globally averaged - ! flash rate matches v2.2 OTD/LIS climatological globally averaged flash rate (Read in from file) - ! Note: ratio_global varies monthly. - real*8, intent(in) :: ratio_global - - -! !OUTPUT PARAMETERS: - - ! Total (CG+IC) flash rate (flashes per grid box per s) - real*8, intent(inout) :: flashrate(:,:) - -! ! DESCRIPTION: -!EOP -!------------------------------------------------------------------------- - - - ! !Local variables - real*8, allocatable :: cldmas_local(:,:) - integer :: shapeCldmas(2) - integer :: RC - - shapeCldmas(:) = shape(cldmas) - - allocate(cldmas_local(shapeCldmas(1),shapeCldmas(2)), STAT=RC) - - ! If deep convection exists - cldmas_local(:,:) = cldmas(:,:) - where(cldmas_local > 0.025) cldmas_local = 0.025 - - where(cldmas_local > threshold) ! comparision is made in s-1 - ! calculation is made in min-1 - flashrate = ratio_global*(cldmas_local(:,:)*60.-threshold*60.)*ratio_local(:,:)/60. - elsewhere - flashrate = 0. - end where - - ! Calculate N production rate (g s-1). - ! For specified flashrate and PRODFAC, global production rate = 3.41 Tg N yr-1. - ! Assume IC and CG flash rates produce the same amount of N / flash. - ! pnox = flashrate(:,:)*PRODFAC*CONVFAC - ! pnox = midLatAdj(:,:)*flashrate(:,:)*PRODFAC*CONVFAC - - !adjust for desired global Nitrogen production rate - !pnox = pnox * desired_g_N_prod_rate /3.41 - - deallocate(cldmas_local) - return - - end subroutine flashfit_flipped -!EOP - -!========================================================================== - -!BOP - -! !IROUTINE: hemcoFlashrate - -! !DESCRIPTION: Wrapper routine for GEOS Chem's flashrate routine. -! -! !INTERFACE: -! - subroutine hemcoFlashrate (cellArea, lwi, lonslocal, latslocal, airTemp, ple, geoPotHeight, & - cnvMfc, otdLisScale, flashRate, RC ) - -! !USES - implicit none - -! !ARGUMENTS - - ! Grid box cell area (m2) - real, intent(in) :: cellArea(:,:) - - ! Land water ice flag - ! need to translate to (0=land; 1=water; 2=ice) - real, intent(in) :: lwi(:,:) - - ! Air temperature in K - real, intent(in) :: airTemp(:,:,:) - - ! Pressure edges (Pa) - real, intent(in) :: ple(:,:,:) - - ! Geo potential height (m) - real, intent(in) :: geoPotHeight(:,:,:) - - ! Cumulative mass flux (kg/m2/s) - real, intent(in) :: cnvMfc(:,:,:) - -! ! Buoyancy (not sure about units. coming from computeCAPE) -! real, intent(in) :: buoyancy(:,:,:) - - ! otdLisScale = 0.355 for c48; 0.1 for c90 - real, intent(in) :: otdLisScale - - ! Flash rate in flashes km-2 s-1 - real, intent(out) :: flashRate(:,:) - - ! Longitude and latitude (local values) in degrees - real, intent(in) :: lonslocal(:,:) - real, intent(in) :: latslocal(:,:) - - ! return code - integer, intent(inout) :: RC - -!EOP - -! Locals - - - - real(hp) :: otdLisScaleHp - - real(hp), pointer, dimension(:,:) :: cellAreaHemco => null() - real(hp), pointer, dimension(:,:) :: otdLisHemco => null() - real(hp), pointer, dimension(:,:) :: lonsHemco => null() - real(hp), pointer, dimension(:,:) :: latsHemco => null() - real(hp), pointer, dimension(:,:) :: convFracHemco => null() - real(hp), pointer, dimension(:,:,:) :: airTempHemco => null() - real(hp), pointer, dimension(:,:,:) :: pleHemco => null() - real(hp), pointer, dimension(:,:,:) :: gridBoxHeightHemco => null() - real(hp), pointer, dimension(:,:,:) :: gridBoxHeightHemco2 => null() - real(hp), pointer, dimension(:,:,:) :: cnvMfcHemco => null() - real(hp), pointer, dimension(:,:,:) :: buoyancyHemco => null() - - integer, pointer, dimension(:,:) :: lwiHemco => null() - - ! outputs - real(hp), pointer, dimension(:,:) :: lNox2d => null() ! Total lightning NOx molecules per 6 hrs - real(hp), pointer, dimension(:,:) :: lfr2d => null() ! flashrate (flashes/min/km2) - real(hp), pointer, dimension(:,:) :: ic2d => null() ! Intra-cloud flash rate (flashes/min/km2) - real(hp), pointer, dimension(:,:) :: cg2d => null() ! Cloud-to-ground flash rate (flashes/min/km2) - real(hp), pointer, dimension(:,:) :: h02d => null() ! Convective cloud top height (m) - integer, pointer, dimension(:,:) :: ltop2d => null() ! Lightning top level - - - integer :: shape3d (3) - integer :: IM, JM, LM, KM - integer :: levCount, kR - - real, parameter :: MIN_TO_SEC = 1.0/60.0 - -!EOP -!------------------------------------------------------------------------- - - - shape3d = shape(airTemp) - IM = shape3d(1) - JM = shape3d(2) - LM = shape3d(3) - KM = LM + 1 - - ALLOCATE(pleHemco (1:IM, 1:JM, 1:LM+1), STAT=RC) - ALLOCATE(cnvMfcHemco (1:IM, 1:JM, 1:LM+1), STAT=RC) - ALLOCATE(airTempHemco (1:IM, 1:JM, 1:LM), STAT=RC) - ALLOCATE(buoyancyHemco(1:IM, 1:JM, 1:LM), STAT=RC) - ALLOCATE(gridBoxHeightHemco (1:IM, 1:JM, 1:LM), STAT=RC) - ALLOCATE(gridBoxHeightHemco2 (1:IM, 1:JM, 1:LM), STAT=RC) - ALLOCATE(cellAreaHemco(1:IM, 1:JM), STAT=RC) - ALLOCATE(convFracHemco(1:IM, 1:JM), STAT=RC) - ALLOCATE(lwiHemco (1:IM, 1:JM), STAT=RC) - ALLOCATE(otdLisHemco (1:IM, 1:JM), STAT=RC) - ALLOCATE(lonsHemco (1:IM, 1:JM), STAT=RC) - ALLOCATE(latsHemco (1:IM, 1:JM), STAT=RC) - - - ALLOCATE(lNox2d (1:IM, 1:JM), STAT=RC) - ALLOCATE(lfr2d (1:IM, 1:JM), STAT=RC) - ALLOCATE(ic2d (1:IM, 1:JM), STAT=RC) - ALLOCATE(cg2d (1:IM, 1:JM), STAT=RC) - ALLOCATE(h02d (1:IM, 1:JM), STAT=RC) - ALLOCATE(ltop2d (1:IM, 1:JM), STAT=RC) - - ! edge layer fields - pleHemco(:,:,1:KM) = ple(:,:,KM:1:-1) - cnvMfcHemco(:,:,1:KM) = cnvMfc(:,:,KM:1:-1) - - ! fields at grid box center - airTempHemco(:,:,1:LM) = airTemp(:,:,LM:1:-1) - - ! buoyancy is only needed if convFrac is provided and if the corresponding toggle is - ! turned on in CalcFlashRate below - but it's hardcoded to false. - buoyancyHemco(:,:,1:LM) = real(-1) !buoyancy(:,:,LM:1:-1) - - - do levCount=1,LM - gridBoxHeightHemco(:,:,levCount) = geoPotHeight(:,:,levCount) - geoPotHeight(:,:,levCount+1) - enddo - gridBoxHeightHemco2(:,:,1:LM) = gridBoxHeightHemco(:,:,LM:1:-1) - - - cellAreaHemco(:,:) = cellArea(:,:) - otdLisHemco(:,:) = real(-1) ! per instruction from Christoph Keller (C.K.) - convFracHemco(:,:) = real(-1) ! dummy value per C.K. - lonsHemco(:,:) = lonslocal(:,:) - latsHemco(:,:) = latslocal(:,:) - - lNox2d(:,:) = real(0) - lfr2d(:,:) = real(0) - ic2d(:,:) = real(0) - cg2d(:,:) = real(0) - h02d(:,:) = real(0) - ltop2d(:,:) = real(0) - - - where (lwi == real(0)) - lwiHemco = 1 - elsewhere (lwi == real(1)) - lwiHemco = 0 - elsewhere - lwiHemco = 2 - end where - - otdLisScaleHp = otdLisScale - - call CalcFlashRate (MAPL_AM_I_ROOT(), IM, JM, LM, cellAreaHemco, lwiHemco, & - otdLisHemco, lonsHemco, latsHemco, airTempHemco, pleHemco, gridBoxHeightHemco2, cnvMfcHemco, & - buoyancyHemco, convFracHemco, .False., otdLisScaleHp, lNox2d, lfr2d, ic2d, cg2d, ltop2d, h02d, RC) - - ! Convert to km-2 s-1 - IF ( RC==0 ) THEN - flashRate (:,:) = real(lfr2d(:,:)) * MIN_TO_SEC - ELSE - flashRate (:,:) = real(0.0) - ENDIF - - DEALLOCATE(lwiHemco) - DEALLOCATE(cellAreaHemco) - DEALLOCATE(convFracHemco) - DEALLOCATE(otdLisHemco) - DEALLOCATE(airTempHemco) - DEALLOCATE(pleHemco) - DEALLOCATE(gridBoxHeightHemco) - DEALLOCATE(gridBoxHeightHemco2) - DEALLOCATE(cnvMfcHemco) - DEALLOCATE(buoyancyHemco) - DEALLOCATE(lonsHemco) - DEALLOCATE(latsHemco) - - DEALLOCATE(lNox2d) - DEALLOCATE(lfr2d) - DEALLOCATE(ic2d) - DEALLOCATE(cg2d) - DEALLOCATE(h02d) - DEALLOCATE(ltop2d) - - return - - end subroutine hemcoFlashrate - - -!----------------------------------------------------------------------- -!BOP -! !IROUTINE: flash_rate_Lopez -! -! !DESCRIPTION: -! Lightning parameterization based on -! "A Lightning Parameterization for the ECMWF Integrated Forecasting System" -! P. Lopez 2016 MWR -! !REVISION HISTORY:! -! - coded/adapted to the GF scheme by Saulo Freitas (10-Aug-2019) -! - code brought to this module by Megan Damon -!===================================================================================== - -!EOP -!----------------------------------------------------------------------- - - - subroutine flash_rate_Lopez(IM, JM, LM, FRLAND, ZKBCON, CAPE, & - ZLE, PFI_CN_GF, CNV_QC, TE, PLO, & - LFR_Lopez) - implicit none - integer ,intent(in) :: im,jm,lm - real ,intent(in), dimension(im,jm,0:lm) :: & - ZLE & ! layer depths [m] - ,PFI_CN_GF ! 3d_ice_precipitation_flux_GF [kg/m2/s] - - real ,intent(in), dimension(im,jm,lm) :: & - TE & ! air temp [K] - ,PLO & ! press (hPa) - ,CNV_QC ! grid_mean_convective_condensate [kg/kg] - - - real ,intent(in), dimension(im,jm) :: FRLAND & ! fraction of land - , cape & ! Convective available potential energy [J/kg] - , zkbcon ! cloud_base_height_deep_GF [m] - - - - real ,intent(out), dimension(im,jm) :: & - LFR_Lopez ! lightning flash density rate (units: 1/km2/day) - - !-- locals - real, parameter :: V_graup = 3.0 ! m/s - real, parameter :: V_snow = 0.5 ! m/s - real, parameter :: beta_land = 0.70 ! 1 - real, parameter :: beta_ocean = 0.45 ! 1 - real, parameter :: alpha = 37.5 ! 1 - real, parameter :: t_initial = 0.0 + 273.15 ! K - real, parameter :: t_final = -25. + 273.15 ! K - - integer :: i,j,k, k_initial, k_final - real :: Q_R, z_base,beta,prec_flx_fr,dz - real, dimension(1:lm) :: q_graup,q_snow,rho - - - - print*, "" - print*, "Hello from flash_rate_Lopez" - print*, "" - - print*, "im, jm, lm: ", im, jm, lm - print*, "FRLAND: ", minval(FRLAND), maxval(FRLAND) - print*, "CAPE: ", minval(CAPE), maxval(CAPE) - print*, "ZLE: ", minval(ZLE), maxval(ZLE) - print*, "PFI_CN_GF ", minval(PFI_CN_GF), maxval(PFI_CN_GF) - print*, "TE: ", minval(TE), maxval(TE) - print*, "PLO: ", minval(PLO), maxval(PLO) - print*, "CNV_QC: ", minval(CNV_QC), maxval(CNV_QC) - print*, "zkbcon: ", minval(zkbcon), maxval(zkbcon) - - DO j = 1, jm - DO i = 1, im - LFR_Lopez(i,j) = 0.0 - - if(ZKBCON(i,j) <= 0. .or. CAPE(i,j) == MAPL_UNDEF) cycle !-> no convection - - beta= frland(i,j)*beta_land + (1.-frland(i,j))*beta_ocean - q_graup(:) = 0. - q_snow (:) = 0. - - do k=lm,1,-1 - rho(k) = 100.*PLO(i,j,k) / (MAPL_RGAS*TE(i,j,k) ) - prec_flx_fr = PFI_CN_GF(i,j,k) / rho(k) - - q_graup(k) = beta *prec_flx_fr/V_graup ! - graupel mixing ratio (kg/kg) - q_snow (k) = (1.-beta)*prec_flx_fr/V_snow ! - snow mixing ratio (kg/kg) - - enddo - k_initial = minloc(abs(te(i,j,:)-t_initial),1) - k_final = minloc(abs(te(i,j,:)-t_final ),1) - - Q_R = 0.0 - do k = k_final, k_initial - - dz = - (zle(i,j,k)-zle(i,j,k-1)) - - Q_R = Q_R + dz*rho(k)*(q_graup(k)*(CNV_QC(i,j,k)+q_snow(k))) - enddo - - z_base = ZKBCON(i,j)/1000. !- convert to [km] - - !--- lightning flash density (units: number of flashes/km2/day) - equation 5 - !--- (to compare with Lopez 2016's results, convert to per year: LFR_Lopez*365) - ! - LFR_Lopez(i,j) = alpha * Q_R *sqrt(max(0.,cape(i,j))) * min(z_base,1.8)**2 - - enddo - enddo - - -if (maxval(LFR_Lopez)>1000.) then - print*,"1================================================= LOPEZ" - print*," LFR=",maxval(LFR_Lopez),maxval(cape),maxval(CNV_QC),maxval(PFI_CN_GF) - print*,"2================================================= LOPEZ" - call flush(6) -endif - end subroutine flash_rate_Lopez -!======================================================================================== - - -!------------------------------------------------------------------------- -!BOP -! -! !ROUTINE: flashfit -! NOTE: The flashfit routine was written for GMI-CTM vertical orientation -! The surface is level 1, to the top of atomsphere -! This routine will flip GEOS-5 oriented arrays and call the -! GMI-CTM routine -! -! !INTERFACE: - - subroutine flashfit () - - print*, "I will call flashfit_flipped after I flip GEOS-5 arrays" - - end subroutine flashfit - -!------------------------------------------------------------------------- -!BOP -! ! ROUTINE: computeCAPE -! -! !INTERFACE: -! - subroutine computeCAPE (TH, Q, PLE, CAPE, BUOY, IM, JM, LM) - -! !DESCRIPTION: -! -! !USES: - use GEOS_UtilsMod - implicit none - - -! !INPUT PARMETERS: - - integer, intent(in) :: IM,JM,LM - real, dimension(IM,JM,LM), intent(in) :: TH ! potential temperature - real, dimension(IM,JM,LM), intent(in) :: Q ! specific humidity - real, dimension(IM,JM,0:LM), intent(in) :: PLE ! pressure - -! !OUTPUT PARAMETERS: - real, dimension(IM,JM), intent(out) :: CAPE - real, dimension(IM,JM,LM), intent(out) :: BUOY - -! !DESCRIPTION: - -! !REVISION HISTORY: -! -! 17Nov18 - Megan Damon. -! -!EOP -!------------------------------------------------------------------------- - -! !Local Variables - integer :: L - real, dimension(IM,JM, LM) :: DQS, QSS, PLO, TEMP, PK, DM, DP - real, dimension(IM,JM, LM) :: ZLO - real, dimension(IM,JM,0:LM) :: ZLE - real, dimension(IM,JM,0:LM) :: CNV_PLE - real, dimension(IM,JM,0:LM) :: PKE - real, dimension(IM,JM ) :: HC - logical, dimension(IM,JM ) :: UNSTABLE - -! Initialize local variables - CNV_PLE = PLE*.01 - PLO = 0.5*(CNV_PLE(:,:,0:LM-1) + CNV_PLE(:,:,1:LM ) ) - PKE = (CNV_PLE/1000.)**(MAPL_RGAS/MAPL_CP) - DP = ( PLE(:,:,1:LM)-PLE(:,:,0:LM-1) ) - PK = (PLO/1000.)**(MAPL_RGAS/MAPL_CP) - DM = DP*(1./MAPL_GRAV) - TEMP = TH*PK - DQS = GEOS_DQSAT(TEMP, PLO, qsat=QSS) - - ZLE(:,:,LM) = 0. - do L=LM,1,-1 - ZLE(:,:,L-1) = TH (:,:,L) * (1.+MAPL_VIREPS*Q(:,:,L)) - ZLO(:,:,L ) = ZLE(:,:,L) + (MAPL_CP/MAPL_GRAV)*( PKE(:,:,L)-PK (:,:,L ) ) * ZLE(:,:,L-1) - ZLE(:,:,L-1) = ZLO(:,:,L) + (MAPL_CP/MAPL_GRAV)*( PK (:,:,L)-PKE(:,:,L-1) ) * ZLE(:,:,L-1) - end do - - ! From BUYOANCY - - HC = TEMP(:,:,LM) + (MAPL_GRAV/MAPL_CP)*ZLO(:,:,LM) + (MAPL_ALHL/MAPL_CP)*Q(:,:,LM) - - do L=LM-1,1,-1 - BUOY(:,:,L) = HC - (TEMP(:,:,L) + (MAPL_GRAV/MAPL_CP)*ZLO(:,:,L) + (MAPL_ALHL/MAPL_CP)*QSS(:,:,L)) - BUOY(:,:,L) = BUOY(:,:,L) / ( (1.+ (MAPL_ALHL/MAPL_CP)*DQS(:,:,L))*TEMP(:,:,L) ) - enddo - - BUOY(:,:,LM) = 0.0 - - UNSTABLE = .false. - - CAPE = 0. - -! New formulation - do L=1,LM-1 - where(BUOY(:,:,L)>0.) - CAPE = CAPE + BUOY(:,:,L)*DM(:,:,L) - end where - end do -! Old formulation -! do L=1,LM-1 -! where(BUOY(:,:,L)>0.) UNSTABLE=.true. -! where(UNSTABLE) -! CAPE = CAPE + BUOY(:,:,L)*DM(:,:,L) -! end where -! end do - - UNSTABLE = CAPE > 0.0 - - where(.not.UNSTABLE) - CAPE=MAPL_UNDEF - end where - - return - - end subroutine computeCAPE -!EOC - -!----------------------------------------------------------------------------- -! !ROUTINE -! emiss_lightning -! -! !DESCRIPTION -! -! Generate NOx production rates from parameterized lightning and distribute vertically -! using profiles from Pickering (2007). -! This routine came from GmiEmiss_lightning_mod in the GEOS-CTM -! -! !REVISION HISTORY: -! July 28, 2008 - Dale Allen. First version, obsolete. -! December 30, 2011 - Eric Nielsen: Simplified for GEOS-5 with flash rates imported from MOIST. -! Target: ~4 Tg N yr^{-1}. Best advice: ~250 moles NO per flash, which -! translates to numberNOperFlash = 1.5E+26. -! January 24, 2013 - Eric Nielsen: kgNOx3D changed from N to NO production rate for export -! EM_LGTNO. Purpose is to allow direct comparison with GMI NO_lgt. -!----------------------------------------------------------------------------- - SUBROUTINE emiss_lightning (i1, i2, j1, j2, k1, k2, minDeepCloudTop, ampFactor, numberNOperFlash, & - lwi, flashrate, cellDepth, dtrn, pNOx3D, kgNOx3D, rc) - - IMPLICIT NONE - - INTEGER, INTENT(IN) :: i1, i2, j1, j2, k1, k2 ! Index ranges on this processor - REAL, INTENT(IN) :: minDeepCloudTop ! Minimum cloud top [km] for selecting deep convection profiles - REAL, INTENT(IN) :: ampFactor ! > 0, for targeting the observed nitrogen production rate [3.41 Tg yr^{-1}] - REAL, INTENT(IN) :: numberNOperFlash ! NO molecules generated by each flash - INTEGER, INTENT(IN) :: lwi(i1:i2, j1:j2) ! Flag: 1=water 2=land 3=ice - REAL*8, INTENT(IN) :: flashrate(i1:i2, j1:j2) ! Flash rate [km^{-2} s^{-1}] - REAL*8, INTENT(IN) :: dtrn(i1:i2, j1:j2, k1:k2) ! Detrainment [kg m^{-2} s^{-1}] - REAL*8, INTENT(IN) :: cellDepth(i1:i2, j1:j2, k1:k2) ! Grid cell depth [m] - - REAL*8, INTENT(OUT) :: pNOx3D(i1:i2, j1:j2, k1:k2) ! Lightning NO production rate [m^{-3} s^{-1}] - REAL*8, INTENT(OUT) :: kgNOx3D(i1:i2, j1:j2, k1:k2) ! NO production rate [kg m^{-3} s^{-1}] - -! Local -! ----- - INTEGER :: k - INTEGER :: status, rc - REAL*8, ALLOCATABLE :: pNOx2D(:,:) ! Lightning NO production [molecules NO m^{-2} s^{-1}] - CHARACTER(LEN=*), PARAMETER :: Iam = "emiss_lightning" - rc = 0 - status = 0 - - -! Validate ranges for ampFactor and numberNOperFlash -! -------------------------------------------------- - IF(ampFactor <= 0.00) THEN - IF(MAPL_AM_I_ROOT()) PRINT *,TRIM(IAm)//": Invalid ampFactor ",ampFactor - status = 1 - VERIFY_(status) - END IF - IF(numberNOperFlash <= 0.00) THEN - IF(MAPL_AM_I_ROOT()) PRINT *,TRIM(IAm)//": Invalid numberNOperFlash ",numberNOperFlash - status = 1 - VERIFY_(status) - END IF - -! Grab some memory -! ---------------- - ALLOCATE(pNOx2D(i1:i2, j1:j2),STAT=status) - VERIFY_(status) - pNOx2D(:,:) = 0.00 - -! Calculate the NOx produdction rate [molecules NO m^{-2} s^{-1}] -! --------------------------------------------------------------- - pNOx2D(:,:) = 1.00E-06*flashrate(:,:)*numberNOPerFlash - -! Amplification/suppression factor: > 0 -! ------------------------------------- - pNOx2D(:,:) = pNOx2D(:,:)*ampFactor - -! Partition vertically without changing units -! ------------------------------------------- - - CALL partition(i1, i2, j1, j2, k1, k2, pNOx2D,dtrn,cellDepth,minDeepCloudTop,lwi,pNOx3D) - -! Place output in useful units -! ---------------------------- - DO k = k1,k2 - -! Number density tendency [m^{-3} s^{-1}] -! --------------------------------------- - pNOx3D(i1:i2,j1:j2,k) = pNOx3D(i1:i2,j1:j2,k)/cellDepth(i1:i2,j1:j2,k) - -! NO density tendency [kg N m^{-3} s^{-1}] -! ---------------------------------------- - kgNOx3D(i1:i2,j1:j2,k) = pNOx3D(i1:i2,j1:j2,k)*30.0064/(1000.00*AVOGAD) - - END DO - -! Clean up -! -------- - DEALLOCATE(pNOx2D,STAT=status) - VERIFY_(status) - - RETURN -END SUBROUTINE emiss_lightning - - - - - -!------------------------------------------------------------------------- -!BOP -! -! !ROUTINE: partition -! This routine was "parition" in GmiEmissionLightning_mod in GEOS-CTM -! -! INTERFACE: - - subroutine partition (i1,i2,j1,j2,k1,k2,pNOx2D,dtrn,cellDepth,minDeepCloudTop,lwi,pNOx3D) - -! !INPUT PARAMETERS: - integer :: i1, i2, j1, j2, k1, k2 - real*8, intent(in) :: pNOx2D(:,:) - real*8, intent(in) :: dtrn(:,:,:) ! Detrainment [kg m^{-2}s^{-1}] - real*8, intent(in) :: cellDepth(:,:,:) ! Grid cell depth [m] - real, intent(in) :: minDeepCloudTop ! Minimum cloud top [km] for selecting deep convection profiles - integer, intent(in) :: lwi(:,:) - -! !OUTPUT PARAMETERS: - REAL*8, intent(out) :: pNOx3D(i1:i2, j1:j2, k1:k2) ! Scaled production rate (no units conversion here) - -! !Local Variables - character(len=*), parameter :: Iam = "partition" - - integer, parameter :: numKm = 17 ! Number of elements (kilometers) in each specified profile - - real, allocatable :: r(:,:) ! Specified NOx distribution profiles - real, allocatable :: w(:) ! Weights applied to scaled cloud layers - real, allocatable :: z(:) ! Layer edge heights above ground - real, allocatable :: zScaled(:) ! Scaled layer edge heights - - integer :: status, i, j, k, cl - integer :: nTop, profileNumber - real :: zLower, zUpper - - status = 0 - - !print*, "In subroutine ", trim(Iam) - - ! Specify the percentage NOx distributions in each km for a numKm-depth cloud. - ! Deep convection is arbitrarily assigned when the cloud top is greater than 7 km. - ! -------------------------------------------------------------------------------- - ALLOCATE(r(numKm,3)) - - - ! Deep convection, continental - ! ---------------------------- - r(1:numKm,1) = (/ 0.23, 0.47, 0.56, 1.40, 2.70, 4.00, 5.03, 6.24, & - 8.60,10.28,11.62,12.34,12.70,12.34, 7.63, 3.02, 0.84 /) - - ! Deep convection, marine - ! ----------------------- - r(1:numKm,2) = (/ 0.60, 1.50, 2.90, 4.30, 5.40, 6.70, 7.70, 8.50, & - 9.60,10.20,10.50,10.20, 8.20, 6.50, 4.50, 2.20, 0.50 /) - - ! Other - ! ----- - r(1:numKm,3) = (/ 2.40, 5.00, 7.40, 9.30,10.60,11.40,11.50,11.00, & - 9.90, 8.30, 6.30, 4.20, 2.20, 0.50, 0.00, 0.00, 0.00 /) - - ALLOCATE(z(k1:k2)) - ALLOCATE(zScaled(k1:k2)) - - - ! Work in each column - ! ------------------- - DO j = j1,j2 - DO i = i1,i2 - - SeeingLightning : IF(pNOx2D(i,j) > 0.00) THEN - - - ! Define cloud top to be highest layer with dtrn > 0, but at least 2. - ! ------------------------------------------------------------------- - DO k = k2,1,-1 - IF(dtrn(i,j,k) > 0) EXIT - END DO - nTop = k - IF(nTop < 2) nTop = 2 - - ! Sum grid box thicknesses (m) to obtain layer edge heights - ! --------------------------------------------------------- - DO k = 1,k2 - z(k) = SUM(cellDepth(i,j,1:k)) - END DO - - ! Select NOx distribution profile. LWI flag is: 1=water 2=land 3=ice - ! ------------------------------------------------------------------ - IF(z(nTop) > minDeepCloudTop*1000.00) THEN - IF(lwi(i,j) == 2) THEN - profileNumber = 1 - ELSE - profileNumber = 2 - END IF - ELSE - profileNumber = 3 - ENDIF - - ! Scale factor, 0 at ground, numKm at cloud top - ! --------------------------------------------- - zScaled(1:k2) = z(1:k2)*numKm/z(nTop) - - ! Grab a little work space and intialize - ! -------------------------------------- - ALLOCATE(w(nTop)) - w(1:nTop) = 0.00 - cl = 1 - zLower = 0.00 - - !print*, "Seeing lightning: ", i, j, pNOx2D(i,j), nTop - !print*, "layer edge heights: ", z(:) - !print*, "profileNumber: ", profileNumber - !print*, "zscaled: ", zScaled(:) - !print*, "cl: ", cl - - - ! Work through each km in the specified distribution - ! -------------------------------------------------- - Kilometers: DO k = 1,numKm - - ! ... segment-by-segment - ! ---------------------- - Segment: DO - - ! Push up to the lesser of scaled cloud height or next km - ! ------------------------------------------------------- - zUpper = MIN(zScaled(cl),k*1.) - IF(zScaled(cl) > numKm) EXIT - - - ! Add increment to scaled weighting for the current cloud layer - ! ------------------------------------------------------------- - w(cl) = w(cl) + (zUpper-zLower) * r(k,profileNumber) * 0.01 - - ! Advance to next cloud layer if any of it lies within this km - ! ------------------------------------------------------------ - IF(zUpper == zScaled(cl)) cl = cl+1 - - ! Shift bounds before working on the next segment - ! ----------------------------------------------- - zLower = zUpper - - ! At top of this km. Advance to the next one - ! ------------------------------------------ - IF(zUpper == k) EXIT - - - END DO Segment - - END DO Kilometers - - - ! Finalize vertical distribution and clean up - ! ------------------------------------------- - pNOx3D(i,j,1:nTop) = w(1:nTop)*pNOx2D(i,j) - - - DEALLOCATE(w) - - endif SeeingLightning - - enddo - enddo - - - DEALLOCATE(r) - DEALLOCATE(z) - DEALLOCATE(zScaled) - - - end subroutine partition - -!------------------------------------------------------------------------- -!BOP -! -! !ROUTINE: partitionnox -! -! !INTERFACE: - - subroutine partitionnox (lprslay, imonth, dtrn, mass, pnox2d, pnox3d) -! !NOTE: This routine is NOT fully implemented. - -! !USES - implicit none - -! !INPUT PARAMETERS: - real*8, allocatable, intent(in) :: lprslay(:,:,:) - integer, intent(in) :: imonth - real*8, intent(in) :: dtrn(:,:,:) - real*8, intent(in) :: mass(:,:,:) - ! integer, intent(in) :: cmi_flags(i1:i2, ju1:j2) - real*8, intent(in) :: pnox2d(:,:) - -! !OUTPUT PARAMETERS: - real*8, intent(inout) :: pnox3d(:,:,:) - - -! ! DESCRIPTION: -! Modeling studies of Pickering (2007) are used as a basis -! to partition lightning NO in the vertical. -! Update 4/4/08 (cont. tropical partitioning changed) -! Update 6/16/09 (Midlat model cloud profile shifted upward) -! INPUTS -! lprslay: 3-d: Pressure at grid box edges (hPa) -! imonth: month integer -! dtrn: 3-d: Detrainment rate (kg m-2 s-1) (units not important) -! dlatcen: 2-d: Latitude at grid box centers (degrees N) -! pnox2d: 2-d: lightning NOx production rate in column (g N/s) -! mass: 3-d: Background (atmospheric) mass in each grid volume (kg) -! OUTPUTS -! pnox3d: lightning NOx production rate in each grid volume (ppv/s) - - - ! need to derive/replace: - ! cmi_flags 2-d: continental(2), marine(1), or ice flag. - - - - ! initial arguments - ! i1,i2, ju1,j2, ilo,ihi, julo,jhi, k1,k2, & - ! & dlatcen, lprslay, mass, dtrn, cmi_flags, & - ! & pnox2d, pnox3d,imonth,flashrate, i2_gl, j2_gl) - - - -! !Local Variables: - integer :: il,ij,ik,iktop ! old indices / counters - integer :: IM, JM, LME, LM ! new indices using shape array information - - real*8 :: ppmtoppv ! conversion from parts per mass to parts per vol. - - real*8, allocatable :: ztop(:,:,:) ! cloud layer tops - real*8, allocatable :: htedge2(:) ! Top edge heights after adjusting to match model-cloud - real*8, allocatable :: fd0(:) ! Used to calc cont of each "model-cloud" - real*8, allocatable :: yout(:) ! Layer to each CTM cloud layer - - integer, allocatable :: inox1(:,:) ! "Model-cloud" type indices - integer, allocatable :: ntop(:,:) ! Top cloud layer indices - integer :: ikmm ! Number of vertical layers in model - - integer,parameter :: pmax(4) = (/ 17, 17, 16, 15 /) - integer :: shapeArray (3) - real*8 :: r0(17,4) - - ikmm = 40 !? What is this, and does it work for layers other than GEOS (72)? - - ! r0(*,i): % of lightning NOy mass dep. into each layer for cld type i - ! "Model cloud" has 17 1-km layers. Percent of total NOx mass - ! deposited into each layer is given for 1) tropical continental, - ! 2) tropical marine, 3) subtropical, and 4) midlatitude "model clouds". - - data r0/ 0.23, 0.47, 0.56, 1.40, 2.70, 4.00, 5.03, 6.24, & - & 8.60,10.28,11.62,12.34,12.70,12.34, 7.63, 3.02, 0.84, & - & 0.60, 1.50, 2.90, 4.30, 5.40, 6.70, 7.70, 8.50, & - & 9.60,10.20,10.50,10.20, 8.20, 6.50, 4.50, 2.20, 0.50, & - & 1.00, 2.10, 3.90, 5.80, 7.70, 9.30,10.50,11.00, & - & 11.00,10.40, 9.20, 7.50, 5.50, 3.40, 1.50, 0.20, 0.00, & - & 1.00, 2.37, 4.95, 7.32, 9.21,10.49,11.29,11.39, & - & 10.89, 9.80, 8.22, 6.24, 4.16, 2.18, 0.49, 0.00, 0.00/ - - shapeArray = shape(lprslay) - IM = shapeArray(1) - JM = shapeArray(2) - LME = shapeArray(3) - LM = LME-1 - - ALLOCATE (ztop(1:IM,1:JM,1:LME-1)) - - ! Assuming a scale height of 8 km, estimate heights at layer tops. - do ik=1,LME-1 - ztop(:,:,ik) = -8. * dlog(lprslay(:,:,ik)/lprslay(:,:,0)) - enddo - - ! Old way : - ! Assuming a scale height of 8 km, estimate heights at layer tops. - ! do ij = ju1,j2 - ! do il = i1,i2 - ! do ik= k1,k2 - ! ztop(il,ij,ik) = -8.* dlog(lprslay(il,ij,ik)/lprslay(il,ij,0)) - ! !ztop(il,ij,ik) = -8.* dlog(lprslay(il,ij,ik)/pctm2(il,ij)) - ! end do - ! end do - ! end do - - allocate(inox1(1:IM,1:JM)) - - ! ! Determine which "model cloud" to use at each grid point. Decision - ! ! is based on whether pts are tropical continental, tropical marine, - ! ! subtropical, or midlatitude. - ! select case (imonth) - ! case (1,2,3,12) - ! ! Southern Hemisphere Summer - ! where ((abs(dlatcen) <= 15.).and.(cmi_flags == 2)) - ! inox1 = 1 ! Tropical continental - ! elsewhere ((abs(dlatcen) <= 15.).and.(cmi_flags /= 2)) - ! inox1 = 2 ! Tropical marine - ! elsewhere ((dlatcen > 15.).and.(dlatcen <= 30.)) - ! inox1 = 3 ! Subtropical - ! elsewhere ((dlatcen >= -40.).and.(dlatcen < -15.)) - ! inox1 = 3 ! Subtropical - ! elsewhere - ! inox1 = 4 ! Midlatitude - ! end where - ! ! In-between months - ! case (4,5,10,11) - ! where ((abs(dlatcen) <= 15.).and.(cmi_flags == 2)) - ! inox1 = 1 ! Tropical continental - ! elsewhere ((abs(dlatcen) <= 15.).and.(cmi_flags /= 2)) - ! inox1 = 2 ! Tropical marine - ! elsewhere ((dlatcen > 15.).and.(dlatcen <= 30.)) - ! inox1 = 3 ! Subtropical - ! elsewhere ((dlatcen >= -30.).and.(dlatcen < -15.)) - ! inox1 = 3 ! Subtropical - ! elsewhere - ! inox1 = 4 ! Midlatitude - ! end where - ! ! Northern Hemisphere Summer - ! case (6,7,8,9) - ! where ((abs(dlatcen) <= 15.).and.(cmi_flags == 2)) - ! inox1 = 1 ! Tropical continental - ! elsewhere ((abs(dlatcen) <= 15.).and.(cmi_flags /= 2)) - ! inox1 = 2 ! Tropical marine - ! elsewhere ((dlatcen > 15.).and.(dlatcen <= 40.)) - ! inox1 = 3 ! Subtropical - ! elsewhere ((dlatcen >= -30.).and.(dlatcen < -15.)) - ! inox1 = 3 ! Subtropical - ! elsewhere - ! inox1 = 4 ! Midlatitude - ! end where - ! case default - ! print*, "CASE default in partitionnox" - ! end select - - ! Define cloud top to be highest layer with dtrn > 0. - ! Caution: Code assumes cloud does not extend above model layer 30. - ! Warning. This statement should be examined as vertical res is increased. - iktop = min(40,LM) - - ALLOCATE (ntop(1:IM,1:JM)) - - ! Determine model layer of cloud top. new way: - do ij=1,JM - do il=1,IM - do ik=LM,2,-1 - if (dtrn(il,ij,ik).gt.0) then - ntop(il,ij) = ik - goto 213 - endif - ntop(il,ij) = 2 - enddo -213 continue - enddo - enddo - - !old way - - ! do ij=ju1,j2 - ! do il=i1,i2 - ! do ik=iktop,2,-1 - ! if (dtrn(il,ij,ik).gt.0) then - ! ntop(il,ij) = ik - ! goto 213 - ! end if - ! ntop(il,ij) = 2 - ! end do - ! 213 continue - ! end do - ! end do - - ! note: ppmtoppv converts from ppm to ppv. N(MW) = 14. - pnox3d = 0. - - - ! Megan Damon - ! adding allocating of htedge2 - allocate(htedge2(1:LM)) - allocate(fd0(0:LM)) - allocate(yout(1:LM)) - - ppmtoppv = 28.97 / 14. - - ! do ij=ju1,j2 - ! do il=i1,i2 - ! if (pnox2d(il,ij).gt.0.0) then - ! iktop = ntop(il,ij) !Index of top cloud layer - ! ii = inox1(il,ij) !"Model-cloud index" - - ! ! CTM "cloud" is expanded or contracted so that its depth = 17 km, which is the - ! ! assumed depth of the "model-cloud". - ! htedge2 = ztop(il,ij,:)*real(pmax(ii))/ztop(il,ij,iktop) - - ! yout = 0. - ! fd0 = 0. - ! do ik=1,pmax(ii) - ! do ikk=1,ikmm - ! fd0(ikk) = max(min(htedge2(ikk)-(ik-1),1.),0.) -! end do - ! do ikk=1,ikmm-1 - ! yout(ikk) = yout(ikk)+r0(ik,ii)*(fd0(ikk)-fd0(ikk-1)) - ! end do - ! enddo - ! yout = yout * 1. / sum(yout) - - ! do ikk=1,iktop - ! pnox3d(il,ij,ikk)=yout(ikk)*pnox2d(il,ij) - ! end do - - ! end if - ! end do - ! end do - - - ! Convert from g N s-1 to ppv s-1. - pnox3d = 1.0d0 ! remove this once there are actual values from above loop - pnox3d = 0.001 * pnox3d * ppmtoppv / mass - - deallocate(ztop) - deallocate(htedge2) - deallocate(fd0) - deallocate(yout) - deallocate(inox1) - deallocate(ntop) - - return - end subroutine partitionnox - - -!============================================================================= - - - -!------------------------------------------------------------------------- -!BOP -! -! !INTERFACE: - subroutine calculateProductionNox (midLatAdj, flashrate, desired_g_N_prod_rate, pnox) - -! !USES: - implicit none - -! !INPUT PARAMETERS: - real*8, intent(in) :: midLatAdj(:,:) - - ! Total (CG+IC) flash rate (flashes per grid box per s) - real*8, intent(in) :: flashrate(:,:) - - - ! Desired mean lightning NO production rate (Tg yr-1) (specified in namelist) - real*8, intent(in) :: desired_g_N_prod_rate - -! !OUTPUT PARAMETERS: - ! Lightning NO production rate (g N per grid box per s) - real*8, intent(out) :: pnox(:,:) - -! !DESCRIPTION -! Calculate N production rate (g s-1). -! For specified flashrate and PRODFAC, global production rate = 3.41 Tg N yr-1. -! Assume IC and CG flash rates produce the same amount of N / flash. -! pnox = flashrate(:,:)*PRODFAC*CONVFAC -!EOP -!------------------------------------------------------------------------- - - pnox = midLatAdj(:,:)*flashrate(:,:)*PRODFAC*CONVFAC - - !adjust for desired global Nitrogen production rate - pnox = pnox * desired_g_N_prod_rate /3.41 - - end subroutine calculateProductionNox - - subroutine readLightRatioGlobalData & - & (light_ratioGlobal_infile_name, ratioGlobalLight, nym, pr_diag, rootProc) - - - character (len=*) :: light_ratioGlobal_infile_name - real*8, intent(out) :: ratioGlobalLight - integer, intent(in) :: nym - logical, intent(in) :: pr_diag, rootProc - - integer :: ii, mm, asc_lun, ierr - real*8 :: readRatio - - - character (len=256) :: err_msg - - integer :: num_reads = 12 * 37 ! roughly 1 entry for each month in satellite era - - asc_lun = 9 - - OPEN(UNIT=asc_lun, FILE=TRIM(light_ratioGlobal_infile_name), STATUS='old', ACTION='read', & - FORM='formatted', ACCESS='sequential', IOSTAT=ierr) - - if (ierr /= 0) then - err_msg = 'Failed to OPEN '//TRIM(light_ratioGlobal_infile_name) - stop - end if - - ratioGlobalLight = 0.0 - - do mm = 1, num_reads - Read (asc_lun, *) ii, readRatio - if (ii == nym) then - ratioGlobalLight = readRatio - exit - end if - end do - - Close (asc_lun) - - IF(rootProc) THEN - WRITE(6,*) 'Ratio global for lightning read from', ratioGlobalLight - END IF - - return - - end subroutine readLightRatioGlobalData - -!======================================================================================== - - - - - end module Lightning_mod diff --git a/GEOS_Shared/atmOceanIntLayer.F90 b/GEOS_Shared/atmOceanIntLayer.F90 index 9a5c2c33..c283b82b 100644 --- a/GEOS_Shared/atmOceanIntLayer.F90 +++ b/GEOS_Shared/atmOceanIntLayer.F90 @@ -3,38 +3,304 @@ module atmOcnIntlayer ! !USES: use MAPL +use GEOS_UtilsMod, only: GEOS_QSAT, GEOS_DQSAT implicit none -private SIMPLE_SW_ABS, AOIL_SST -public ALBSEA, COOL_SKIN, SKIN_SST +private + +public ALBSEA +public AOIL_sfcLayer_T +public water_RHO +public AOIL_Shortwave_abs +public AOIL_v0 contains +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! !IROUTINE: AOIL_v0_HW - update mass in AOIL + +! !DESCRIPTION: +! Computes an update to mass in AOIL (version 0) + +! !INTERFACE: + subroutine AOIL_v0_HW ( NT, DT, DO_DATASEA, & + MaxWaterDepth, MinWaterDepth, & + FRWATER, SNO, EVP, RAIN, HW) + +! !ARGUMENTS: + + integer, intent(IN) :: NT ! number of tiles + real, intent(IN) :: DT ! time-step + integer, intent(IN) :: DO_DATASEA ! 1:uncoupled (AGCM); 0:coupled (AOGCM) + real, intent(IN) :: MaxWaterDepth ! maximum depth of AOIL + real, intent(IN) :: MinWaterDepth ! minimum depth of AOIL + + real, intent(IN) :: FRWATER(:) ! fr of water + real, intent(IN) :: SNO(:) ! snow fall rate + real, intent(IN) :: EVP(:) ! evaporation rate + real, intent(IN) :: RAIN(:) ! rain rate= liquid_water_convective_precipitation + liquid_water_large_scale_precipitation + + real, intent(INOUT) :: HW(:) ! mass of AOIL + +! !LOCAL VARIABLES + !real :: FRESH ! this should include freshwater flux from ?? + real :: FRESHATM(NT) + + !FRESH = 0. + + ! Layer thickness; liquid precip goes right thru ice. + ! FRESHATM is useful for mass flux balance. + ! freshwater flux from atmosphere needs to be added to HW here since it carries zero enthalpy + !--------------------------------------------------------------------------------------------- + FRESHATM = FRWATER*(SNO - EVP) + RAIN + + !HW = HW + DT*(FRESHATM + FRESH) + HW = HW + DT*(FRESHATM) + + if (DO_DATASEA == 0) then ! coupled mode + HW = max( min(HW, (MaxWaterDepth*water_RHO('salt_water'))), (MinWaterDepth*water_RHO('salt_water'))) + else ! uncoupled mode + HW = max( min(HW, (MaxWaterDepth*water_RHO('fresh_water'))), (MinWaterDepth*water_RHO('fresh_water'))) + endif + + end subroutine AOIL_v0_HW +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! !IROUTINE: AOIL_v0_S - update salinity in AOIL + +! !DESCRIPTION: +! Computes an update to salinity (version 0) + +! !INTERFACE: + subroutine AOIL_v0_S (DT, HW, S_old, S_new) + +! !ARGUMENTS: + + real, intent(IN) :: DT ! time-step + real, intent(IN) :: HW(:) ! mass of AOIL + real, intent(IN) :: S_old(:) ! salinity * mass of AOIL + real, intent(OUT) :: S_new(:) ! salinity * mass of AOIL + +! !LOCAL VARIABLES + real :: FSALT ! this should come from CICE as import: salt flux due to sea ice melt + + FSALT = 0. + S_new = (S_old+DT*1.e3*FSALT)/HW ! multiply by 1000 to account for g->kg conversion + + end subroutine AOIL_v0_S +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! !IROUTINE: AOIL_Shortwave_abs - shortwave radiation absorption in AOIL + +! !DESCRIPTION: +! Computes the shortwave radiation that penetrates +! through the AOIL and also the ocean top layer + +! !INTERFACE: + subroutine AOIL_Shortwave_abs (NT, DO_SKIN_LAYER, DO_DATASEA, & + AOIL_depth, OGCM_top_thickness, HW, KUVR, KPAR, & + ALBVRO, ALBVFO, DRUVR, DFUVR, DRPAR, DFPAR, & + PEN, PEN_ocean) +! !ARGUMENTS: + + integer, intent(IN) :: NT ! number of tiles + integer, intent(IN) :: DO_SKIN_LAYER ! 0:No interface layer, 1:active, and accounts for change in SST + integer, intent(IN) :: DO_DATASEA ! 1:uncoupled (AGCM); 0:coupled (AOGCM) + real, intent(IN) :: AOIL_depth ! depth of the AOIL + real, intent(IN) :: OGCM_top_thickness ! thickness of OGCM top layer + + real, intent(IN) :: KUVR ! UV radiation extinction_coefficient + real, intent(IN) :: KPAR(:) ! PAR extinction_coefficient + real, intent(IN) :: HW(:) ! mass of AOIL + + real, intent(IN) :: ALBVRO(:) ! visible beam albedo + real, intent(IN) :: ALBVFO(:) ! visible diffuse albedo + real, intent(IN) :: DRUVR(:) ! surface_downwelling_uvr_beam_flux + real, intent(IN) :: DFUVR(:) ! surface_downwelling_uvr_diffuse_flux + real, intent(IN) :: DRPAR(:) ! surface_downwelling_par_beam_flux + real, intent(IN) :: DFPAR(:) ! surface_downwelling_par_diffuse_flux + + real, intent(OUT) :: PEN(:) ! shortwave flux penetrated through AOIL_depth + real, intent(OUT) :: PEN_ocean(:) ! shortwave flux penetrated through OGCM_top_thickness + +! !LOCAL VARIABLES + real :: PUR(NT), PUF(NT), PPR(NT), PPF(NT) + +! init local variables + PUR = 0.0; PUF = 0.0; PPR = 0.0; PPF = 0.0 + + if (DO_SKIN_LAYER==0) then + PEN = 0.0 + PEN_ocean = 0.0 + RETURN + endif + +! UV penetration + if (DO_DATASEA /= 0) then ! UNcoupled mode + PEN = exp(-(KUVR/water_RHO('fresh_water'))*HW) + else ! coupled mode + PEN = exp(-KUVR*AOIL_depth) + endif + PUR = (1.-ALBVRO)*DRUVR*PEN + PUF = (1.-ALBVFO)*DFUVR*PEN + +! near-IR ("blue light" 490nm?) + if (DO_DATASEA /= 0) then ! UNcoupled mode + PEN = exp(-(KPAR/water_RHO('fresh_water'))*HW) + else ! coupled mode + PEN = exp(-KPAR*AOIL_depth) + endif + PPR = (1.-ALBVRO)*DRPAR*PEN + PPF = (1.-ALBVFO)*DFPAR*PEN + + PEN = PUR + PUF + PPR + PPF ! penetrated flux through AOIL_depth + + if (DO_DATASEA /= 0) then ! UNcoupled mode + PEN_ocean = 0.0 + else ! coupled mode + PEN_ocean = exp(-KUVR*OGCM_top_thickness) + PUR = (1.-ALBVRO)*DRUVR*PEN_ocean + PUF = (1.-ALBVFO)*DFUVR*PEN_ocean + PEN_ocean = exp(-KPAR*OGCM_top_thickness) + PPR = (1.-ALBVRO)*DRPAR*PEN_ocean + PPF = (1.-ALBVFO)*DFPAR*PEN_ocean + PEN_ocean = PUR + PUF + PPR + PPF ! penetrated flux through OGCM_top_thickness + endif + + end subroutine AOIL_Shortwave_abs +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! !IROUTINE: water_RHO - returns density of water: fresh/sea water from MAPL_Constants + +! !DESCRIPTION: + +! !INTERFACE: + function water_RHO (WATER_TYPE) + +! !ARGUMENTS: + + character(len=*), intent(IN) :: WATER_TYPE ! 'fresh_water' or 'sea_water' + real :: water_RHO + + select case(trim(WATER_TYPE)) + case ('fresh_water') + water_RHO = MAPL_RHOWTR + case ('salt_water') + water_RHO = MAPL_RHO_SEAWATER + case default + water_RHO = MAPL_UNDEF + print *, ' Unknown option in water_RHO.' + end select + + end function +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! !IROUTINE: AOIL_sfcLayer_T - Connection to the surface layer: which "temperature" is to be passed from AOIL to sfclayer + +! !DESCRIPTION: +! It is not exact "clear" which temperature is to be input to the sfclayer, that computes the bulk flux formulae +! Hence it may be considered that the temperature that is input to sfclayer is a "tunable parameter" + +! Based on: +! (i) Akella and Suarez, 2018 "The Atmosphere-Ocean Interface Layer of the NASA +! Goddard Earth Observing System Model and Data Assimilation System." GMAO Tech Memo, Vol 51. +! +! Options for the temperatures are: +! Num. Var name Definition Source +! -------------------------------------------------------------------------------- +! 1. TF Temperature at the bottom of AOIL from ocean +! 2. TS Temperature at the top of AOIL calculated from temperature profile in AOIL +! 3. TW Depth averaged mean temperature in the AOIL from internal state +! 4. TW Depth averaged mean temperature in the AOIL calculated from temperature profile in AOIL +! 5. T(z) Temperature at specified depth (z) within AOIL calculated from temperature profile in AOIL and input depth + +! !INTERFACE: + subroutine AOIL_sfcLayer_T (WHICH_OPTION, depth, DO_DATASEA, MUSKIN, epsilon_d, & + AOIL_depth, TW, TS_FOUND, TWMTF, DELTC, & + T_OUT) + +! !ARGUMENTS: + + character(len=*), intent(IN) :: WHICH_OPTION ! See above description of options for the temperature + integer, intent(IN) :: DO_DATASEA ! =1:uncoupled (AGCM); =0:coupled (AOGCM) + real, intent(IN) :: MUSKIN ! exponent in T(z) profile in warm layer, based on Zeng & Beljaars, 2005, typically <= 1. + real, intent(IN) :: epsilon_d ! (thickness of AOIL)/(thickness of OGCM top level), typically < 1. + real, intent(IN) :: depth ! specified depth (z) used in above option 5 + real, intent(IN) :: AOIL_depth ! depth of AOIL + + real, intent(IN) :: TW (:) ! depth averaged mean temperature in the AOIL + real, intent(IN) :: TS_FOUND(:) ! temperature at the bottom of AOIL + real, intent(IN) :: TWMTF(:) ! difference: TW - TS_FOUND + real, intent(IN) :: DELTC(:) ! temperature drop due to cool skin layer + real, intent(OUT):: T_OUT (:) ! temperature that is to be input to the sfclayer + + select case(trim(WHICH_OPTION)) + case ('TF') + T_OUT = TS_FOUND + case ('TS') + if (DO_DATASEA == 1) then + T_OUT = TS_FOUND + ((1.+MUSKIN)/MUSKIN) * TWMTF ! Eqn.(14) of Akella and Suarez, 2018 + else + T_OUT = TS_FOUND + (1./MUSKIN + (1.-epsilon_d)) * TWMTF ! RHS is from Eqn.(15) of Akella and Suarez, 2018 + endif + T_OUT = T_OUT - DELTC ! Eqn.(16) of Akella and Suarez, 2018 + case ('TW_from_internal') + T_OUT = TW + case ('TW_from_Tprof') + T_OUT = TWMTF + TS_FOUND ! Eqn.(5) of Akella and Suarez, 2018 + case ('T_at_depth') +! ! T_{\delta} : top of warm layer or base of cool layer + if (DO_DATASEA == 1) then + T_OUT = TS_FOUND + ((1.+MUSKIN)/MUSKIN) * TWMTF ! Eqn.(14) of Akella and Suarez, 2018 + else + T_OUT = TS_FOUND + (1./MUSKIN + (1.-epsilon_d)) * TWMTF ! RHS is from Eqn.(15) of Akella and Suarez, 2018 + endif + + where ( depth <= DELTC) ! within cool layer + T_OUT = T_OUT - ( 1.-depth/(DELTC + 1.e-6)) * DELTC ! Eqn.(16) of Akella and Suarez, 2018; avoiding divide by zero. + elsewhere ! in warm layer + T_OUT = T_OUT - ( (depth/AOIL_depth)**MUSKIN) * ((1.+MUSKIN)/MUSKIN) * TWMTF ! neglect \delta/d since it is \ll 1. + endwhere + case default + T_OUT = MAPL_UNDEF + print *, ' Unknown option in AOIL_sfcLayer_T.' + end select + + end subroutine AOIL_sfcLayer_T +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !IROUTINE: SKIN_SST - Computes changes to SST in interface layer due to Cool Skin & Diurnal Warming ! !DESCRIPTION: ! Described in section 2 of ! https://rmets.onlinelibrary.wiley.com/doi/abs/10.1002/qj.2988 +! Zeng and Beljaars, 2005 ! !INTERFACE: - subroutine SKIN_SST (DO_SKIN_LAYER,NT,CM,UUA,VVA,UW,VW,HW,SWN,LHF,SHF,LWDNSRF, & - ALW,BLW,PEN,STOKES_SPEED,DT,MUSKIN,TS_FOUNDi,DWARM_,TBAR_,TXW,TYW,USTARW_, & + subroutine SKIN_SST (DO_SKIN_LAYER, DO_DATASEA, NT,CM,UUA,VVA,UW,VW,HW,SWN,LHF,SHF,LWDNSRF, & + ALW,BLW,PEN, PEN_ocean, STOKES_SPEED,DT,MUSKIN,TS_FOUNDi,DWARM_,TBAR_, & + TXW,TYW,USTARW_, & DCOOL_,TDROP_,SWCOOL_,QCOOL_,BCOOL_,LCOOL_,TDEL_,SWWARM_,QWARM_,ZETA_W_, & - PHIW_,LANGM_,TAUTW_,uStokes_,TS,TWMTS,TW,WATER,FR,n_iter_cool,fr_ice_thresh) + PHIW_,LANGM_,TAUTW_,uStokes_,TS,TWMTS,TWMTF,DELTC,TW,FR,n_iter_cool,fr_ice_thresh, & + epsilon_d, do_grad_decay) ! !ARGUMENTS: integer, intent(IN) :: DO_SKIN_LAYER ! 0: No interface layer, 1: active, and accounts for change in SST + integer, intent(IN) :: DO_DATASEA ! =1:uncoupled (AGCM); =0:coupled (AOGCM) integer, intent(IN) :: NT ! number of tiles - real, intent(IN) :: FR (:,:) ! fraction of surface (water/ice) - integer, intent(IN) :: WATER ! subtile number assigned to surface type: "WATER" - real, intent(IN) :: CM (:,:) ! transfer coefficient for wind + real, intent(IN) :: FR (:) ! fraction of surface water + real, intent(IN) :: CM (:) ! transfer coefficient for wind real, intent(IN) :: UUA (:) ! zonal wind real, intent(IN) :: VVA (:) ! meridional wind real, intent(IN) :: UW (:) ! u-current real, intent(IN) :: VW (:) ! v-current - real, intent(IN) :: HW (:) ! mass of skin layer + real, intent(IN) :: HW (:) ! mass of AOIL real, intent(IN) :: SWN (:) ! net shortwave radiation incident at surface real, intent(IN) :: LHF (:) ! latent heat flux real, intent(IN) :: SHF (:) ! sensible heat flux @@ -42,14 +308,17 @@ subroutine SKIN_SST (DO_SKIN_LAYER,NT,CM,UUA,VVA,UW,VW,HW,SWN,LHF,SHF,LWDNSRF, real, intent(IN) :: ALW (:) ! for linearized \sigma T^4 real, intent(IN) :: BLW (:) ! for linearized \sigma T^4 real, intent(IN) :: PEN (:) ! shortwave radiation that penetrates below interface layer + real, intent(IN) :: PEN_ocean(:) ! shortwave radiation that penetrates below top ocean model layer real, intent(IN) :: STOKES_SPEED ! scalar value set for Stokes speed- place holder for output from Wave model real, intent(IN) :: DT ! time-step real, intent(IN) :: MUSKIN ! exponent of temperature: T(z) profile in warm layer real, intent(IN) :: TS_FOUNDi(:) ! bulk SST (temperature at base of warm layer) integer, intent(IN) :: n_iter_cool ! number of iterations to compute cool-skin layer real, intent(IN) :: fr_ice_thresh ! threshold on ice fraction, sort of defines Marginal Ice Zone + real, intent(IN) :: epsilon_d ! (thickness of AOIL)/(thickness of OGCM top level), typically < 1. + character(len=*), intent(IN) :: do_grad_decay ! simulate a gradual decay of diurnal warming? yes or no. Follows Zeng and Beljaars, 2005. - real, intent(OUT) :: DWARM_ (:) ! depth of skin layer + real, intent(OUT) :: DWARM_ (:) ! depth of AOIL real, intent(OUT) :: TBAR_ (:) ! copy of TW (also internal state) to export out real, intent(OUT) :: USTARW_(:) ! u_{*,w} real, intent(OUT) :: DCOOL_ (:) ! depth of cool-skin layer @@ -67,45 +336,42 @@ subroutine SKIN_SST (DO_SKIN_LAYER,NT,CM,UUA,VVA,UW,VW,HW,SWN,LHF,SHF,LWDNSRF, real, intent(OUT) :: LANGM_ (:) ! Langmuir number real, intent(OUT) :: TAUTW_ (:) ! time-scale of relaxation to bulk SST (i.e., TS_FOUND) real, intent(OUT) :: uStokes_(:) ! Stokes speed + real, intent(OUT) :: TXW (:) ! zonal stress + real, intent(OUT) :: TYW (:) ! meridional stress - real, intent(INOUT) :: TXW (:) ! zonal stress - real, intent(INOUT) :: TYW (:) ! meridional stress + real, intent(OUT) :: DELTC (:) ! "internal state" variable that has: TDROP_ real, intent(INOUT) :: TWMTS (:) ! "internal state" variable that has: TW - TS + real, intent(INOUT) :: TWMTF (:) ! "internal state" variable that has: TW - bulk SST real, intent(INOUT) :: TW (:) ! "internal state" variable that has: TW - real, intent(INOUT) :: TS (:,:) ! skin temperature + real, intent(INOUT) :: TS (:) ! skin temperature ! !LOCAL VARIABLES integer :: N, iter_cool - real :: ALPH, Qb, fC, fLA, X1, X2 + real :: ALPH, Qb, fC, fLA, X1, X2, dTw + real, parameter :: TICE = MAPL_TICE-1.8 ! -1.8C freezing temperature of sea water real, parameter :: RHO_SEAWATER = 1022.0 ! sea water density [kg/m^3] ! Replace Usage of RHO_SEAWATER with MAPL_RHO_SEAWATER real, parameter :: NU_WATER = 1.0E-6 ! kinematic viscosity of water [m^2/s] real, parameter :: TherCond_WATER = 0.563 ! Thermal conductivity of water [W/m/ K] real, parameter :: bigC = & (16.0 * (MAPL_CAPWTR*MAPL_RHOWTR)**2 * NU_WATER**3) / TherCond_WATER**2 -! !DESCRIPTION: -! Based on Fairall et al, 1996 for Cool Skin Layer and Takaya et al, 2010 for Warm Layer - -! Open water conditions, including computation of skin layer parameters -!---------------------------------------------------------------------- - do N = 1, NT ! N is now looping over all tiles (NOT sub-tiles). ! Stress over "open" water (or Marginal Ice Zone) depends on ocean currents !-------------------------------------------------------------------------- - TXW(N) = CM(N,WATER)*(UUA(N) - UW(N)) - TYW(N) = CM(N,WATER)*(VVA(N) - VW(N)) + TXW(N) = CM(N)*(UUA(N) - UW(N)) + TYW(N) = CM(N)*(VVA(N) - VW(N)) - if( FR(N, WATER) > fr_ice_thresh) then + if( FR(N) > fr_ice_thresh) then ! Depth and mean temperature of interface layer !---------------------------------------------- DWARM_(N) = HW(N)/MAPL_RHOWTR ! replace MAPL_RHOWTR with MAPL_RHO_SEAWATER - TBAR_(N) = TS(N,WATER) + TWMTS(N) + TBAR_(N) = TS(N) + TWMTS(N) ! Ustar in water has a floor of 2 \mu m/s !---------------------------------------- @@ -131,7 +397,7 @@ subroutine SKIN_SST (DO_SKIN_LAYER,NT,CM,UUA,VVA,UW,VW,HW,SWN,LHF,SHF,LWDNSRF, ! Heat loss at top of skin (cool) layer !-------------------------------------- - X1 = LHF(N) + SHF(N) - ( LWDNSRF(N) -(ALW(N) + BLW(N)*( TS(N,WATER)-TDROP_(N)))) + X1 = LHF(N) + SHF(N) - ( LWDNSRF(N) -(ALW(N) + BLW(N)*( TS(N)-TDROP_(N)))) QCOOL_(N) = X1 - SWCOOL_(N) ! Bouyancy production in cool layer depends on surface cooling @@ -167,10 +433,14 @@ subroutine SKIN_SST (DO_SKIN_LAYER,NT,CM,UUA,VVA,UW,VW,HW,SWN,LHF,SHF,LWDNSRF, WARM_LAYER: if(DO_SKIN_LAYER==0) then ! Warm layer temperature increase calculated based on definition of mean interface temperature. - TDEL_(N) = TS(N,WATER) + TDROP_(N) - TWMTS(N) = TBAR_(N) - TS(N,WATER) + TDEL_(N) = TS_FOUNDi(N) + TS(N) = TS_FOUNDi(N) + TW(N) = TS_FOUNDi(N) + TBAR_(N) = TS_FOUNDi(N) + TWMTS(N) = 0. + TWMTF(N) = 0. + DELTC(N) = 0. -! fill up with mapl_undef - so that LocStreamMod does NOT die while exporting SWWARM_(N) = MAPL_UNDEF QWARM_ (N) = MAPL_UNDEF ZETA_W_(N) = MAPL_UNDEF @@ -188,15 +458,31 @@ subroutine SKIN_SST (DO_SKIN_LAYER,NT,CM,UUA,VVA,UW,VW,HW,SWN,LHF,SHF,LWDNSRF, ! Short wave absorbed in the warm layer. !-------------------------------------- - X1 = LHF(N) + SHF(N) - ( LWDNSRF(N) -(ALW(N) + BLW(N)*TS(N,WATER))) - SWWARM_(N) = SWN(N) - PEN(N) + X1 = LHF(N) + SHF(N) - ( LWDNSRF(N) -(ALW(N) + BLW(N)*TS(N))) + + if (DO_DATASEA == 0) then ! coupled mode + SWWARM_(N) = SWN(N) - PEN(N) - (epsilon_d/(1.-epsilon_d))* (PEN(N)-PEN_ocean(N)) + else ! uncoupled mode + SWWARM_(N) = SWN(N) - PEN(N) + endif QWARM_(N) = SWWARM_(N) - X1 ! Stability parameter & Similarity function !------------------------------------------ - ZETA_W_(N) = (DWARM_(N)*MAPL_KARMAN*MAPL_GRAV*ALPH*QWARM_(N)) / & ! zeta_w = dwarm/obukhov length - (RHO_SEAWATER*MAPL_CAPWTR*USTARW_(N)**3) ! replace RHO_SEAWATER with MAPL_RHO_SEAWATER + if ( trim(do_grad_decay) == 'yes') then + dTw = ((1.+MUSKIN)/MUSKIN) * (TBAR_(N)-TS_FOUNDi(N)) + if ( (dTw > 0.) .and. (QWARM_(N)<0.)) then + ZETA_W_(N) = (sqrt(DWARM_(N)*dTw*MUSKIN*MAPL_GRAV*ALPH)*MAPL_KARMAN)/ & ! F_d formulation + (sqrt(5.) * USTARW_(N)) + else + ZETA_W_(N) = (DWARM_(N)*MAPL_KARMAN*MAPL_GRAV*ALPH*QWARM_(N)) / & ! zeta_w = dwarm/obukhov length + (RHO_SEAWATER*MAPL_CAPWTR*USTARW_(N)**3) ! replace RHO_SEAWATER with MAPL_RHO_SEAWATER + endif + else + ZETA_W_(N) = (DWARM_(N)*MAPL_KARMAN*MAPL_GRAV*ALPH*QWARM_(N)) / & ! zeta_w = dwarm/obukhov length + (RHO_SEAWATER*MAPL_CAPWTR*USTARW_(N)**3) ! replace RHO_SEAWATER with MAPL_RHO_SEAWATER + endif if ( ZETA_W_(N) >= 0.0) then ! Takaya: Eqn(5) PHIW_(N) = 1. + (5*ZETA_W_(N) + 4.*ZETA_W_(N)**2)/(1+3.*ZETA_W_(N)+0.25*ZETA_W_(N)**2) @@ -214,25 +500,37 @@ subroutine SKIN_SST (DO_SKIN_LAYER,NT,CM,UUA,VVA,UW,VW,HW,SWN,LHF,SHF,LWDNSRF, IF (fLA <= 1.0) fLA = 1.0 ! Limit range of fLa to be >=1 IF (ZETA_W_(N)<= 0.0) fLA = 1.0 ! Apply fLa to stable conditions only - TAUTW_(N) = & - (DWARM_(N)*PHIW_(N))/(MAPL_KARMAN*USTARW_(N)*fLA*(MUSKIN+1.)) - - X2 = DT * & - ( (MAPL_KARMAN*USTARW_(N)*fLA*(MUSKIN+1.))/(DWARM_(N)*PHIW_(N)) ) + if (DO_DATASEA == 0) then ! coupled mode + TAUTW_(N) = & + ((1.-epsilon_d)*DWARM_(N)*PHIW_(N))/(MAPL_KARMAN*USTARW_(N)*fLA*(MUSKIN+1.)) + X2 = DT * & + ( (MAPL_KARMAN*USTARW_(N)*fLA*(MUSKIN+1.))/(DWARM_(N)*PHIW_(N) * (1.-epsilon_d)) ) + else ! uncoupled mode + TAUTW_(N) = & + (DWARM_(N)*PHIW_(N))/(MAPL_KARMAN*USTARW_(N)*fLA*(MUSKIN+1.)) + X2 = DT * & + ( (MAPL_KARMAN*USTARW_(N)*fLA*(MUSKIN+1.))/(DWARM_(N)*PHIW_(N)) ) + endif ! We DO NOT include cool-skin tdrop in TW, therefore, we now save TW +! ------------------------------------------------------------------- - TW(N) = TS_FOUNDi(N) + ( 1.0/(1.+X2)) * (TBAR_(N) - TS_FOUNDi(N)) - TS(N,WATER) = TS(N,WATER) + ((1.0+MUSKIN)/MUSKIN) * (TW(N) - TBAR_(N)) + TW(N) = TS_FOUNDi(N) + ( 1.0/(1.+X2)) * (TBAR_(N) - TS_FOUNDi(N)) + TS(N) = TS(N) + ((1.0+MUSKIN)/MUSKIN) * (TW(N) - TBAR_(N)) - TDEL_(N) = TS_FOUNDi(N) + ((1.0+MUSKIN)/MUSKIN) * MAX(TW(N) - TS_FOUNDi(N), 0.0) + TDEL_(N) = TS_FOUNDi(N) + ((1.0+MUSKIN)/MUSKIN) * MAX(TW(N) - TS_FOUNDi(N), 0.0) TBAR_(N) = TW(N) - TS(N,WATER) = TDEL_(N) - TDROP_(N) - TWMTS(N) = TW(N) - TS(N,WATER) + TS(N) = TDEL_(N) - TDROP_(N) + TWMTF(N) = 0.0 +! TWMTF(N) = TW(N) - TS_FOUNDi(N) ! This will cause non-zero diff in internal/checkpoint, but ZERO DIFF in OUTPUT. end if WARM_LAYER + + ! Protection on minimum water temperture, do not allow colder than TICE + TW(N) = MAX(TW(N),TICE) + TWMTS(N) = TW(N) - TS(N) - else ! FR(N, WATER) <= fr_ice_thresh + else ! FR(N) <= fr_ice_thresh DCOOL_ (N) = MAPL_UNDEF LCOOL_ (N) = MAPL_UNDEF DWARM_ (N) = MAPL_UNDEF @@ -243,7 +541,9 @@ subroutine SKIN_SST (DO_SKIN_LAYER,NT,CM,UUA,VVA,UW,VW,HW,SWN,LHF,SHF,LWDNSRF, SWCOOL_(N) = MAPL_UNDEF BCOOL_ (N) = MAPL_UNDEF TDEL_ (N) = MAPL_UNDEF + TW (N) = TICE TWMTS (N) = 0.0 + TWMTF (N) = 0.0 QWARM_ (N) = MAPL_UNDEF SWWARM_(N) = MAPL_UNDEF PHIW_ (N) = MAPL_UNDEF @@ -253,6 +553,9 @@ subroutine SKIN_SST (DO_SKIN_LAYER,NT,CM,UUA,VVA,UW,VW,HW,SWN,LHF,SHF,LWDNSRF, end if end do + DELTC = 0.0 +! DELTC = TDROP_ ! This will cause non-zero diff in internal/checkpoint, but ZERO DIFF in OUTPUT. + end subroutine SKIN_SST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -586,4 +889,276 @@ subroutine SIMPLE_SW_ABS(USE_KPAR, depth, ZTH, SWN, PEN) end subroutine SIMPLE_SW_ABS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! !IROUTINE: SURFACE_FLUX_UPDATE - update using surface (atmospheric) fluxes only + +! !DESCRIPTION: +! Computes an update using surface fluxes from atmospheric model + +! !INTERFACE: + subroutine surf_hflux_update (NT,DO_SKIN_LAYER,DO_DATASEA,MUSKIN,DT,epsilon_d, & + CFT,CFQ,SH,EVAP,DSH,DEV,THATM,QHATM,PS,FRWATER,HW,SNO, & + LWDNSRF,SWN,ALW,BLW,SHF,LHF,EVP,DTS,DQS,TS,QS,TWMTS,TWMTF) + +! !ARGUMENTS: + + integer, intent(IN) :: NT ! number of tiles + integer, intent(IN) :: DO_SKIN_LAYER ! 0:No interface layer, 1:active, and accounts for change in SST + integer, intent(IN) :: DO_DATASEA ! 1:uncoupled (AGCM); 0:coupled (AOGCM) + real, intent(IN) :: MUSKIN ! exponent of temperature: T(z) profile in warm layer + real, intent(IN) :: DT ! time-step + real, intent(IN) :: epsilon_d ! (thickness of AOIL)/(thickness of OGCM top level), typically < 1. + + real, intent(IN) :: CFT(:) ! sensible heat transfer coefficient + real, intent(IN) :: CFQ(:) ! evaporation heat transfer coefficient + real, intent(IN) :: SH(:) ! upward_sensible_heat_flux + real, intent(IN) :: EVAP(:) ! evaporation + real, intent(IN) :: DSH(:) ! derivative_of_upward_sensible_heat_flux + real, intent(IN) :: DEV(:) ! derivative_of_evaporation + real, intent(IN) :: THATM(:) ! effective_surface_skin_temperature + real, intent(IN) :: QHATM(:) ! effective_surface_specific_humidity + real, intent(IN) :: PS(:) ! surface pressure + real, intent(IN) :: FRWATER(:) ! 1. - fr of sea ice + real, intent(IN) :: HW(:) ! mass of AOIL + real, intent(IN) :: SNO(:) ! snow fall + real, intent(IN) :: LWDNSRF(:) ! surface_downwelling_longwave_flux + real, intent(IN) :: SWN(:) ! shortwave radiation absorbed in AOIL + real, intent(IN) :: ALW(:) ! linearization_of_surface_upwelling_longwave_flux + real, intent(IN) :: BLW(:) ! linearization_of_surface_upwelling_longwave_flux + + real, intent(OUT) :: SHF (:) ! sensible heat flux + real, intent(OUT) :: LHF (:) ! latent heat flux + real, intent(OUT) :: EVP (:) ! evaporation `heat' flux + real, intent(OUT) :: DTS (:) ! change in skin temperature + real, intent(OUT) :: DQS (:) ! change in specific humidity + + real, intent(INOUT) :: TS (:) ! skin temperature + real, intent(INOUT) :: QS (:) ! specific humidity + real, intent(INOUT) :: TWMTS (:) ! "internal state" variable that has: TW - TS + real, intent(INOUT) :: TWMTF (:) ! "internal state" variable that has: TW - TF + +! !LOCAL VARIABLES + real :: SHD(NT), EVD(NT), QFLX(NT), DTX(NT), DTY + + EVP = CFQ* (EVAP + DEV * (QS-QHATM)) ! evaporation "flux" + SHF = CFT* (SH + DSH * (TS-THATM)) ! sensible heat flux + + SHD = CFT*DSH ! d (sensible heat flux)/d Ts + EVD = CFQ*DEV*GEOS_DQSAT(TS, PS, RAMP=0.0, PASCALS=.TRUE.) ! d (evap)/ d Ts + + QFLX = LWDNSRF - (ALW + BLW*TS) - SHF ! net longwave - sensible heat flux + + ! FR accounts for fraction of water/ice + DTX = DT*FRWATER / (MAPL_CAPWTR*HW) + + if (DO_SKIN_LAYER == 0) then + DTX = 0. + else + DTX = DTX*((MUSKIN+1.-MUSKIN*epsilon_d)/MUSKIN) ! note: epsilon_d is = 0. in uncoupled mode (DO_DATASEA == 1) + endif + + ! DTY accounts for ice on top of water. Part of Shortwave is absorbed by ice and rest goes to warm water. + ! skin layer only absorbs the portion of SW radiation passing thru the bottom of ice MINUS the portion passing thru the skin layer + ! Penetrated shortwave from sea ice bottom + associated ocean/ice heat flux + DTY = 0. ! Revisit above with CICE6 [Nov, 2019] and compute DTY = DT / (SALTWATERCAP*HW) * (PENICE * FI + FHOCN) + + DTS = DTX * ( QFLX + SWN - EVP*MAPL_ALHL - MAPL_ALHF*SNO ) + DTY ! add net SW, minus latent heat flux to QFLX. Keep DTY (=0) for ZERO DIFF in OUTPUT. + DTS = DTS / (1.0 + DTX*(BLW+SHD+EVD*MAPL_ALHL)) ! implicit solution for an update in temperature: DTS. Tnew = Told + DTS + + EVP = EVP + EVD * DTS ! update evaporation + SHF = SHF + SHD * DTS ! update sensible heat flux + LHF = EVP * MAPL_ALHL ! update latent heat flux + + ! update temperature, moisture and mass + TS = TS + DTS + DQS = GEOS_QSAT(TS, PS, RAMP=0.0, PASCALS=.TRUE.) - QS + QS = QS + DQS + + ! updated TS implies an update in TWMTS(=TW-TS) and TWMTF(=TW-TF) + if(DO_SKIN_LAYER == 0) then + TWMTS = 0. + TWMTF = 0. + else + TWMTS = TWMTS - (1.0/(MUSKIN+1.0))*DTS + if (DO_DATASEA == 0) then ! coupled mode + TWMTF = TWMTF + (MUSKIN/(1.+MUSKIN-MUSKIN*epsilon_d))*DTS + else ! uncoupled mode + TWMTF = 0. +! TWMTF = TWMTF + (MUSKIN/(1.+MUSKIN))*DTS ! This will cause non-zero diff in internal/checkpoint, but ZERO DIFF in OUTPUT. + end if + end if + + end subroutine surf_hflux_update +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! !IROUTINE: AOIL_V1 - version number: 1 of the Atmosphere Ocean Interface Layer (AOIL) + +! !DESCRIPTION: +! Wraps the sequence of steps involved in updating the internal (state) variables + +! !INTERFACE: + subroutine AOIL_v0 (NT, DO_SKIN_LAYER, DO_DATASEA, n_iter_cool, fr_ice_thresh, do_grad_decay, & + DT, MUSKIN, epsilon_d, MaxWaterDepth, MinWaterDepth, MaxSalinity, MinSalinity, & + STOKES_SPEED, CM, CFT, CFQ, SH, EVAP, DSH, DEV, THATM, QHATM, PS, SNO, RAIN, UUA, VVA, & + UW, VW, FRWATER, SWN, SWN_surf, PEN, PEN_ocean, LWDNSRF, ALW, BLW, & + HH_in, TS_in, SS_in, QS_in, TS_FOUND, & + DWARM, TBAR, USTARW, DCOOL, TDROP, SWCOOL, QCOOL, BCOOL, LCOOL, & + TDEL, SWWARM, QWARM, ZETA_W, PHIW, LANGM, TAUTW, uStokes, TXW, TYW, & + SHF, LHF, EVP, DTS, DQS, DELTC, HW, TW, SW, TWMTS, TWMTF, & + do_update_fluxes_AOIL_second_step) + +! !ARGUMENTS: + + integer, intent(IN) :: NT ! number of tiles + integer, intent(IN) :: DO_SKIN_LAYER ! 0: No interface layer, 1: active, and accounts for change in SST + integer, intent(IN) :: DO_DATASEA ! =1:uncoupled (AGCM); =0:coupled (AOGCM) + integer, intent(IN) :: n_iter_cool ! number of iterations to compute cool-skin layer + real, intent(IN) :: fr_ice_thresh ! threshold on ice fraction, sort of defines Marginal Ice Zone + + character(len=*), intent(IN) :: do_grad_decay ! simulate a gradual decay of diurnal warming? yes or no. Follows Zeng and Beljaars, 2005. + character(len=*), intent(IN) :: do_update_fluxes_AOIL_second_step ! update DTS, DQS, EVP, SHF, LHF after 2nd implicit update of temperature + + real, intent(IN) :: DT ! time-step + real, intent(IN) :: MUSKIN ! exponent of temperature: T(z) profile in warm layer + real, intent(IN) :: epsilon_d ! (thickness of AOIL)/(thickness of OGCM top level), typically < 1. + real, intent(IN) :: MaxWaterDepth ! maximum depth of AOIL + real, intent(IN) :: MinWaterDepth ! minimum depth of AOIL + real, intent(IN) :: MaxSalinity ! maximum salinity in AOIL + real, intent(IN) :: MinSalinity ! minimum salinity in AOIL + real, intent(IN) :: STOKES_SPEED ! scalar value set for Stokes speed- place holder for output from Wave model + + real, intent(IN) :: CM(:) ! transfer coefficient for wind + real, intent(IN) :: CFT(:) ! sensible heat transfer coefficient + real, intent(IN) :: CFQ(:) ! evaporation heat transfer coefficient + real, intent(IN) :: SH(:) ! upward_sensible_heat_flux + real, intent(IN) :: EVAP(:) ! evaporation + real, intent(IN) :: DSH(:) ! derivative_of_upward_sensible_heat_flux + real, intent(IN) :: DEV(:) ! derivative_of_evaporation + real, intent(IN) :: THATM(:) ! effective_surface_skin_temperature + real, intent(IN) :: QHATM(:) ! effective_surface_specific_humidity + real, intent(IN) :: PS(:) ! surface pressure + real, intent(IN) :: SNO(:) ! snow fall + real, intent(IN) :: RAIN(:) ! rain = PCU+PLS = liquid_water_convective_precipitation + liquid_water_large_scale_precipitation + real, intent(IN) :: UUA (:) ! zonal wind + real, intent(IN) :: VVA (:) ! meridional wind + real, intent(IN) :: UW (:) ! u-current + real, intent(IN) :: VW (:) ! v-current + + real, intent(IN) :: FRWATER(:) ! 1. - fr of sea ice + real, intent(IN) :: SWN(:) ! shortwave radiation absorbed in AOIL + real, intent(IN) :: SWN_surf(:) ! net shortwave radiation incident at surface + real, intent(IN) :: PEN (:) ! shortwave radiation that penetrates below interface layer + real, intent(IN) :: PEN_ocean(:) ! shortwave radiation that penetrates below top ocean model layer + real, intent(IN) :: LWDNSRF(:) ! surface_downwelling_longwave_flux + real, intent(IN) :: ALW (:) ! for linearized \sigma T^4 + real, intent(IN) :: BLW (:) ! for linearized \sigma T^4 + + real, intent(IN) :: TS_FOUND(:) ! bulk SST (temperature at base of warm layer) + + real, intent(OUT) :: DWARM (:) ! depth of AOIL + real, intent(OUT) :: TBAR (:) ! copy of TW (also internal state) to export out + real, intent(OUT) :: USTARW(:) ! u_{*,w} + real, intent(OUT) :: DCOOL (:) ! depth of cool-skin layer + real, intent(OUT) :: TDROP (:) ! temperature drop across cool-skin + real, intent(OUT) :: SWCOOL(:) ! shortwave radiation absorbed in cool-skin + real, intent(OUT) :: QCOOL (:) ! net heat flux in cool layer + real, intent(OUT) :: BCOOL (:) ! bouyancy in cool layer + real, intent(OUT) :: LCOOL (:) ! Saunder's parameter in cool layer + + real, intent(OUT) :: TDEL (:) ! temperature at top of warm layer + real, intent(OUT) :: SWWARM(:) ! shortwave radiation absorbed in warm layer + real, intent(OUT) :: QWARM (:) ! net heat flux in warm layer + real, intent(OUT) :: ZETA_W(:) ! stability parameter = dwarm/(Obukhov length) + real, intent(OUT) :: PHIW (:) ! similarity function + real, intent(OUT) :: LANGM (:) ! Langmuir number + real, intent(OUT) :: TAUTW (:) ! time-scale of relaxation to bulk SST (i.e., TS_FOUND) + real, intent(OUT) :: uStokes(:) ! Stokes speed + real, intent(OUT) :: TXW (:) ! zonal stress + real, intent(OUT) :: TYW (:) ! meridional stress + + real, intent(OUT) :: SHF (:) ! sensible heat flux + real, intent(OUT) :: LHF (:) ! latent heat flux + real, intent(OUT) :: EVP (:) ! evaporation `heat' flux + real, intent(OUT) :: DTS (:) ! change in skin temperature + real, intent(OUT) :: DQS (:) ! change in specific humidity + + real, intent(OUT) :: DELTC (:) ! "internal state" variable that has: TDROP_ + + real, intent(INOUT) :: HH_in(:) ! initial mass of AOIL, will be updated + real, intent(INOUT) :: TS_in(:) ! initial skin temperature, will be updated + real, intent(INOUT) :: SS_in(:) ! initial salinity * mass of AOIL, will be updated + real, intent(INOUT) :: QS_in(:) ! initial specific humidity, will be updated + + real, intent(INOUT) :: HW (:) ! "internal state" variable that has: HW (analog of HH) + real, intent(INOUT) :: TW (:) ! "internal state" variable that has: TW (analog of TS) + real, intent(INOUT) :: SW (:) ! "internal state" variable that has: SW (analog of SS) + real, intent(INOUT) :: TWMTS (:) ! "internal state" variable that has: TW - TS + real, intent(INOUT) :: TWMTF (:) ! "internal state" variable that has: TW - TF + +! !LOCAL VARIABLES + real :: SHD(NT), EVD(NT), TS0(NT), QS0(NT)!, HH0(NT), SS0(NT) + + TS0 = TS_in + QS0 = QS_in +! HH0 = HH_in +! SS0 = SS_in + +! Update TS, QS, DTS, DQS; fluxes (EVP, SHF, LHF), internals (TWMTS, TWMTF) due to surface fluxes from atmosphere +! --------------------------------------------------------------------------------------------------------------- + call surf_hflux_update (NT,DO_SKIN_LAYER,DO_DATASEA,MUSKIN,DT,epsilon_d, & + CFT,CFQ,SH,EVAP,DSH,DEV,THATM,QHATM,PS,FRWATER,HH_in,SNO, & + LWDNSRF,SWN,ALW,BLW,SHF,LHF,EVP,DTS,DQS,TS_in,QS_in,TWMTS,TWMTF) + +! Update mass of AOIL using fresh water flux from atmosphere +! ---------------------------------------------------------- + call AOIL_v0_HW (NT,DT,DO_DATASEA,MaxWaterDepth,MinWaterDepth, & + FRWATER,SNO,EVP,RAIN,HH_in) + +! Copy back to internal variables +! ------------------------------- + TW = TS_in + TWMTS + HW = HH_in + +! Update salinity +! --------------- + call AOIL_v0_S (DT,HW,SS_in,SW) + where (.not. (abs(UW) > 0.0 .or. abs(VW) > 0.0)) + SW = max(min(SW,MAXSALINITY),MINSALINITY) + endwhere + +! Cool-skin and diurnal warm layer, latter uses ocean variables (TS_FOUND) +! it updates temperatures: TS, TW, DELTC and differences: TWMTF, TWMTS but +! not the associated turbulent heat fluxes +! ------------------------------------------------------------------------ + call SKIN_SST (DO_SKIN_LAYER,DO_DATASEA,NT,CM,UUA,VVA,UW,VW,HW,SWN_surf,LHF,SHF,LWDNSRF, & + ALW,BLW,PEN,PEN_OCEAN,STOKES_SPEED,DT,MUSKIN,TS_FOUND,DWARM,TBAR,TXW,TYW,USTARW, & + DCOOL,TDROP,SWCOOL,QCOOL,BCOOL,LCOOL,TDEL,SWWARM,QWARM,ZETA_W, & + PHIW,LANGM,TAUTW,uStokes,TS_in,TWMTS,TWMTF,DELTC,TW,FRWATER,n_iter_cool, & + fr_ice_thresh,epsilon_d,do_grad_decay) + + +! Following updates variables/fluxes using the final temperature from cool-skin and warm-layer effects +! In coupled mode, this is really important +! ---------------------------------------------------------------------------------------------------- + if (trim(do_update_fluxes_AOIL_second_step) == 'yes') then + DTS = TS_in - TS0 ! final change in TS + DQS = GEOS_QSAT(TS_in, PS, RAMP=0.0, PASCALS=.TRUE.) - QS0 ! final change in QS + QS_in= QS0 + DQS +! DHH = HW - HH0 +! DSS = SW - SS0 + +! Updating variables in a sequence of two (implicit) updates is not desirable, as one can see, +! DSH and DEV are _out of sync_. The next version of AOIL will implement a single implicit update +! ----------------------------------------------------------------------------------------------- + SHD = CFT*DSH ! d (sensible heat flux)/d Ts + EVD = CFQ*DEV*GEOS_DQSAT(TS_in, PS, RAMP=0.0, PASCALS=.TRUE.) ! d (evap)/ d Ts + EVP = EVP + EVD * DTS ! update evaporation + SHF = SHF + SHD * DTS ! update sensible heat flux + LHF = EVP * MAPL_ALHL ! update latent heat flux + endif + + end subroutine AOIL_v0 +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + end module atmOcnIntlayer diff --git a/GEOS_Shared/lightning_toolbox_mod.F90 b/GEOS_Shared/lightning_toolbox_mod.F90 deleted file mode 100644 index 424add9a..00000000 --- a/GEOS_Shared/lightning_toolbox_mod.F90 +++ /dev/null @@ -1,1148 +0,0 @@ -!------------------------------------------------------------------------------ -! Harvard-NASA Emissions Component (HEMCO) ! -!------------------------------------------------------------------------------ -!BOP -! -! !MODULE: lightning_toolbox_mod.F90 -! -! !DESCRIPTION: Module lightning\_toolbox\_mod.F90 is a wrapper module -! that contains routines to compute lightning flash rates as used by -! HEMCO. It has no dependencies and can thus also be used outside of -! HEMCO. -!\\ -!\\ -! References: -! \begin{itemize} -! \item Murray, L. T., Jacob, D. J., Logan, J. A., Hudman, R. C., and -! Koshak, W. J.: \emph{Optimized regional and interannual variability -! of lightning in a global chemical transport model con- strained -! by LIS/OTD satellite data}, \underline{J. Geophys. Res.}, -! Atmospheres, 117, 2012. -! \item Ott, L. E., K. E. Pickering, G. L. Stenchikov, D. J. Allen, -! A. J. DeCaria, B. Ridley, R.-F. Lin, S. Lang, and W.-K. Tao, -! \emph{Production of lightning NOx and its vertical distribution -! calculated from three-dimensional cloud-scale chemical transport -! model simulations}, \underline{J. Geophys. Res.}, 115, D04301, 2010. -! \end{itemize} -! -! !INTERFACE: -! -MODULE Lightning_Toolbox_Mod -! -! !USES: -! - IMPLICIT NONE - PRIVATE -! -! !PUBLIC MEMBER FUNCTIONS: -! - PUBLIC :: CalcFlashRate - PUBLIC :: LightDist -! -! !PRIVATE MEMBER FUNCTIONS: -! - PRIVATE :: FLASHES_CTH - PRIVATE :: GET_IC_CG_RATIO -! -! !PUBLIC DATA MEMBERS: -! -! !REVISION HISTORY: -! 14 Apr 2004 - L. Murray, R. Hudman - Initial version -! 10 Jun 2019 - C. Keller - Separated flash rate calculation from -! hcox_lightnox_mod.F90 -!EOP -!------------------------------------------------------------------------------ -!BOC -! -! !DEFINED PARAMETERS: -! - INTEGER, PARAMETER :: hp = KIND( REAL( 0.0, 8 ) ) - - ! Parameter for LFR calculation - REAL*8, PARAMETER :: RFLASH_MIDLAT = 3.011d26 ! 500 mol/flash - REAL*8, PARAMETER :: RFLASH_TROPIC = 1.566d26 ! 260 mol/flash - REAL*8, PARAMETER :: EAST_WEST_DIV = -30d0 - REAL*8, PARAMETER :: WEST_NS_DIV = 35d0 - REAL*8, PARAMETER :: EAST_NS_DIV = 35d0 - REAL*8, PARAMETER :: T_NEG_BOT = 273.0d0 ! 0 C - REAL*8, PARAMETER :: T_NEG_CTR = 258.0d0 ! -15 C - REAL*8, PARAMETER :: T_NEG_TOP = 233.0d0 ! -40 C - REAL*8, PARAMETER :: Rdg0 = 287.0e+0_hp / 9.80665e+0_hp ! Rd/g0 - -CONTAINS -!EOC -!------------------------------------------------------------------------------ -! Harvard-NASA Emissions Component (HEMCO) ! -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: CalcFlashRate -! -! !DESCRIPTION: Subroutine CalcFlashRate computes the flash rate as described -! in Murray et al. 2012. -!\\ -!\\ -! !INTERFACE: -! - SUBROUTINE CalcFlashRate( am_I_Root, IM, JM, LM, AREA_M2, LWI2D, & - OTDLIS2D, XMID2D, YMID2D, TK3D, PEDGE3D, & - BXHEIGHT3D, CNVMFC3D, BYNCY3D, CNVFRC2D, & - LCNVFRC, OTD_LIS_SCALE, LNOX2D, LFR2D, IC2D, & - CG2D, LTOP2D, H02D, RC ) -! -! !USES: -! -! -! !INPUT PARAMETERS: -! - LOGICAL, INTENT(IN ) :: am_I_Root ! Root CPU? - INTEGER, INTENT(IN ) :: IM, JM, LM ! # of x,y,z levels - REAL(hp), INTENT(IN ) :: AREA_M2(IM,JM) ! Surface area in m2 - INTEGER, INTENT(IN ) :: LWI2D(IM,JM) ! 0=land, 1=water, 2=ice - REAL(hp), INTENT(IN ) :: OTDLIS2D(IM,JM) ! OTD-LIS redistribution factor. Ignored if negative. - REAL(hp), INTENT(IN ) :: XMID2D(IM,JM) ! Grid box longitude (degrees) - REAL(hp), INTENT(IN ) :: YMID2D(IM,JM) ! Grid box latitude (degrees) - REAL(hp), INTENT(IN ) :: TK3D(IM,JM,LM) ! Air temperature (Kelvin) - REAL(hp), INTENT(IN ) :: PEDGE3D(IM,JM,LM+1) ! Pressure edges (Pa) - REAL(hp), INTENT(IN ) :: BXHEIGHT3D(IM,JM,LM) ! Grid box heights (m) - REAL(hp), INTENT(IN ) :: CNVMFC3D(IM,JM,LM+1) ! convective cloud mass flux (kg/m2/s) - REAL(hp), INTENT(IN ) :: BYNCY3D(IM,JM,LM) ! buoyancy (ms-2) - REAL(hp), INTENT(IN ) :: CNVFRC2D(IM,JM) ! convective fraction (unitless) - LOGICAL , INTENT(IN ) :: LCNVFRC ! determine H0 from convective fraction and buoyancy? - REAL(hp), INTENT(IN ) :: OTD_LIS_SCALE ! Global LFR scale factor -! -! !INPUT/OUTPUT PARAMETERS: -! - INTEGER, INTENT(INOUT) :: RC ! Return code (0=success, 1=fail) -! -! !OUTPUT PARAMETERS: -! - REAL(hp), INTENT( OUT) :: LNOX2D(IM,JM) ! Total lightning NOx molecules per 6 hours - REAL(hp), INTENT( OUT) :: LFR2D(IM,JM) ! Flash rate (flashes/min/km2) - REAL(hp), INTENT( OUT) :: IC2D(IM,JM) ! Intra-cloud flash rate (flashes/min/km2) - REAL(hp), INTENT( OUT) :: CG2D(IM,JM) ! Cloud-to-ground flash rate (flashes/min/km2) - INTEGER, INTENT( OUT) :: LTOP2D(IM,JM) ! Lightning top level - REAL(hp), INTENT( OUT) :: H02D(IM,JM) ! Convective cloud top height (m) -! -! !REVISION HISTORY: -! 10 May 2006 - L. Murray - Initial version -! 10 Jun 2019 - C. Keller - Separated flash rate calculation from -! subroutine LIGHTNOX in hcox_lightnox_mod.F90 -! 8 Aug 2019 - M. Damon - Put flash rate routine into GMAO Shared. -! Wrapper routine from "Lightning_mod.F90" -!EOP -!------------------------------------------------------------------------------ -!BOC -! -! !LOCAL VARIABLES: -! - INTEGER :: I, J, L, LCHARGE - INTEGER :: LMAX, LTOP, LBOTTOM, A_KM2 - INTEGER :: LTOP1, LTOP2 - REAL*8 :: XMID, YMID, CC, DLNP - REAL*8 :: DZ, FLASHRATE, H0, HBOTTOM - REAL*8 :: HCHARGE, IC_CG_RATIO, Z_CG, ZUP - REAL*8 :: RATE_SAVE, REDIST, T1, T2 - REAL*8 :: TOTAL, TOTAL_CG, TOTAL_IC, X - REAL*8 :: P1, P2, P3, RATE - REAL*8 :: Z_IC - INTEGER :: SFCTYPE - - !================================================================= - ! CalcFlasRate begins here! - !================================================================= - - ! Assume success - RC = 0 - -! print*, "Hola from HEMCO lightning: ", IM, JM, LM, am_I_Root -! print*, "HEMCO surface area: ", minval(AREA_M2), maxval(AREA_M2) -! print*, "HEMCO LWI: ", minval(LWI2D), maxval(LWI2D) -! print*, "HEMCO TROPP: ", minval(TROPP2D), maxval(TROPP2D) -! print*, "HEMCO OTDLIS2D: ", minval(OTDLIS2D), maxval(OTDLIS2D) -! print*, "HEMCO lon: ", minval(XMID2D), maxval(XMID2D) -! print*, "HEMCO lat: ", minval(YMID2D), maxval(YMID2D) -! print*, "HEMCO Temp: ", minval(TK3D), maxval(TK3D) -! print*, "HEMCO Pedge: ", minval(PEDGE3D), maxval(PEDGE3D) -! print*, "HEMCO box height: ", minval(BXHEIGHT3D), maxval(BXHEIGHT3D) -! print*, "HEMCO CNVMFC: ", minval(CNVMFC3D), maxval(CNVMFC3D) -! print*, "HEMCO buoyancy: ", minval(BYNCY3D), maxval(BYNCY3D) -! print*, "HEMCO CNVFRC2D: ", minval(CNVFRC2D), maxval(CNVFRC2D) -! print*, "HEMCO LCNVFRC: ", LCNVFRC -! print*, "HEMCO OTD_LIS_SCALE: ", OTD_LIS_SCALE - - - ! Reset arrays - LNOX2D = 0.0_hp - LFR2D = 0.0_hp - IC2D = 0.0_hp - CG2D = 0.0_hp - H02D = 0.0_hp - LTOP2D = 0 - - - ! LMAX: the highest L-level to look for lightnox (usually LLPAR-1) - LMAX = LM - 1 - - !================================================================= - ! Compute flashrate for each (I,J) column - !================================================================= - -!$OMP PARALLEL DO & -!$OMP DEFAULT( SHARED ) & -!$OMP PRIVATE( I, J, L, A_KM2 ) & -!$OMP PRIVATE( LCHARGE, P1, P2, XMID, YMID ) & -!$OMP PRIVATE( T1, T2, DLNP, DZ, P3 ) & -!$OMP PRIVATE( ZUP, HCHARGE, LTOP, H0, Z_CG ) & -!$OMP PRIVATE( Z_IC, LBOTTOM, HBOTTOM, CC, FLASHRATE ) & -!$OMP PRIVATE( IC_CG_RATIO, RATE ) & -!$OMP PRIVATE( X, TOTAL_IC, TOTAL_CG, TOTAL, REDIST ) & -!$OMP PRIVATE( RATE_SAVE, SFCTYPE ) & -!$OMP PRIVATE( LTOP1, LTOP2 ) & -!$OMP SCHEDULE( DYNAMIC ) - - ! Loop over surface boxes - DO J = 1, JM - DO I = 1, IM - - ! Grid box surface area in [km2] - A_KM2 = AREA_M2( I, J ) / 1d6 - - ! Grid box latitude and longitude [degrees] - YMID = YMID2D( I, J ) - XMID = XMID2D( I, J ) - - ! Make sure xmid is between -180 and +180 - IF ( XMID >= 180.0_hp ) XMID = XMID - 360.0_hp - - ! Get surface type. Note that these types are different than - ! the types used elsewhere: 0 = land, 1=water, 2=ice! - SFCTYPE = LWI2D(I,J) - - ! Initialize - LBOTTOM = 0 - LCHARGE = 0 - CC = 0d0 - HCHARGE = 0d0 - HBOTTOM = 0d0 - TOTAL = 0d0 - TOTAL_IC = 0d0 - TOTAL_CG = 0d0 - RATE = 0d0 - H0 = 0d0 - IC_CG_RATIO = 0d0 - - ! Get factors for OTD-LIS local redistribution or none. - ! This constrains the seasonality and spatial distribution - ! of the parameterized lightnox to match the HRMC v2.2 - ! product from LIS/OTD, while still allowing the model to - ! place lightnox locally within deep convective events. - ! (ltm, bmy, 1/31/07) - REDIST = OTDLIS2D(I,J) - IF ( REDIST < 0.0d0 ) THEN - REDIST = 1.0d0 - ENDIF - - !=========================================================== - ! (1) FIND NEGATIVE CHARGE LAYER - ! - ! LCHARGE is the L-value where the negative charge layer is - ! found. According to Williams (1985), the negative charge - ! layer occurs where T is between 0 C and -40 C. The - ! original model code set this at -10 C, but according to - ! Houze (1993), a good proxy for the negative charge layer - ! maximum density is at -15 C. - ! - ! Also of interest for later, will be the bottom of the - ! negative charge layer (i.e., temp = 0 C) in calculating - ! the cold cloud depth. - ! - ! If LCHARGE=1, then it is too cold to have water droplets - ! in the column, so there will be no lightnox events, - ! and we go to the next (I,J) box. - ! - ! (ltm, bmy, 5/10/06, 12/11/06) - !=========================================================== - - ! Find negative charge layer - DO L = 1, LMAX - - IF ( TK3D(I,J,L) <= T_NEG_CTR ) THEN - LCHARGE = L - EXIT - ENDIF - ENDDO - - ! Error check LCHARGE - LCHARGE = MIN(LCHARGE,LMAX) - - - IF ( LCHARGE > 1 ) THEN - - - - !----------------------------------------------------------- - ! (1a) Define more quantities - !----------------------------------------------------------- - - ! Pressure [Pa] at the centers of grid - ! boxes (I,J,LCHARGE-1) and (I,J,LCHARGE) - ! Now calculate from grid edges (ckeller, 10/06/2014) - P1 = ( PEDGE3D(I,J,LCHARGE-1) & - + PEDGE3D(I,J,LCHARGE ) ) / 2.0_hp - P2 = ( PEDGE3D(I,J,LCHARGE ) & - + PEDGE3D(I,J,LCHARGE+1) ) / 2.0_hp - - ! Temperatures [K] at the centers of grid - ! boxes (I,J,LCHARGE-1) and (I,J,LCHARGE) - T1 = TK3D(I,J,LCHARGE-1) - T2 = TK3D(I,J,LCHARGE ) - - ! DZ is the height [m] from the center of box (I,J,LCHARGE-1) - ! to the negative charge layer. It may be found in either - ! the (LCHARGE)th sigma layer or the (LCHARGE-1)th layer. - ! We use the hypsometric eqn to find the distance between - ! the center of (LCHARGE)th and (LCHARGE-1)th boxes, then - ! assume a linear temp distribution to scale between the two. - DLNP = LOG( P1 / P2 ) / ( T1 - T2 ) * ( T1 - T_NEG_CTR ) - DZ = Rdg0 * ( ( T1 + T2 ) / 2d0 ) * DLNP - - ! Pressure [Pa] at the bottom edge of box (I,J,LCHARGE), - ! or, equivalently, the top edge of box (I,J,LCHARGE-1). - P3 = PEDGE3D( I, J, LCHARGE ) - - ! Height [m] from the center of grid box (I,J,LCHARGE-1) - ! to the top edge of grid box (I,J,LCHARGE-1) - ZUP = Rdg0 * T1 * LOG( P1 / P3 ) - - !----------------------------------------------------------- - ! (1b) HCHARGE is the height of the negative charge layer - ! above the bottom edge of box (I,J,LCHARGE). - ! - ! If DZ < ZUP, then DZ is in grid box (I,J,LCHARGE-1); - ! therefore subtract 1 from LCHARGE and compute HCHARGE - ! accordingly. - ! - ! In this case, please note that BXHEIGHT(I,J,LCHARGE)-ZUP - ! is the distance from the bottom edge of the grid box to - ! the center of the newly defined (LCHARGE)th layer. - !----------------------------------------------------------- - IF ( DZ >= ZUP ) THEN - HCHARGE = DZ - ZUP - ELSE - LCHARGE = LCHARGE - 1 - HCHARGE = (BXHEIGHT3D(I,J,LCHARGE)-ZUP) + DZ - ENDIF - - !=========================================================== - ! (2) COMPUTE CONVECTIVE CLOUD TOP HEIGHT - ! - ! LTOP is the L-layer where the convective cloud top is - ! found. The cloud top is located at the highest sigma - ! level for which the cloud mass flux is nonzero. Since - ! GMAO cloud mass flux is defined at the top of each sigma - ! level, the convective cloud top is located at the top - ! edge of layer LTOP. - ! - ! For lightnox to exist, the cloud must straddle the - ! negative charge layer (in other words, at the very - ! minimum, the cloud bottom must occur in the LCHARGEth - ! layer). If LTOP < LCHARGE go to the next (I,J) location. - ! - ! Additionally, because the negative charge layer extends - ! from 0 C to around -40 C (Williams 1985), any cloud type - ! heights that are not colder than -40 C will be considered - ! unable to create the necessary dipole. Therefore, if - ! T(I,J,LTOP) >= -40 C, go to the next (I,J) location. - ! - ! To be easily translatable to an ESMF environment, we now - ! use the convective cloud mass flux to determine LTOP. - ! Use the same definition as used in GEOS-Chem. - ! - ! (ltm, bmy, 5/10/06, 12/11/06) - ! - ! GEOS-FP turns off convection in grid boxes where vertical - ! transport is explicitly resolved. The convective mass flux - ! (which is computed within the convection code) is then zero - ! in these grid boxes, even though convection did occur at - ! these places. - ! This may become increasingly relevant as GEOS-FP operates - ! at even higher resolutions. - ! If available, also determine cloud top height from - ! buoyancy and the convective fraction. Define it as the - ! highest level with non-negative buoyancy and for columns - ! with non-zero convective fraction (ckeller, 3/04/16). - !=========================================================== - - ! 'Traditional definition of cloud top level - LTOP1 = 1 - DO L = LM, 1, -1 - IF ( CNVMFC3D(I,J,L) > 0.0_hp ) THEN - LTOP1 = L + 1 - EXIT - ENDIF - ENDDO - - ! To determine cloud top height from buoyancy for all grid - ! boxes with non-zero convective fraction (define cloud top - ! as top level with positive buoyancy). - LTOP2 = 0 - IF ( LCNVFRC ) THEN - IF ( CNVFRC2D(I,J) > 0.0_hp ) THEN - DO L = LM, 1, -1 - IF ( BYNCY3D(I,J,L) >= 0.0_hp ) THEN - LTOP2= L + 1 - EXIT - ENDIF - ENDDO - ENDIF - ENDIF - - ! Take whichever value is higher - LTOP = MAX(LTOP1,LTOP2) - - !---------------------------------------------------------------- - ! Error checks for LTOP - !---------------------------------------------------------------- - - ! Error check LTOP - !IF ( LTOP == 0 ) CYCLE - IF ( LTOP > 0 ) THEN - - - - ! Error check LTOP as described above - IF ( LTOP > LMAX ) LTOP = LMAX - IF ( LTOP >= LCHARGE ) THEN - - ! Diagnose used LTOP - LTOP2D(I,J) = LTOP - - ! H0 is the convective cloud top height [m]. This is the - ! distance from the surface to the top edge of box (I,J,LTOP). - H0 = SUM(BXHEIGHT3D(I,J,1:LTOP)) - - ! Z_CG is the cloud-ground path (ground --> HCHARGE) [m] - Z_CG = SUM(BXHEIGHT3D(I,J,1:LCHARGE-1)) + HCHARGE - - ! Z_IC is the intra-cloud path (HCHARGE --> cloud top) [m] - Z_IC = SUM(BXHEIGHT3D(I,J,LCHARGE:LTOP)) - HCHARGE - - !=========================================================== - ! (3) COMPUTE COLD CLOUD THICKNESS - ! - ! Find the cold cloud thickness (CC) -- the distance from - ! where the temperature is 0 C up to the top of the cloud. - ! This is necessary for calculating the f_CG/f_IC ratio as - ! per Price and Rind 1993. - ! - ! This is a clone of the method above to find height to - ! HCHARGE, and we can recycle many of the same variables - ! that aren't used again. - ! - ! Grid box (I,J,LBOTTOM) is the model layer where the - ! temperature of the cloud is 0C. - ! - ! NOTE: If no temperature in the column is above 0 C, it - ! moves on to the next (I,J) box as before with the -15 C. - ! - ! (ltm, bmy, 5/10/06, 12/11/06) - !=========================================================== - - ! Find the level where T = 0 C - DO L = 1, LMAX - IF ( TK3D(I,J,L) <= T_NEG_BOT ) THEN - LBOTTOM = L - EXIT - ENDIF - ENDDO - - ! Error check LBOTTOM as described above - LBOTTOM = MIN(LBOTTOM,LMAX) - IF ( LBOTTOM > 1 ) THEN - - - - !----------------------------------------------------------- - ! (3a) Define more quantities - !----------------------------------------------------------- - - ! Pressure [Pa] at the centers of grid - ! boxes (I,J,LBOTTOM-1) and (I,J,LBOTTOM) - ! Now calculate from grid edges (ckeller, 10/06/2014) - P1 = ( PEDGE3D(I,J,LBOTTOM-1) & - + PEDGE3D(I,J,LBOTTOM ) ) / 2.0_hp - P2 = ( PEDGE3D(I,J,LBOTTOM ) & - + PEDGE3D(I,J,LBOTTOM+1) ) / 2.0_hp - - ! Temperature [K] at the centers of grid - ! boxes (I,J,LBOTTOM-1) and (I,J,LBOTTOM) - T1 = TK3D(I,J,LBOTTOM-1) - T2 = TK3D(I,J,LBOTTOM ) - - ! DZ is the height [m] from the center of box (I,J,LCHARGE-1) - ! to the negative charge layer. It may be found in either - ! the (LCHARGE)th sigma layer or the (LCHARGE-1)th layer. - ! We use the hypsometric eqn to find the distance between - ! the center of (LCHARGE)th and (LCHARGE-1)th boxes, then - ! assume a linear temp distribution to scale between the two. - DLNP = LOG( P1 / P2 ) / ( T1 - T2 ) * ( T1 - T_NEG_BOT ) - DZ = Rdg0 * ( ( T1 + T2 ) / 2d0 ) * DLNP - - ! Pressure [Pa] at the bottom edge of box (I,J,LBOTTOM), - ! or, equivalently, the top edge of box (I,J,BOTTOM-1). - P3 = PEDGE3D( I, J, LBOTTOM ) - - ! Height [m] from the center of grid box (I,J,LBOTTOM-1) - ! to the top edge of grid box (I,J,LBOTTOM-1) - ZUP = Rdg0 * T1 * LOG( P1 / P3 ) - - !----------------------------------------------------------- - ! (3b) HBOTTOM is the height of the 0 C layer above the - ! bottom edge of box (I,J,LBOTTOM). - ! - ! If DZ < ZUP, then DZ is in grid box (I,J,LBOTTOM-1); - ! therefore subtract 1 from LBOTTOM and compute HBOTTOM - ! accordingly. - ! - ! In this case, please note that BXHEIGHT(I,J,LBOTTOM)-ZUP - ! is the distance from the bottom edge of the grid box to - ! the center of the newly defined (LBOTTOM)th layer. - !----------------------------------------------------------- - IF ( DZ >= ZUP ) THEN - HBOTTOM = DZ - ZUP - ELSE - LBOTTOM = LBOTTOM - 1 - HBOTTOM = (BXHEIGHT3D(I,J,LBOTTOM) - ZUP) + DZ - ENDIF - - ! Cold cloud thickness is difference of cloud top - ! height (H0) and the height to the bottom. - CC = H0 - SUM(BXHEIGHT3D(I,J,1:LBOTTOM-1) ) - HBOTTOM - - !=========================================================== - ! (4) COMPUTE IC/CG FLASH_RATIO FROM COLD-CLOUD DEPTH - ! - ! This is necessary as an input for the MFLUX and PRECON - ! parameterizations, as well as for determining the fraction - ! of LNOX generated by either type of flash, and will - ! eventually be used for separate vertical distributions - ! when they become available. (ltm, bmy, 12/11/06) - !=========================================================== - - ! Get Inter-Cloud/Cloud-Ground flash ratio [unitless] - IC_CG_RATIO = GET_IC_CG_RATIO( CC ) - - !=========================================================== - ! (5) COMPUTE LIGHTNOX FLASH RATES - ! - ! Now that we have computed the the ratio of intra-cloud - ! flashes to cloud-ground flashes, compute the lightnox - ! flash rate via one of these parameterizations: - ! - ! (a) Cloud top height (CTH) - ! (b) Mass flux (MFLUX) - ! (c) Convective Precpitation (PRECON) - ! - ! (ltm, bmy, 5/10/06, 12/11/06) - !=========================================================== - - !-------------------------------------------------------- - ! (5a) CLOUD TOP HEIGHT PARAMETERIZATION (all met fields) - ! - ! Based on Price & Rind [1992,1993,1994]. - !-------------------------------------------------------- - - ! Get lightnox flash rate per minute and IC/CG ratio - CALL FLASHES_CTH( I, J, H0, FLASHRATE, SFCTYPE ) - - !=========================================================== - ! (6) COMPUTE TOTAL LNOx AND PARTITION INTO VERTICAL LAYERS - ! - ! (6a) We convert FLASHRATE (computed above) to units of - ! [flashes/6h] and store in the RATE variable. - ! - ! We then multiply RATE by a scale factor based on - ! OTD/LIS observations. This is necessary in order to make - ! sure that the lightnox flashes happen in the correct - ! locations as diagnosed by OTD/LIS satellite observations. - ! There are two redistribution options: - ! - ! (1) Apply regional scale factors based on OTD/LIS - ! observations (method of L. Jourdain et al) - ! - ! (2) Apply box-by-box scale scale factors based on - ! OTD/LIS observations (method of B. Sauvage) - ! - ! NOTE: As of 3/27/07, only method (1) is implemented. - ! - ! (6b) We then compute X, which is the ratio - ! [cloud-ground flashes / total flashes]. - ! - ! The amount of lightnox released will depend whether we - ! are in the tropics or in mid-latitudes. - ! - ! - ! (6c) LIGHTNOX NOx EMISSIONS IN THE TROPICS: - ! ---------------------------------------------------------- - ! N. American / S. American tropics: lat <= 23 N - ! African / Oceanian / Eurasian tropics: lat <= 35 N - ! - ! The lightnox NOx released in the inter-cloud (IC) and - ! cloud-ground (CG) paths are given by: - ! - ! TOTAL_IC = RFLASH_TROPIC * RATE * (1-X) * Z_IC - ! TOTAL_CG = RFLASH_TROPIC * RATE * ( X) * Z_CG - ! - ! where: - ! RFLASH_TROPIC = # of NOx molecules released per flash - ! per meter (same as in previous code) - ! RATE = lightnox flashes / 6h computed above - ! Z_IC = IC pathway in meters (from the negative - ! cloud layer to the cloud top) - ! Z_CG = CG pathway in meters (from the negative - ! cloud layer to the ground surface) - ! - ! We also apply a top-down final global scaling factor, - ! calculated by previously bringing total global LNOx to - ! 6 Tg N/yr (2x2.5: 0.3683, 4x5: 0.8996). In 2004, the - ! tropics-only contribution to LNOx was 4.5379 Tg N. - ! - ! - ! (6d) LIGHTING NOx EMISSIONS AT MIDLATITUDES: - ! ---------------------------------------------------------- - ! N. American midlatitudes : lat > 23N - ! Eurasian midlatitudes : lat > 35N - ! - ! The lightnox NOx released at midlatitudes is independent - ! of path length. Thus: - ! - ! TOTAL_IC = RFLASH_MIDLAT * RATE * (1-X) * MID_LAT_SCALE - ! TOTAL_CG = RFLASH_MIDLAT * RATE * X * MID_LAT_SCALE - ! - ! where - ! RFLASH_MIDLAT = # of NOx molecules released per flash - ! per meter (based on 500 mol/flash) - ! RATE = lightnox flashes / 6h computed above - ! Z_IC = IC pathway in meters (from the negative - ! cloud layer to the cloud top) - ! Z_CG = CG pathway in meters (from the negative - ! cloud layer to the ground surface) - ! - ! We now emit at the Northern Mid-latitudes using an RFLASH - ! value of 500 mol/flash. This is independent of path - ! length. - ! - ! NOTE: The OTD-LIS local redistribution method was expanded - ! upon from Sauvage et al, 2007, ACP. - ! http://www.atmos-chem-phys.net/7/815/2007/acp-7-815-2007.pdf - ! - ! (6e) The total lightnox is the sum of IC+CG paths: - ! TOTAL = TOTAL_IC + TOTAL_CG - ! - ! (6g) We then partition the NOx into each of the vertical - ! grid boxes within the column with a Ken Pickering PDF - ! (see comments below). - ! - ! (ltm, rch, bmy, 5/10/06, 3/27/07) - !=========================================================== - - !----------------------------------------------------------- - ! (6a) Compute flash rate and apply OTD/LIS redistribution - !----------------------------------------------------------- - - ! Convert [flashes/min] to [flashes/6h] - RATE = FLASHRATE * 360.0d0 - - - ! Apply regional or local OTD-LIS redistribution so that the - ! flashes occur in the right place. - RATE = RATE * REDIST - - ! Apply scaling factor to make sure annual average flash rate - ! equals that of the climatology. (ltm, 09/24/07) - RATE = RATE * OTD_LIS_SCALE - - END IF ! LBOTTOM > 1 - END IF ! LTOP >= LCHARGE - END IF ! LTOP > 0 - END IF ! LCHARGE > 1 - - - - ! Do not allow flash density to become unrealistically high - ! Globally limit the flash rate to its highest observed value - ! of 4.2e-3 flashes / km2 / s from the ENTLN global product - ! (ltm, mps, 8/9/18) - IF ( ( RATE / 21600. / A_KM2 ) > 0.004177159 ) THEN - RATE = 0.004177159 * 21600. * A_KM2 - END IF - - ! Ratio of cloud-to-ground flashes to total # of flashes - X = 1d0 / ( 1d0 + IC_CG_RATIO ) - - ! Compute LNOx emissions for tropics or midlats - IF ( XMID > EAST_WEST_DIV ) THEN - - !-------------------------------------------------------- - ! (6c,6d) We are in EURASIA - !-------------------------------------------------------- - IF ( YMID > EAST_NS_DIV ) THEN - - - ! 6d: Eurasian Mid-Latitudes - TOTAL_IC = RFLASH_MIDLAT * RATE * ( 1d0 - X ) - TOTAL_CG = RFLASH_MIDLAT * RATE * X - ELSE - - ! 6c: Eurasian Tropics - TOTAL_IC = RFLASH_TROPIC * RATE * ( 1d0 - X ) - TOTAL_CG = RFLASH_TROPIC * RATE * X - - ENDIF - - ELSE - - !-------------------------------------------------------- - ! (6c,6d) We are in the AMERICAS - !-------------------------------------------------------- - IF ( YMID > WEST_NS_DIV ) THEN - - ! 6d: American Mid-Latitudes - TOTAL_IC = RFLASH_MIDLAT * RATE * ( 1d0 - X ) - TOTAL_CG = RFLASH_MIDLAT * RATE * X - - ELSE - - ! 6c: American Tropics - TOTAL_IC = RFLASH_TROPIC * RATE * ( 1d0 - X ) - TOTAL_CG = RFLASH_TROPIC * RATE * X - - ENDIF - ENDIF - - !----------------------------------------------------------- - ! (6e) Compute total lightnox - !----------------------------------------------------------- - - ! Sum of IC + CG [molec/6h] - LNOX2D(I,J) = TOTAL_IC + TOTAL_CG - - ! Convert to flashes per minute per km2 - LFR2D(I,J) = RATE / A_KM2 / 360.0_hp - - ! IC flash rate - IC2D(I,J) = RATE * ( 1d0 - X ) / A_KM2 / 360.0_hp - - ! CG flash rates - CG2D(I,J) = RATE * X / A_KM2 / 360.0_hp - - ! Convective cloud top height in meters - H02D(I,J) = H0 - - ENDDO - ENDDO -!$OMP END PARALLEL DO - - ! Return with success - RC = 0 - - END SUBROUTINE CalcFlashRate -!EOC -!------------------------------------------------------------------------------ -! Harvard-NASA Emissions Component (HEMCO) ! -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: Flashes_CTH -! -! !DESCRIPTION: Subroutine Flashes\_CTH determines the rate of lightnox -! flashes per minute based on the height of convective cloud tops, and the -! intra-cloud to cloud-ground strike ratio. -!\\ -!\\ -! !INTERFACE: -! - SUBROUTINE Flashes_CTH( I, J, HEIGHT, FLASHRATE, SFCTYPE ) -! -! !INPUT PARAMETERS: -! - INTEGER, INTENT(IN) :: I ! Longitude index - INTEGER, INTENT(IN) :: J ! Latitude index - REAL*8, INTENT(IN) :: HEIGHT ! Height of conv cloud top [m] - INTEGER, INTENT(IN) :: SFCTYPE ! Surface type (0=land, 1=water, 2=ice) -! -! !OUTPUT PARAMETERS: -! - REAL*8, INTENT(OUT) :: FLASHRATE ! LightNOX flash rate [flashes/min] -! -! !REVISION HISTORY: -! 10 May 2006 - L. Murray - Initial version -! (1 ) Subroutine renamed from FLASHES (ltm, bmy, 5/10/06) -! (2 ) Remove CCTHICK, IC_CG_RATIO as arguments. Remove computation of -! IC_CG_RATIO and move that to GET_IC_CG_RATIO. (ltm, bmy, 12/11/06) -! (3 ) Remove the near-land formulation (i.e. use function IS_LAND -! instead of IS_NEAR).(ltm, bmy, 9/24/07) -! 10 Nov 2010 - R. Yantosca - Added ProTeX headers -! 22 Oct 2013 - C. Keller - Now a HEMCO extension. -! 10 Jun 2019 - C. Keller - Moved to ligthning_toolbox_mod.F90 -!EOP -!------------------------------------------------------------------------------ -!BOC - !================================================================ - ! FLASHES_CTH begins here! - ! - ! COMPUTE LIGHTNOX FLASH RATE / MINUTE - ! - ! Price & Rind (1992) give the following parameterizations for - ! lightnox flash rates as a function of convective cloud top - ! height [km]: - ! - ! FLAND = 3.44e-5 * ( CLDTOP HEIGHT [km] ^ 4.9 ) - ! FOCEAN = 6.4e-4 * ( CLDTOP HEIGHT [km] ^ 1.73 ) - ! - ! LightNOX will therefore occur much more often on land. It - ! goes as approx. the 5th power of height, as opposed to approx. - ! the 2nd power of height over oceans. - ! - ! We suppress lightnox where the surface is mostly ice. - ! - ! (ltm, bmy, 5/10/06, 12/11/06) - !================================================================ - - ! Test for land type - IF ( SFCTYPE == 0 ) THEN - - ! Flashes/min over land boxes - FLASHRATE = 3.44d-5 * ( ( HEIGHT * 1d-3 )**4.9d0 ) - - ELSE IF ( SFCTYPE == 1 ) THEN - - ! Flahes/min over water - FLASHRATE = 6.4d-4 * ( ( HEIGHT * 1d-3 )**1.73d0 ) - - ELSE IF ( SFCTYPE == 2 ) THEN - - ! Suppress lightnox over snow/ice - FLASHRATE = 0d0 - - ENDIF - - END SUBROUTINE Flashes_CTH -!EOC -!------------------------------------------------------------------------------ -! Harvard-NASA Emissions Component (HEMCO) ! -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: Get_IC_CG_Ratio -! -! !DESCRIPTION: Function Get\_IC\_CG\_Ratio calculates the Intra-Cloud (IC) -! and Cloud-to-Ground (CG) lightnox flash ratio based on the method of -! Price and Rind 1993, which is calculated from the cold-cloud depth -! (CCTHICK). -!\\ -!\\ -! !INTERFACE: -! - FUNCTION Get_IC_CG_ratio( CCTHICK ) RESULT( IC_CG_RATIO ) -! -! !INPUT PARAMETERS: -! - REAL*8, INTENT(IN) :: CCTHICK ! Cold cloud thickness [m] -! -! !RETURN VALUE: -! - REAL*8 :: IC_CG_RATIO ! Intra-cloud/cloud-ground ratio -! -! !REVISION HISTORY: -! 11 Dec 2006 - R. Yantosca - Initial version -! (1 ) Split off from FLASHES_CTH, FLASHES_MFLUX, FLASHES_PRECON into this -! separate function (ltm, bmy, 12/11/06) -! (2 ) Bug fix for XLF compiler (morin, bmy, 7/8/09) -! 10 Nov 2010 - R. Yantosca - Added ProTeX headers -! 22 Oct 2013 - C. Keller - Now a HEMCO extension. -! 10 Jun 2019 - C. Keller - Moved to ligthning_toolbox_mod.F90 -!EOP -!------------------------------------------------------------------------------ -!BOC -! -! !LOCAL VARIABLES: -! - REAL*8 :: CC, F_CG - - !================================================================= - ! GET_IC_CG_RATIO begins here! - ! - ! COMPUTE INTRA-CLOUD / CLOUD-GROUND FLASH RATIO - ! - ! Price & Rind (1993) compute the ratio of Cloud-Ground - ! to Total Flashes by the parameterization: - ! - ! For 5.5 < dz < 14: - ! - ! f_CG = 1 / (( A*dz^4 + B*dz^3 + C*dz^2 + D*dz + E ) + 1 ) - ! - ! For dz > 14: - ! - ! f_CG = 0.02 - ! - ! Where: - ! - ! (1) dz is the depth [km] of the cloud above the freezing - ! level. The cold-cloud thickness (dz) is the depth of - ! the layer between the cloud top and the center of the - ! highest layer for which the temperature exceeds 273 K. - ! The cold-cloud thickness is set to 5.5 km at grid points - ! where it is less than 5.5 km. - ! - ! (2) The polynomial coefficients are: - ! A=0.021, B=-0.648, C=7.493, D=-36.54, E=63.09 - ! - ! - ! Note: f_IC = 1 - f_CG - ! - ! And hence, - ! - ! IC_CG_RATIO = ( 1 - f_CG ) / f_CG - ! - ! - ! IC_CG_RATIO is passed back to routine the LIGHTNOX_NL, where - ! it is passed to FLASHES_MFLUX and FLASHES_PRECON. In these - ! routines, the fraction of total lightnox flashes that are - ! cloud-ground (CG) flashes is computed by: - ! - ! F_CG = 1d0 / ( 1d0 + IC_CG_RATIO ) - ! - ! and the fraction of the total lightnox flashes that are - ! intra-cloud (IC) flashes is computed by: - ! - ! F_IC = 1d0 - 1d0 / ( 1d0 + IC_CG_RATIO ) - !===================================================================== - - ! Convert cold cloud thickness from [m] to [km] (min value: 5.5 km) - CC = MAX( CCTHICK * 1d-3, 5.5d0 ) - - ! Compute cloud-ground flash ratio as described above - IF ( CC > 14d0 ) THEN - - ! Constant value above 14 km - F_CG = 0.02d0 - - ELSE - - ! First create the polynomial expression - F_CG = 63.09d0 + CC * ( -36.54d0 + & - CC * ( 7.493d0 + & - CC * ( -0.648d0 + & - CC * ( 0.021d0 ) ) ) ) - - ! Then put it in the denominator - F_CG = 1d0 / ( F_CG + 1d0 ) - - ENDIF - - ! Intra-Cloud / Cloud-Ground flash ratio - IC_CG_RATIO = ( 1d0 - F_CG ) / F_CG - - END FUNCTION Get_IC_CG_Ratio -!EOC -!------------------------------------------------------------------------------ -! Harvard-NASA Emissions Component (HEMCO) ! -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: LightDist -! -! !DESCRIPTION: Subroutine LightDist reads in the CDF used to partition the -! column lightnox NOx into the GEOS-Chem vertical layers. -!\\ -!\\ -! !INTERFACE: -! - SUBROUTINE LightDist( NZ, NNLIGHT, NLTYPE, LTOP, H0, XLAT, TOTAL, & - VERTPROF, SFCTYPE, cMt, MTYPE, BXHEIGHT_M, PROFILE ) -! -! !INPUT PARAMETERS: -! - INTEGER, INTENT(IN) :: NZ ! Number of vertical levels - INTEGER, INTENT(IN) :: NNLIGHT ! Dimension 1 of profile array - INTEGER, INTENT(IN) :: NLTYPE ! Dimension 2 of profile array - INTEGER, INTENT(IN) :: LTOP ! Level of conv cloud top - REAL*8, INTENT(IN) :: H0 ! Conv cloud top height [m] - REAL*8, INTENT(IN) :: XLAT ! Latitude value [degrees] - REAL*8, INTENT(IN) :: TOTAL ! Column Total # of LNOx molec - REAL(hp), INTENT(IN) :: BXHEIGHT_M(NZ) ! Boxheights in meter - INTEGER, INTENT(IN) :: SFCTYPE ! Surface type - INTEGER, INTENT(IN) :: cMt ! Current month - REAL*8, INTENT(IN) :: PROFILE(NNLIGHT, NLTYPE ) ! Profile tables -! -! !OUTPUT PARAMETERS: -! - REAL*8, INTENT(OUT) :: VERTPROF(NZ) ! Vertical profile - INTEGER, INTENT(OUT) :: MTYPE ! lightning type -! -! !REMARKS: -! References: -! ============================================================================ -! (1 ) Pickering et al., JGR 103, 31,203 - 31,316, 1998. -! (2 ) Ott et al., JGR, 2010 -! (3 ) Allen et al., JGR, 2010 -! -! !REVISION HISTORY: -! 18 Sep 2002 - M. Evans - Initial version (based on Yuhang Wang's code) -! (1 ) Use functions IS_LAND and IS_WATER to determine if the given grid -! box is over land or water. These functions work for all DAO met -! field data sets. (bmy, 4/2/02) -! (2 ) Renamed M2 to LTOP and THEIGHT to H0 for consistency w/ variable names -! w/in "lightnox.f". Now read the "light_dist.dat.geos3" file for -! GEOS-3 directly from the DATA_DIR/lightnox_NOx_200203/ subdirectory. -! Now read the "light_dist.dat" file for GEOS-1, GEOS-STRAT directly -! from the DATA_DIR/lightnox_NOx_200203/ subdirectory. Added -! descriptive comment header. Now trap I/O errors across all -! platforms with subroutine "ioerror.f". Updated comments, cosmetic -! changes. Redimension FRAC(NNLIGHT) to FRAC(LLPAR). (bmy, 4/2/02) -! (3 ) Deleted obsolete code from April 2002. Now reference IU_FILE and -! IOERROR from "file_mod.f". Now use IU_FILE instead of IUNIT as the -! file unit number. (bmy, 6/27/02) -! (4 ) Now reference BXHEIGHT from "dao_mod.f" (bmy, 9/18/02) -! (5 ) Bug fix: add GEOS_4 to the #if block (bmy, 3/4/04) -! (6 ) Now bundled into "lightnox_mod.f". CDF's are now read w/in -! routine INIT_LIGHTNOX to allow parallelization (bmy, 4/14/04) -! (7 ) Now references DATA_DIR from "directory_mod.f" (bmy, 7/20/04) -! (8 ) Now uses near-land formulation (ltm, bmy, 5/10/06) -! (9 ) Added extra safety check for pathological boxes (bmy, 12/11/06) -! (10) Remove the near-land formulation, except for PRECON (ltm, bmy, 9/24/07) -! (11) Now use the Ott et al. [2010] profiles, and apply consistently with -! GMI model [Allen et al., 2010] (ltm, bmy, 1/25/11). -! 10 Nov 2010 - R. Yantosca - Added ProTeX headers -! 01 Mar 2012 - R. Yantosca - Now use GET_AREA_CM2(I,J,L) from grid_mod.F90 -! 15 Jun 2012 - Nielsen - INQUIRE finds free logical unit number for IU_FILE -! 09 Nov 2012 - M. Payer - Replaced all met field arrays with State_Met -! derived type object -! 22 Oct 2013 - C. Keller - Now a HEMCO extension. -! 10 Jun 2019 - C. Keller - Moved to lightning_toolbox_mod.F90. -!EOP -!------------------------------------------------------------------------------ -!BOC -! -! !LOCAL VARIABLES: -! - INTEGER :: L - REAL*8 :: ZHEIGHT, YMID - REAL*8 :: FRAC(NZ) - - !================================================================= - ! LIGHTDIST begins here! - !================================================================= - - ! Initialize - MTYPE = 0 - VERTPROF = 0d0 - - !%%% NOTE: Use L=1 for GRID_MOD functions. This is OK for the - !%%% existing GEOS-Chem with a pure cartesian grid, but may be an - !%%% issue when interfaced with a GCM with a non-regular grid - !%%% (bmy, 3/1/12) - YMID = XLAT - - !================================================================= - ! Test whether location (I,J) is continental, marine, or snow/ice - ! - ! Depending on the combination of land/water and latitude, - ! assign a flag describing the type of lightnox: - ! - ! MTYPE = 1: ocean lightnox - ! MTYPE = 2: tropical continental lightnox - ! MTYPE = 3: midlatitude continental lightnox - ! MTYPE = 4: subtropical lightnox - ! - ! (ltm, bmy, 1/25/11) - !================================================================= - - ! Assign profile kind to grid box, following Allen et al. - ! [JGR, 2010] (ltm, 1/25,11) -! MONTH = cMt - - SELECT CASE (cMt) - - ! Southern Hemisphere Summer - CASE ( 1,2,3,12 ) - - IF ( ABS(YMID) .le. 15 ) THEN - IF ( SFCTYPE == 0 ) THEN - MTYPE = 2 ! Tropical continental - ELSE - MTYPE = 1 ! Tropical marine - ENDIF - ELSE IF ( ( YMID .gt. 15. ) .and. ( YMID .le. 30. ) ) THEN - MTYPE = 4 ! N. Subtropics - ELSE IF ( ( YMID .ge. -40. ) .and. ( YMID .lt. -15. ) ) THEN - MTYPE = 4 ! S. Subtropics - ELSE - MTYPE = 3 ! Midlatitude - ENDIF - - ! Equinox months - CASE ( 4,5,10,11 ) - - IF ( ABS(YMID) .le. 15 ) THEN - IF ( SFCTYPE == 0 ) THEN - MTYPE = 2 ! Tropical continental - ELSE - MTYPE = 1 ! Tropical marine - ENDIF - ELSE IF ( ABS(YMID) .le. 30 ) THEN - MTYPE = 4 ! Subtropics - ELSE - MTYPE = 3 ! Midlatitude - ENDIF - - ! Northern Hemisphere Summer - CASE ( 6,7,8,9 ) - - IF ( ABS(YMID) .le. 15 ) THEN - IF ( SFCTYPE == 0 ) THEN - MTYPE = 2 ! Tropical continental - ELSE - MTYPE = 1 ! Tropical marine - ENDIF - ELSE IF ( ( YMID .gt. 15. ) .and. ( YMID .le. 40. ) ) THEN - MTYPE = 4 ! N. Subtropics - ELSE IF ( ( YMID .ge. -30. ) .and. ( YMID .lt. -15. ) ) THEN - MTYPE = 4 ! S. Subtropics - ELSE - MTYPE = 3 ! Midlatitude - ENDIF - - END SELECT - - ! Extra safety check for pathological grid boxes (bmy, 11/29/06) - IF ( MTYPE == 0 ) RETURN - - !================================================================= - ! Use the CDF for this type of lightnox to partition the total - ! column lightnox into the layers - !================================================================= - ZHEIGHT = 0.0 - - ! Compute the height [km] at the top of each vertical level. - ! Look up the cumulative fraction of NOx for each vertical level - DO L = 1, LTOP - ZHEIGHT = ZHEIGHT + BXHEIGHT_M(L) - FRAC(L) = PROFILE( NINT( ( ZHEIGHT/H0 )*3200. ), MTYPE ) *0.01 - ENDDO - - ! Convert from cumulative fraction to fraction for each level - DO L = LTOP, 2, - 1 - FRAC(L) = FRAC(L) - FRAC(L-1) - ENDDO - - ! Partition lightnox NOx by layer into VERTPROF - DO L = 1, LTOP - VERTPROF(L) = ( FRAC(L) * TOTAL ) - ENDDO - - END SUBROUTINE LightDist -!EOC -END MODULE Lightning_Toolbox_Mod diff --git a/GEOS_Util/coupled_diagnostics/CMakeLists.txt b/GEOS_Util/coupled_diagnostics/CMakeLists.txt index 4c70a172..ad45b4e7 100644 --- a/GEOS_Util/coupled_diagnostics/CMakeLists.txt +++ b/GEOS_Util/coupled_diagnostics/CMakeLists.txt @@ -1,7 +1,7 @@ # From https://stackoverflow.com/questions/7787823/cmake-how-to-get-the-name-of-all-subdirectories-of-a-directory MACRO(SUBDIRLIST result curdir) - FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) + FILE(GLOB children CONFIGURE_DEPENDS RELATIVE ${curdir} ${curdir}/*) SET(dirlist "") FOREACH(child ${children}) IF(IS_DIRECTORY ${curdir}/${child}) diff --git a/GEOS_Util/coupled_diagnostics/g5lib/plotocn.j b/GEOS_Util/coupled_diagnostics/g5lib/plotocn.j index 3d85593d..1c4fd213 100755 --- a/GEOS_Util/coupled_diagnostics/g5lib/plotocn.j +++ b/GEOS_Util/coupled_diagnostics/g5lib/plotocn.j @@ -14,7 +14,7 @@ set VERIFICATION=$SCRDIR/verification if (($HOSTNAME =~ discover*) || ($HOSTNAME =~ borg*)) then setenv OCEANVAL /discover/nobackup/projects/gmao/oceanval/verification -else if ( $HOSTNAME =~ "pfe"* ) then +else if ( ($HOSTNAME =~ "pfe"*) || ($HOSTNAME =~ r[0-9]*i[0-9]*n[0-9]*) || ($HOSTNAME =~ r[0-9]*c[0-9]*t[0-9]*n[0-9]*) ) then setenv OCEANVAL /nobackup/gmao_SIteam/ModelData/oceanval/verification endif diff --git a/GEOS_Util/plots/CMakeLists.txt b/GEOS_Util/plots/CMakeLists.txt index 3f39527b..ddca5b0b 100644 --- a/GEOS_Util/plots/CMakeLists.txt +++ b/GEOS_Util/plots/CMakeLists.txt @@ -1,10 +1,14 @@ +if (CMAKE_Fortran_COMPILER_ID MATCHES Intel AND CMAKE_BUILD_TYPE MATCHES Release) + set( CMAKE_Fortran_FLAGS_RELEASE "${FOPT2} ${PP}") +endif () + set (zonal_prog_name zonal_${CMAKE_SYSTEM_NAME}.x ) ecbuild_add_executable (TARGET ${zonal_prog_name} SOURCES zonal.f LIBS MAPL) if (EXTENDED_SOURCE) - set_source_files_properties(zonal.f PROPERTIES COMPILE_FLAGS ${EXTENDED_SOURCE}) + set_source_files_properties(zonal.f PROPERTIES COMPILE_FLAGS "${EXTENDED_SOURCE} ${BYTERECLEN}") endif () set (regrid2_prog_name @@ -18,7 +22,6 @@ endif () set (plots_progs quickplot - configure landscape.script portrait.script moveplot @@ -26,7 +29,7 @@ set (plots_progs get_exports chckhist.new chckhist.old - chckrc + chckrc zonal ) @@ -41,7 +44,7 @@ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/quickstat DESTINATION plots) # From https://stackoverflow.com/questions/7787823/cmake-how-to-get-the-name-of-all-subdirectories-of-a-directory MACRO(SUBDIRLIST result curdir) - FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) + FILE(GLOB children CONFIGURE_DEPENDS RELATIVE ${curdir} ${curdir}/*) SET(dirlist "") FOREACH(child ${children}) IF(IS_DIRECTORY ${curdir}/${child}) @@ -61,3 +64,8 @@ install ( USE_SOURCE_PERMISSIONS MESSAGE_NEVER ) + +# Run this last! +configure_file(configure configure @ONLY) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/configure DESTINATION plots) +install(CODE "execute_process(COMMAND ${CMAKE_INSTALL_PREFIX}/plots/configure WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/plots)") diff --git a/GEOS_Util/plots/VERIFICATION_RCS/VERIFICATION.ECANA.rc b/GEOS_Util/plots/VERIFICATION_RCS/VERIFICATION.ECANA.rc index ae4df4db..dfa76506 100644 --- a/GEOS_Util/plots/VERIFICATION_RCS/VERIFICATION.ECANA.rc +++ b/GEOS_Util/plots/VERIFICATION_RCS/VERIFICATION.ECANA.rc @@ -2,7 +2,7 @@ OBSNAM: ecops OBSDSC: ECMWF_OPNL_ANA - filename: 'VERIFICATION/ECMWF_OPS.NCDF3/xdf.tabl' + filename: 'VERIFICATION/ECMWF_OPS.NC4/xdf.tabl' filetype: 'HDF' fields: 'ZLE' , 'DYN' , 'HGHT' , 1 'SLP' , 'DYN' , 'SLP' , 1 diff --git a/GEOS_Util/plots/VERIFICATION_RCS/VERIFICATION.GDAS1.rc b/GEOS_Util/plots/VERIFICATION_RCS/VERIFICATION.GDAS1.rc index 2b0c7545..b85abe7c 100644 --- a/GEOS_Util/plots/VERIFICATION_RCS/VERIFICATION.GDAS1.rc +++ b/GEOS_Util/plots/VERIFICATION_RCS/VERIFICATION.GDAS1.rc @@ -2,7 +2,7 @@ OBSNAM: gdas1 OBSDSC: NCEP_OPNL_gdas1 - filename: 'VERIFICATION/NCEP_GDAS-1.NCDF3/xdf.tabl' + filename: 'VERIFICATION/NCEP_GDAS-1.NC4/xdf.tabl' filetype: 'HDF' fields: 'ZLE' , 'DYN' , 'HGHT' , 1 'SLP' , 'DYN' , 'SLP' , 1 diff --git a/GEOS_Util/plots/chckhist.new b/GEOS_Util/plots/chckhist.new index 0dc0627f..30ea5dea 100755 --- a/GEOS_Util/plots/chckhist.new +++ b/GEOS_Util/plots/chckhist.new @@ -15,132 +15,211 @@ set arch = `uname` set expdsc = NULL set alias = NULL set output = NULL -set format = NULL +set format = flat set scale = 1.0 -@ ncoll = 0 +set DOLLAR = '$' + +####################################################################### + +set FILE = strip +/bin/rm -f $FILE +cat << EOF > $FILE +#!/bin/ksh +/bin/mv \$1 \$1.tmp +touch \$1 +while read line +do +echo \$line >> \$1 +done < \$1.tmp +exit +EOF +chmod +x $FILE + +####################################################################### + +# Check for SUFFIX appended to EXPORT (as EXPORT:SUFFIX) +# ------------------------------------------------------ +set SUFFIX = `echo $EXPORT | grep : | cut -d: -f2` +set EXPORT = `echo $EXPORT | cut -d: -f1` + +####################################################################### # Create true comma-separated HISTORY variable # -------------------------------------------- if(! -e HISTORY.T ) then cat $HISTORYRC | sed -e 's/,/ , /g' | sed -e 's/*/@/g' | sed -e 's/?/ /g' > HISTORY.T endif - set expid = `grep EXPID HISTORY.T | cut -d: -f 2` + +./strip HISTORY.T + + set expid = `grep EXPID: HISTORY.T | cut -d: -f2` + set expdsc = `grep EXPDSC: HISTORY.T | cut -d: -f2` set expid = `echo $expid` # to remove preceding blanks + set expdsc = `echo $expdsc` # to remove preceding blanks + set HISTORY = `cat HISTORY.T` - set numwords = $#HISTORY - - -# Find Experiment Description -# --------------------------- -@ n = 0 - @ numword = 1 -while( $numword <= $numwords ) - set word = $HISTORY[$numword] - @ numword = $numword + 1 -@ n = $n + 1 -@ m = $n + 1 -if( $word == EXPDSC: ) then - set expdsc = $HISTORY[$m] -endif -end +####################################################################### +# Find HISTORY Collections +####################################################################### -# Find Collections -# ---------------- +# Define Collections +# ------------------ set collections = `$GEOSUTIL/post/get_streams HISTORY.T` set num_collections = $#collections +####################################################################### +####################################################################### -# Find EXPORT and GC within Collection -# ------------------------------------ -if( $arch == 'IRIX64' ) set catargs = "-ve" -if( $arch == 'Linux' ) set catargs = "-E" -if( $arch == 'OSF1' ) set catargs = "-E" - set temp = `cat $catargs HISTORY.T` - set ntemp = $#temp - set found = FALSE - @ n = 1 -while( $n <= $ntemp ) - @ m = 0 - foreach collection ($collections) - @ m = $m + 1 - if( $temp[$n] == ${collection}.fields: ) then - set dum = '' - @ k = $n - while( "$dum" != "::" ) - @ k = $k + 1 - -# Create String to End-Of-Line -# ---------------------------- - set lastbit = '' - set string = '' - while( "$lastbit" != '$' ) - @ i = 1 - set bit = `echo $temp[$k] | cut -b${i}-${i}` - while ( "$bit" != '' ) - @ i = $i + 1 - set bit = `echo $temp[$k] | cut -b${i}-${i}` - end - @ i = $i - 1 - set lastbit = `echo $temp[$k] | cut -b${i}-${i}` - set string = `echo $string $temp[$k]` - @ k = $k + 1 - end - - set numwords = $#string - set QEXPORT = `echo $string[1] | sed -e "s/'//g"` - set QGC = `echo $string[3] | sed -e "s/'//g"` - if( $numwords >= 5 ) then - if( $string[5] != '$' ) then - set QALIAS = `echo $string[5] | sed -e "s/'//g" | sed -e 's/\$//g'` - else - set QALIAS = $QEXPORT - endif - else - set QALIAS = $QEXPORT - endif - if( $numwords >= 7 ) then - if( $string[7] != '$' ) then - set QSCALE = `echo $string[7] | sed -e 's/\$//g'` - else - set QSCALE = $scale - endif - else - set QSCALE = $scale - endif - -# echo "k: $k STRING: $string" -# echo " EXPORT: $QEXPORT" -# echo " GC: $QGC" -# echo " ALIAS: $QALIAS" -# echo " SCALE: $QSCALE" -# echo " " - - set dum = `echo $temp[$k] | cut -b1-2` - @ k = $k - 1 - set XEXPORT = `echo $QEXPORT | cut -d';' -f1` - set YEXPORT = `echo $QEXPORT | cut -d';' -f2` - set XALIAS = `echo $QALIAS | cut -d';' -f1` - set YALIAS = `echo $QALIAS | cut -d';' -f2` - if( $EXPORT == $XEXPORT && $GC == $QGC ) then - set found = TRUE - set alias = $XALIAS - set scale = $QSCALE - @ ncoll = $m - endif - if( $EXPORT == $YEXPORT && $GC == $QGC ) then - set found = TRUE - set alias = $YALIAS - set scale = $QSCALE - @ ncoll = $m - endif - end - endif - end - if( $found == TRUE ) @ n = $ntemp -@ n = $n + 1 +####################################################################### +# Find HISTORY Collections +####################################################################### + +set collections = '' +foreach line ("`cat HISTORY.T`") + set firstword = `echo $line | awk '{print $1}'` + set firstchar = `echo $firstword | cut -c1` + set secondword = `echo $line | awk '{print $2}'` + + if ( $firstword == "::" ) goto done1 + + if ( $firstchar != "#" ) then + set collection = `echo $firstword | sed -e "s/'//g"` + set collections = `echo $collections $collection` + if ( $secondword == :: ) goto done1 + endif + + if ( $firstword == COLLECTIONS: ) then + set collections = `echo $secondword | sed -e "s/'//g"` + endif end +done1: + +# --------------------------------- +# csplit file based on :: delimiter +# --------------------------------- +# Note we need the +1 so that we keep the :: at the end + +csplit HISTORY.T '/:: *$/+1' '{*}' --prefix=possible_collection > /dev/null + +# Now we need the actual "collection" bits + +set finalcolls = '' +foreach collection ($collections) + #echo "Checking for $collection..." + foreach file (`/bin/ls possible_collection*`) + grep "$collection.fields" $file > /dev/null + if ($status == 0) then + + # If we found collection.fields, then it's a collection bit... + # echo "Found $collection.fields in $file" + /bin/mv $file TMP.$collection.rcx + + # This removes any fluff at the top of a file + sed -n "/$collection/,${DOLLAR}p" TMP.$collection.rcx > $collection.rcx + + set finalcolls = `echo $finalcolls $collection` + endif + end +end +# Remove failed files +/bin/rm possible_collection* + +# Remove TMP files +/bin/rm TMP* + +####################################################################### +####################################################################### + +set found = FALSE +foreach collection ($finalcolls) + strip ${collection}.rcx + + foreach line ("`cat ${collection}.rcx`") + + set string = `echo $line | awk '{print $1}'` + + if( $string =~ ${collection}.* ) then + if( $string == ${collection}.format: ) set FORMAT = `echo $line | cut -d" " -f2 | sed -e "s/'//g"` + if( $string != ${collection}.fields: ) continue + set QEXPORT = `echo $line | awk '{print $2}'` + set QGC = `echo $line | awk '{print $4}'` + set QALIAS = `echo $line | awk '{print $6}'` + set QSCALE = `echo $line | awk '{print $8}'` + else + set QEXPORT = `echo $line | awk '{print $1}'` + set QGC = `echo $line | awk '{print $3}'` + set QALIAS = `echo $line | awk '{print $5}'` + set QSCALE = `echo $line | awk '{print $7}'` + endif + + set QGC = `echo $QGC | sed -e "s/'//g"` + if( .$QSCALE == . ) set QSCALE = 1.0 + + # echo LINE: $line + # echo QALIAS: $QALIAS SUFFIX: $SUFFIX + # echo " " + + # CASE 1: SUFFIX = '' + # This is the traditional case following original GOCART/GOCART_2G standards + # ----------------------------------------------------------------------------------- + if( .$SUFFIX == . ) then + if( .$QALIAS == . ) set QALIAS = $QEXPORT + set XEXPORT = `echo $QEXPORT | cut -d";" -f1 | sed -e "s/'//g"` + set YEXPORT = `echo $QEXPORT | grep ";" | cut -d";" -f2 | sed -e "s/'//g"` + set XALIAS = `echo $QALIAS | cut -d";" -f1 | sed -e "s/'//g"` + set YALIAS = `echo $QALIAS | grep ";" | cut -d";" -f2 | sed -e "s/'//g"` + + if( "$EXPORT" == "$XEXPORT" && $GC == $QGC ) then + set found = TRUE + set alias = $XALIAS + set scale = $QSCALE + set hisout = $collection + echo "COLLECTION: $hisout EXPORT: $XEXPORT GC: $QGC ALIAS: $alias SCALE: $scale SUFFIX: $SUFFIX" + break + endif + if( "$EXPORT" == "$YEXPORT" && $GC == $QGC ) then + set found = TRUE + set alias = $YALIAS + set scale = $QSCALE + set hisout = $collection + echo "COLLECTION: $hisout EXPORT: $YEXPORT GC: $QGC ALIAS: $alias SCALE: $scale SUFFIX: $SUFFIX" + break + endif + endif + + # CASE 2: SUFFIX != '' + # This implies use of GOCART_2G requiring ALT_EXPORTS (Note: scalars only, no Aerosol vector exports) + # ------------------------------------------------------------------------------------------------------------ + if( .$SUFFIX != . ) then + if( .$QALIAS == . ) then + set XEXPORT = `echo $QEXPORT | sed -e "s/'//g"` + set XALIAS = `echo $QEXPORT | sed -e "s/'//g"`${SUFFIX} # Append SUFFIX to EXPORT name + else + set XEXPORT = `echo $QEXPORT | sed -e "s/'//g"` + set XALIAS = `echo $QALIAS | cut -d';' -f${SUFFIX} | sed -e "s/'//g"` # Select QALIAS based on SUFFIX Index + endif + if( "$EXPORT" == "$XEXPORT" && $GC == $QGC ) then + set found = TRUE + set alias = $XALIAS + set scale = $QSCALE + set hisout = $collection + echo "COLLECTION: $hisout EXPORT: $XEXPORT GC: $QGC ALIAS: $alias SCALE: $scale SUFFIX: $SUFFIX" + break + endif + endif + + end # End Line Loop + + if( $found == TRUE ) break + +end # End Collection Loop + +####################################################################### +# Find HISTORY Collections +####################################################################### + if(! $?TBEG ) set TBEG = "NULL" if(! $?TEND ) set TEND = "NULL" if(! $?PLOT_QUAD ) set PLOT_QUAD = "false" @@ -160,12 +239,9 @@ if(! $?PLOT_QUAD ) set PLOT_QUAD = "false" # # ------------------------------------------------------------------------------ -if( $ncoll != 0 ) then +if( $found == TRUE ) then set numseas = `echo $SEASONS` - set output = '' - set format = '' - -foreach collection ($collections) + set collection = $hisout if( -e ${source}/${collection}/$DDFFILE ) then set dummy = `echo ${source}/${collection}/$DDFFILE` @@ -234,23 +310,19 @@ foreach collection ($collections) endif endif - set output = `echo $output $dummy` + set output = `echo $dummy` + +endif # Endif found=TRUE - set dummy = `grep ${collection}.format HISTORY.T | cut -d: -f2 | cut -d, -f1 | sed -e "s/'//g"` - if( "$dummy" == "" ) set dummy = flat - set format = `echo $format $dummy` -end -else -@ ncoll = 1 -endif +#endif # Export Results # -------------- setenv EXPDSC $expdsc setenv ALIAS $alias -setenv OUTPUT $output[$ncoll] -setenv FORMAT $format[$ncoll] +setenv OUTPUT $output +setenv FORMAT $format setenv BASE $expid echo ' ' @@ -278,3 +350,4 @@ echo $OUTPUT >> hist.txt echo $scale >> hist.txt echo $FORMAT >> hist.txt echo $BASE >> hist.txt + diff --git a/GEOS_Util/plots/configure b/GEOS_Util/plots/configure index f4032e5a..d3e88637 100755 --- a/GEOS_Util/plots/configure +++ b/GEOS_Util/plots/configure @@ -71,16 +71,19 @@ endif # Set GRADS Environment Variables # ------------------------------- +setenv GEOSUTIL @CMAKE_INSTALL_PREFIX@ setenv GASCRP $GEOSUTIL/plots/grads_util setenv GAUDFT $GEOSUTIL/plots/grads_util/udft_$arch.tools setenv GAUDXT $GEOSUTIL/plots/grads_util/udxt -if( -e sedfile ) /bin/rm sedfile -cat > sedfile << EOF +if(! -e $GAUDFT) then +set SEDFILE=`mktemp` +cat > $SEDFILE << EOF s?GEOSUTIL?$GEOSUTIL?g s?ARCH?$arch?g EOF -sed -f sedfile $GASCRP/udft.template > $GAUDFT +sed -f $SEDFILE $GASCRP/udft.template > $GAUDFT +endif # Link VERIFICATION Directories # ----------------------------------------------------------------------------------- @@ -92,7 +95,7 @@ set dirs = `echo olrc olrcf radnetg radnetgc radswt tpw cldtt albedo swgnet swgnetc swgnetcf swgup swgupc swgupcf swgdwn swgdwnc swgdwncf ` foreach dir ($dirs) cd $GEOSUTIL/plots/$dir -/bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.SRB.rc . +if (! -l VERIFICATION.SRB.rc) /bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.SRB.rc . end # VERIFICATION.ERBE @@ -100,7 +103,7 @@ end set dirs = `echo osr osrc osrcf olr olrc olrcf nettoa nettoac toacf` foreach dir ($dirs) cd $GEOSUTIL/plots/$dir -/bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.ERBE.rc . +if (! -l VERIFICATION.ERBE.rc) /bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.ERBE.rc . end # VERIFICATION.CERES_EBAF-TOA_Ed4.0 @@ -108,7 +111,7 @@ end set dirs = `echo toacf tseries osrcf osrc osr radswt olrc olr olrcf nettoac nettoa` foreach dir ($dirs) cd $GEOSUTIL/plots/$dir -/bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.CERES_EBAF-TOA_Ed4.0.rc . +if (! -l VERIFICATION.CERES_EBAF-TOA_Ed4.0.rc) /bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.CERES_EBAF-TOA_Ed4.0.rc . end # VERIFICATION.CERES_EBAF @@ -116,7 +119,7 @@ end set dirs = `echo toacf olrc olrcf nettoac tseries nettoa olr osrcf osrc osr radswt` foreach dir ($dirs) cd $GEOSUTIL/plots/$dir -/bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.CERES_EBAF.rc . +if (! -l VERIFICATION.CERES_EBAF.rc) /bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.CERES_EBAF.rc . end # VERIFICATION.COADS @@ -124,7 +127,7 @@ end set dirs = `echo emp speed eflux hflux cldtt taux tauy` foreach dir ($dirs) cd $GEOSUTIL/plots/$dir -/bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.COADS.rc . +if (! -l VERIFICATION.COADS.rc) /bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.COADS.rc . end # VERIFICATION.ISCCP @@ -132,7 +135,7 @@ end set dirs = `echo cldhi cldlo cldmd cldtt` foreach dir ($dirs) cd $GEOSUTIL/plots/$dir -/bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.ISCCP.rc . +if (! -l VERIFICATION.ISCCP.rc) /bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.ISCCP.rc . end # VERIFICATION.GSSTF @@ -140,7 +143,7 @@ end set dirs = `echo eflux hflux speed taux tauy tpw` foreach dir ($dirs) cd $GEOSUTIL/plots/$dir -/bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.GSSTF.rc . +if (! -l VERIFICATION.GSSTF.rc) /bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.GSSTF.rc . end # VERIFICATION.ECINTERIM @@ -148,7 +151,7 @@ end set dirs = `echo hcmp lcmp zcmp zcmp1 tseries precip` foreach dir ($dirs) cd $GEOSUTIL/plots/$dir -/bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.ECINTERIM.rc . +if (! -l VERIFICATION.ECINTERIM.rc) /bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.ECINTERIM.rc . end # VERIFICATION.ECANA @@ -156,7 +159,7 @@ end set dirs = `echo hcmp lcmp zcmp` foreach dir ($dirs) cd $GEOSUTIL/plots/$dir -/bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.ECANA.rc . +if (! -l VERIFICATION.ECANA.rc) /bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.ECANA.rc . end # VERIFICATION.ERA5 @@ -166,7 +169,7 @@ set dirs = `echo lwgdwnc lwgdwn lwgnetc lwgnet lwgupc lwgup \ precipcn precipls precip ` foreach dir ($dirs) cd $GEOSUTIL/plots/$dir -/bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.ERA5.rc . +if (! -l VERIFICATION.ERA5.rc) /bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.ERA5.rc . end # VERIFICATION.GDAS1 @@ -174,7 +177,7 @@ end set dirs = `echo hcmp lcmp zcmp` foreach dir ($dirs) cd $GEOSUTIL/plots/$dir -/bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.GDAS1.rc . +if (! -l VERIFICATION.GDAS1.rc) /bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.GDAS1.rc . end # VERIFICATION.NCEP @@ -182,7 +185,7 @@ end set dirs = `echo hcmp lcmp zcmp` foreach dir ($dirs) cd $GEOSUTIL/plots/$dir -/bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.NCEP.rc . +if (! -l VERIFICATION.NCEP.rc) /bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.NCEP.rc . end # VERIFICATION.GPCP @@ -190,7 +193,7 @@ end set dirs = `echo precip tseries` foreach dir ($dirs) cd $GEOSUTIL/plots/$dir -/bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.GPCP.rc . +if (! -l VERIFICATION.GPCP.rc) /bin/ln -sf ../VERIFICATION_RCS/VERIFICATION.GPCP.rc . end @@ -212,14 +215,14 @@ if(! -e toacf_cc5 ) /bin/ln -sf toacf toacf_cc5 # Link Cubed-Sphere FRAC Dataset for dc.gs Utility and CONST_2d Dataset for TopoShade # ----------------------------------------------------------------------------------- cd $GEOSUTIL/plots/grads_util -/bin/ln -sf $TOPODIR/TOPO_CF0720x6C/FRAC_720x4320.nc4 . -/bin/ln -sf $TOPODIR/TOPO_CF0720x6C/CONST_2D.2880x1441.nc4 . -/bin/ln -sf $TOPODIR/TOPO_CF1440x6C/CONST_2D.5760x2881.nc4 . +if(! -l FRAC_720x4320.nc4) /bin/ln -sf $TOPODIR/TOPO_CF0720x6C/FRAC_720x4320.nc4 . +if(! -l CONST_2D.2880x1441.nc4) /bin/ln -sf $TOPODIR/TOPO_CF0720x6C/CONST_2D.2880x1441.nc4 . +if(! -l CONST_2D.5760x2881.nc4) /bin/ln -sf $TOPODIR/TOPO_CF1440x6C/CONST_2D.5760x2881.nc4 . cd $cdir # Create .cshrc for QuickPlot (Note: unsetenv GAUDXT to removed Arlindo Setup Conflicts) # -------------------------------------------------------------------------------------- -if( -e .quickplotrc ) /bin/rm .quickplotrc +#if( -e .quickplotrc ) /bin/rm .quickplotrc echo \#\!/bin/csh > .quickplotrc echo setenv VERIFICATION $VERIFICATION >> .quickplotrc echo setenv LOCHOST $host >> .quickplotrc diff --git a/GEOS_Util/plots/grads_util/closeness.gs b/GEOS_Util/plots/grads_util/closeness.gs index 7ac9f5f2..deffc13a 100644 --- a/GEOS_Util/plots/grads_util/closeness.gs +++ b/GEOS_Util/plots/grads_util/closeness.gs @@ -31,6 +31,12 @@ gridcomp = getarg (args,GC) math = getarg (args,MATH) level = getarg (args,LEVEL) + qname = NULL + qname = getarg (args,QNAME) +if(qname = NULL ) + qname = mname +endif + * --------------------------- if( math = NULL ) ; math = '' ; endif if( season = NULL ) ; season = '' ; endif @@ -96,6 +102,23 @@ if( result = 'NULL' ) ; 'getresource 'PLOTRC' DLEVS' ; endif 'getresource 'PLOTRC' 'PFX'DCOLS' if( result = 'NULL' ) ; 'getresource 'PLOTRC' DCOLS' ; endif dcols = result + + 'getresource 'PLOTRC' 'PFX'FIXED_PLOT_FACTOR' +if( result = 'NULL' ) ; 'getresource 'PLOTRC' FIXED_PLOT_FACTOR' ; endif + fixpltfact = result + + 'getresource 'PLOTRC' 'PFX'CLOSE_PLOT_FACTOR' +if( result = 'NULL' ) ; 'getresource 'PLOTRC' CLOSE_PLOT_FACTOR' ; endif + clspltfact = result + + 'getresource 'PLOTRC' 'PFX'FIXED_PLOT_CINT' +if( result = 'NULL' ) ; 'getresource 'PLOTRC' FIXED_PLOT_CINT' ; endif + fixpltcint = result + + 'getresource 'PLOTRC' 'PFX'CLOSE_PLOT_CINT' +if( result = 'NULL' ) ; 'getresource 'PLOTRC' CLOSE_PLOT_CINT' ; endif + clspltcint = result + factor = 1 else @@ -112,6 +135,14 @@ if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_CBSCALE' ; endi if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_FACTOR' ; endif factor = result + 'getresource 'PLOTRC' 'mname'_'gridcomp'_'level'_FIXED_PLOT_FACTOR' +if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_FIXED_PLOT_FACTOR' ; endif + fixpltfact = result + + 'getresource 'PLOTRC' 'mname'_'gridcomp'_'level'_CLOSE_PLOT_FACTOR' +if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_CLOSE_PLOT_FACTOR' ; endif + clspltfact = result + 'getresource 'PLOTRC' 'mname'_'gridcomp'_'level'_TITLE' if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_TITLE' ; endif title = result @@ -120,6 +151,14 @@ if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_TITLE' ; endif if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_CINT' ; endif ccint = result + 'getresource 'PLOTRC' 'mname'_'gridcomp'_'level'_FIXED_PLOT_CINT' +if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_FIXED_PLOT_CINT' ; endif + fixpltcint = result + + 'getresource 'PLOTRC' 'mname'_'gridcomp'_'level'_CLOSE_PLOT_CINT' +if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_CLOSE_PLOT_CINT' ; endif + clspltcint = result + 'getresource 'PLOTRC' 'mname'_'gridcomp'_'level'_CCOLS' if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_CCOLS' ; endif ccols = result @@ -135,9 +174,7 @@ if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_CLEVS' ; endif if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_DCOLS' ; endif dcols = result - say 'getresource 'PLOTRC' 'mname'_'gridcomp'_'level'_'LEVTYPE 'getresource 'PLOTRC' 'mname'_'gridcomp'_'level'_'LEVTYPE - say 'RESULT = 'result if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_'level' 'DLEVS ; endif if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_'DLEVS ; endif dlevs = result @@ -150,7 +187,7 @@ endif say '' if( factor = 'NULL' ) ; factor = 1 ; endif if( title = 'NULL' ) - 'getdesc 'mname + 'getdesc 'qname desc = result title = mname':'gridcomp' 'desc "rmstring '"title"' '[column]'" @@ -160,7 +197,7 @@ if( title = 'NULL' ) endif if( dcols = 'NULL' ) - dcols = '55 49 47 45 44 36 34 33 32 0 21 22 23 24 25 26 27 28 69' + dcols = '55 49 47 45 44 36 34 33 32 0 21 22 23 24 25 26 27 28 69' endif * Perform Mathematics if necessary @@ -210,6 +247,22 @@ endif * Top Panel * --------- 'set parea 1.5 7.0 7.70 10.50' + + 'set gxout stat' + 'd modg' + qmodminmax = sublin(result,8) + qmodmin = subwrd(qmodminmax,4) + qmodmax = subwrd(qmodminmax,5) + say 'QMOD_Max Value: 'qmodmax + say 'QMOD_Min Value: 'qmodmin + 'set gxout shaded' + 'd abs('qmodmin')' + aqmodmin = subwrd(result,4) + 'd abs('qmodmax')' + aqmodmax = subwrd(result,4) + if( aqmodmin > aqmodmax ) ; aqmodmax = aqmodmin ; endif + say 'Absolute QMOD_MAX: ' aqmodmax + ntop = 0 say 'TOP CLEVS: 'dlevs say 'TOP CCOLS: 'dcols @@ -221,12 +274,31 @@ else 'stats difg' avgdif = subwrd(result,1) stddif = subwrd(result,2) - say 'AVGDIF: 'avgdif - say 'STDDIF: 'stddif - qmax = stddif/3 - say ' QMAX: 'qmax - if( qmax > 0 ) - 'd log10('qmax')' + +say 'avgdif = 'avgdif +say 'stddif = 'stddif + dqmax = stddif/3 + + dqrel = dqmax / aqmodmax * 100 + +say 'dqrel = 'dqrel + 'getint 'dqrel*100 + dqrel = result/100 +say 'dqrel = 'dqrel + + dpct = 0.1 + say 'Absolute DQMAX: 'dqmax' QMOD_MAX: 'aqmodmax + say 'Relative Percent Difference: 'dqrel' (100*DQMAX/QMOD_MAX)' + say ' Default Percent Difference for Plots: 'dpct + + if( dqrel < dpct ) + dqrel = dpct + endif + dqmax = dqrel * aqmodmax / 100 + say 'Setting Diff CINT using Relative Percent Difference: 'dqrel'% dqmax = 'dqmax + + if( dqmax > 0 ) + 'd log10('dqmax')' ntop = subwrd(result,4) else ntop = 0 @@ -242,14 +314,27 @@ else ntop = ntop+2 endif endif + + if( fixpltfact != NULL ) + 'd 'fixpltfact + ntop = subwrd(result,4) + endif say 'Diff Scaling Factor: 'ntop + + if( fixpltcint != NULL ) + 'd 'fixpltcint + fixpltcint = subwrd(result,4) + cint = fixpltcint + else if( ntop < 0 ) ztop = -1 * ntop - 'd 'qmax'*1e'ztop + 'd 'dqmax'*1e'ztop else - ' d 'qmax'/1e'ntop + ' d 'dqmax'/1e'ntop endif - cint = subwrd(result,4) + cint = subwrd(result,4) + endif + say 'TOP CINT: 'cint 'shades 'cint if( ntop < 0 ) @@ -260,12 +345,29 @@ else endif 'd difg' endif + + 'set gxout stat' + 'd difg' + mdifminmax = sublin(result,8) + mdifmin = subwrd(mdifminmax,4) + mdifmax = subwrd(mdifminmax,5) + say 'MDIF_Max Value: 'mdifmax + say 'MDIF_Min Value: 'mdifmin + 'set gxout shaded' + 'd abs('mdifmin')' + amdifmin = subwrd(result,4) + 'd abs('mdifmax')' + amdifmax = subwrd(result,4) + if( amdifmin > amdifmax ) ; amdifmax = amdifmin ; endif + say 'Absolute MDIF_MAX: ' amdifmax + 'set parea 0 8.5 7.0 11' 'cbarn -vert' * Middle Panel * ------------ 'set parea 1.5 7.0 4.30 7.10' + nmid = 0 if( dcols != NULL & dlevs != NULL ) 'set clevs 'dlevs @@ -283,17 +385,66 @@ else 'd cifg' endif + 'set gxout stat' + 'd cifg' + qobsminmax = sublin(result,8) + qobsmin = subwrd(qobsminmax,4) + qobsmax = subwrd(qobsminmax,5) + say 'QOBS_Max Value: 'qobsmax + say 'QOBS_Min Value: 'qobsmin + 'set gxout shaded' + 'd abs('qobsmin')' + aqobsmin = subwrd(result,4) + 'd abs('qobsmax')' + aqobsmax = subwrd(result,4) + if( aqobsmin > aqobsmax ) ; aqobsmax = aqobsmin ; endif + say 'Absolute QOBS_MAX: ' aqobsmax + * Bottom Panel * ------------ 'set parea 1.5 7.0 0.90 3.70' + 'define closeness = abs(difg)-abs(cifg)' + 'set gxout stat' + 'd closeness' + closminmax = sublin(result,8) + closmin = subwrd(closminmax,4) + closmax = subwrd(closminmax,5) + say 'CLOSE_Max Value: 'closmax + say 'CLOSE_Min Value: 'closmin + 'set gxout shaded' + 'd abs('closmin')' + aclosmin = subwrd(result,4) + 'd abs('closmax')' + aclosmax = subwrd(result,4) + if( aclosmin > aclosmax ) ; aclosmax = aclosmin ; endif + say 'Absolute CLOSE_MAX: ' aclosmax + 'stats closeness' avgdif = subwrd(result,1) stddif = subwrd(result,2) - qmax = stddif/3 - if( qmax > 0 ) - 'd log10('qmax')' + dqmax = stddif/3 + + dqrel = dqmax / amdifmax * 100 +say 'raw dqrel = 'dqrel + 'getint 'dqrel*100 + dqrel = result/100 +say 'int dqrel = 'dqrel + + dpct = 0.1 + say 'DQMAX: 'dqmax' QMOD_MAX: 'amdifmax + say 'Relative Percent Difference: 'dqrel' (100*DQMAX/QMOD_MAX)' + say ' Default Percent Difference for Plots: 'dpct + + if( dqrel < dpct ) + dqrel = dpct + endif + dqmax = dqrel * amdifmax / 100 + say 'Setting Diff CINT using Relative Percent Difference: 'dqrel'% dqmax = 'dqmax + + if( dqmax > 0 ) + 'd log10('dqmax')' n = subwrd(result,4) else n = 0 @@ -309,15 +460,29 @@ endif n = n+2 endif endif + + if( clspltfact != NULL ) + 'd 'clspltfact + n = subwrd(result,4) + endif say 'Diff Scaling Factor: 'n + + if( clspltcint != NULL ) + 'd 'clspltcint + clspltcint = subwrd(result,4) + cint = clspltcint + else if( n < 0 ) ztop = -1 * n - 'd 'qmax'*1e'ztop + 'd 'dqmax'*1e'ztop else - 'd 'qmax'/1e'n + 'd 'dqmax'/1e'n endif - cint = subwrd(result,4) + cint = subwrd(result,4) + endif + 'shades 'cint + if( n < 0 ) ztop = -1 * n 'define closeness = closeness*1e'ztop @@ -345,7 +510,7 @@ endif 'set string 1 c 6' 'set strsiz .125' -if( level = '' ) +if( level = '' | level = 0 ) 'draw string 4.25 10.85 'math' 'title else 'draw string 4.25 10.85 'level'-mb 'math' 'title @@ -372,8 +537,13 @@ else 'draw string 4.25 7.22 'cdesc' - 'oname' 'season' ('nobs') ('climate')' endif -if( n != 0 ) - 'draw string 4.25 3.80 Closeness to 'oname': ABS(Top)-ABS(Middle) (x 10**'n')' +*if( n != 0 ) +if( ntop != 0 ) + if( ntop>0 ) + 'draw string 4.25 3.80 Closeness to 'oname': ABS(Top)-ABS(Middle) (x 10**-'ntop')' + else + 'draw string 4.25 3.80 Closeness to 'oname': ABS(Top)-ABS(Middle) (x 10**'ntop')' + endif else 'draw string 4.25 3.80 Closeness to 'oname': ABS(Top)-ABS(Middle)' endif @@ -397,17 +567,35 @@ eyearo = subwrd(date,2) 'set string 1 l 4' 'set strsiz .08' -'draw string 0.050 10.50 Beg: 'bmnthm' 'byearm -'draw string 0.050 10.35 End: 'emnthm' 'eyearm -'draw string 0.050 7.10 Beg: 'bmntho' 'byearo -'draw string 0.050 6.95 End: 'emntho' 'eyearo - -'draw string 0.050 9.85 Mean: 'avgmod -'draw string 0.050 9.70 Std: 'stdmod -'draw string 0.050 6.45 Mean: 'avgobs -'draw string 0.050 6.30 Std: 'stdobs -'draw string 0.050 3.05 Mean: 'avgdif -'draw string 0.050 2.90 Std: 'stddif +'draw string 0.050 10.30 Beg: 'bmnthm' 'byearm +'draw string 0.050 10.15 End: 'emnthm' 'eyearm +'draw string 0.050 9.85 Max: 'mdifmax +'draw string 0.050 9.70 Min: 'mdifmin +'draw string 0.050 9.40 Mean: 'avgmod +'draw string 0.050 9.25 Std: 'stdmod + +'draw string 0.050 6.90 Beg: 'bmntho' 'byearo +'draw string 0.050 6.75 End: 'emntho' 'eyearo +'draw string 0.050 6.45 Max: 'qobsmax +'draw string 0.050 6.30 Min: 'qobsmin +'draw string 0.050 6.00 Mean: 'avgobs +'draw string 0.050 5.85 Std: 'stdobs + +'draw string 0.050 3.50 Beg: 'bmnthm' 'byearm +'draw string 0.050 3.35 End: 'emnthm' 'eyearm +'draw string 0.050 3.05 Max: 'closmax +'draw string 0.050 2.90 Min: 'closmin +'draw string 0.050 2.60 Mean: 'avgdif +'draw string 0.050 2.45 Std: 'stddif + +*if( CINTDIFF != 'NULL' ) + 'set strsiz .07' + 'draw string 0.050 1.77 Plot represents' + 'draw string 0.050 1.62 values > 'dqrel' %' + 'draw string 0.050 1.47 Relative Difference' + 'draw string 0.050 1.32 ( DQ/QMax )' +*endif + 'set mproj latlon' return diff --git a/GEOS_Util/plots/grads_util/corcmp_plot.gs b/GEOS_Util/plots/grads_util/corcmp_plot.gs index 489a7f95..fa1f18d4 100644 --- a/GEOS_Util/plots/grads_util/corcmp_plot.gs +++ b/GEOS_Util/plots/grads_util/corcmp_plot.gs @@ -169,6 +169,7 @@ endwhile * ------------------------------- month = '' months = '' +season = '' n = filebeg while ( n <= fileend ) 'set dfile 'n @@ -178,14 +179,59 @@ while ( n <= fileend ) dummy = substr(date,6,3) if( dummy != month ) month = dummy + if( months = '' ) months = month else months = months'-'month - endif - endif + endif + + if( months = 'DEC-JAN-FEB' ) + if( season = '' ) + season = 'DJF' + else + season = season'-DJF' + endif + months = '' + endif + + if( months = 'MAR-APR-MAY' ) + if( season = '' ) + season = 'MAM' + else + season = season'-MAM' + endif + months = '' + endif + + if( months = 'JUN-JUL-AUG' ) + if( season = '' ) + season = 'JJA' + else + season = season'-JJA' + endif + months = '' + endif + + if( months = 'SEP-OCT-NOV' ) + if( season = '' ) + season = 'SON' + else + season = season'-SON' + endif + months = '' + endif + + endif n = n + 1 endwhile +if( season != '' ) + if( months != '' ) + months = season'-'months + else + months = season + endif +endif say 'Months Used in Forecasts: 'months * Define NDAY and NDAYMAX across ALL Experiments diff --git a/GEOS_Util/plots/grads_util/corcmpz_plot.gs b/GEOS_Util/plots/grads_util/corcmpz_plot.gs index 6a891cf8..47317b8d 100644 --- a/GEOS_Util/plots/grads_util/corcmpz_plot.gs +++ b/GEOS_Util/plots/grads_util/corcmpz_plot.gs @@ -166,6 +166,7 @@ endwhile * ------------------------------- month = '' months = '' +season = '' n = filebeg while ( n <= fileend ) 'set dfile 'n @@ -175,19 +176,65 @@ while ( n <= fileend ) dummy = substr(date,6,3) if( dummy != month ) month = dummy + if( months = '' ) months = month else months = months'-'month - endif - endif + endif + + if( months = 'DEC-JAN-FEB' ) + if( season = '' ) + season = 'DJF' + else + season = season'-DJF' + endif + months = '' + endif + + if( months = 'MAR-APR-MAY' ) + if( season = '' ) + season = 'MAM' + else + season = season'-MAM' + endif + months = '' + endif + + if( months = 'JUN-JUL-AUG' ) + if( season = '' ) + season = 'JJA' + else + season = season'-JJA' + endif + months = '' + endif + + if( months = 'SEP-OCT-NOV' ) + if( season = '' ) + season = 'SON' + else + season = season'-SON' + endif + months = '' + endif + + endif n = n + 1 endwhile +if( season != '' ) + if( months != '' ) + months = season'-'months + else + months = season + endif +endif say 'Months Used in Forecasts: 'months + * Define TOPLEV, NDAY and NDAYMAX across ALL Experiments * ------------------------------------------------------ - toplev = 1000 + toplev = 0 ndaymax = 999 m = 0 while( m<=mexps ) @@ -200,7 +247,7 @@ while( m<=mexps ) 'set z 'zdim 'getinfo level' level = result - if( level < toplev ) + if( level > toplev ) toplev = level endif @@ -887,57 +934,58 @@ if( level >= levmin ) zcnt = zcnt + 1 'minmax rave0' -maxval = subwrd(result,1) +if( subwrd(result,1) != 1e+15 ) + maxval = subwrd(result,1) minval = subwrd(result,2) -axmax = 1.08 * maxval + axmax = 1.08 * maxval axmin = 0.92 * minval -'set vpage off' -'set parea off' -'set grads off' -'set parea 2.25 9.75 4.0 7.5' -'set axlim 'axmin' 'axmax -'d rave0' -'d rave1' + 'set vpage off' + 'set parea off' + 'set grads off' + 'set parea 2.25 9.75 4.0 7.5' + 'set axlim 'axmin' 'axmax + 'd rave0' + 'd rave1' 'q gr2xy 1 1' - xval = subwrd(result,3) - yval = subwrd(result,6) - - if( xval != environment ) - - say 'xval = 'xval - say 'yval = 'yval - say 'GR2XY Result, xval:yval = 'result - 'set line 2 1 3' - 'draw line 'xval' 'yval' 4 'yval + xval = subwrd(result,3) + yval = subwrd(result,6) + + if( xval != environment ) + say 'xval = 'xval + say 'yval = 'yval + say 'GR2XY Result, xval:yval = 'result + 'set line 2 1 3' + 'draw line 'xval' 'yval' 4 'yval yval = yval - 0.03 - say 'New yval = 'yval - 'q xy2gr 'xval' 'yval - say 'XY2GR Result: 'result + say 'New yval = 'yval + 'q xy2gr 'xval' 'yval + say 'XY2GR Result: 'result thickness.xpos.z = 1.0 - subwrd(result,6) - thickness.xpos.z = thickness.xpos.z * 1000 - zsum = zsum + thickness.xpos.z - if( thickness.xpos.z > zmax ) ; zmax = thickness.xpos.z ; endif - if( thickness.xpos.z < zmin ) ; zmin = thickness.xpos.z ; endif - 'set line 3 1 3' - 'draw line 3.5 'yval' 7.5 'yval - say ' ' - say 'z = 'z' Level: 'level' LEVMIN: 'levmin' LINE_THICKNESS x 1000 = 'thickness.xpos.z - say 'zmin = 'zmin' zmax = 'zmax' zsum = 'zsum - say ' ' - say 'Hit Enter to Continue ...' - pull flag - 'c' - - else - zsum = 0 - zmin = 0 - endif + thickness.xpos.z = thickness.xpos.z * 1000 + zsum = zsum + thickness.xpos.z + if( thickness.xpos.z > zmax ) ; zmax = thickness.xpos.z ; endif + if( thickness.xpos.z < zmin ) ; zmin = thickness.xpos.z ; endif + 'set line 3 1 3' + 'draw line 3.5 'yval' 7.5 'yval + say ' ' + say 'z = 'z' Level: 'level' LEVMIN: 'levmin' LINE_THICKNESS x 1000 = 'thickness.xpos.z + say 'zmin = 'zmin' zmax = 'zmax' zsum = 'zsum + say ' ' + say 'Hit Enter to Continue ...' + pull flag + 'c' + else + zsum = 0 + zmin = 0 + endif +endif endif z = z + 1 endwhile + zsum = zsum / zcnt say 'Average zthick = 'zsum diff --git a/GEOS_Util/plots/grads_util/gencmp.gs b/GEOS_Util/plots/grads_util/gencmp.gs index dea61f2a..7c6628dd 100644 --- a/GEOS_Util/plots/grads_util/gencmp.gs +++ b/GEOS_Util/plots/grads_util/gencmp.gs @@ -298,6 +298,8 @@ endif dummy = get_cmpexp (cmpexp,numexp) exp = subwrd(dummy,1) type = subwrd(dummy,2) + exp.numexp = exp + type.numexp = type while( exp != 'NULL' ) say ' ' @@ -308,20 +310,39 @@ say 'Comparing with: 'exp * analysis = true EXP=A CMP=A => ALEVS * analysis = true EXP=A CMP=M => DLEVS +* INPUT Experiment is an Analysis +********************************* if( analysis != "false" ) - if( type = A ) + if( type = A | type = V ) +* CMP Experiment is an Analysis 'run setenv "LEVTYPE" 'ALEVS + 'run setenv "DIFFTYPE" 'A + else +* CMP Experiment is an Model 'run setenv "LEVTYPE" 'DLEVS + 'run setenv "DIFFTYPE" 'D endif + else + +* INPUT Experiment is a Model +********************************* if( type = A ) +* CMP Experiment is an Analysis 'run setenv "LEVTYPE" 'DLEVS + 'run setenv "DIFFTYPE" 'D + else +* CMP Experiment is an Model 'run setenv "LEVTYPE" 'ALEVS + 'run setenv "DIFFTYPE" 'A endif + endif +* ------------------------------------------------------ + '!chckfile 'exp'/.HOMDIR' 'run getenv CHECKFILE' CHECKFILE = result @@ -340,12 +361,15 @@ endif oexp = 0 m = 1 while ( m <= numGCs ) -'run getvar 'EXPORT.m' 'GC.m' 'exp + 'run getvar 'EXPORT.m' 'GC.m' 'exp oname.numexp.m = subwrd(result,1) obsfile.numexp.m = subwrd(result,2) oscale.numexp.m = subwrd(result,3) obsdsc.numexp.m = subwrd(result,4) obsnam.numexp.m = subwrd(result,5) + + say "Looping CMPEXPs, numexp = "numexp" obsnam.numexp."m" = "obsnam.numexp.m" numGCS = "numGCs + say if( STAT = "STD" ) oname.numexp.m = 'VAR_'oname.numexp.m endif @@ -370,10 +394,11 @@ while ( m <= numGCs ) else if( OPT.m = 'FALSE' ) found = FALSE - endif + endif endif m = m + 1 endwhile + if( STAT = "RMS" | STAT = "BIAS" ) oexp = oexp + 1 endif @@ -500,95 +525,103 @@ endif * Check next Comparison Experiment Dataset * ---------------------------------------- - numexp = numexp + 1 - dummy = get_cmpexp (cmpexp,numexp) - exp = subwrd(dummy,1) - type = subwrd(dummy,2) + numexp = numexp + 1 + dummy = get_cmpexp (cmpexp,numexp) + exp = subwrd(dummy,1) + type = subwrd(dummy,2) + exp.numexp = exp + type.numexp = type endwhile numexp = numexp - 1 '!/bin/mv HISTORY.Tmp HISTORY.T' -* --------------------------------------------------------- +* --------------------------------------------------------------------------- * Now that we have computed plots for each experiment, -* we can compute the Closeness plots to MERRA-2 -* --------------------------------------------------------- - -* Find MERRA2 experiment -* ---------------------- - MERRA2 = 0 - n = 1 -while( n <= numexp ) -say "obsnam.numexp.1 = "n" "obsnam.numexp.1 -if( obsnam.numexp.1 = "MERRA-2" ) - MERRA2 = n -endif - n = n + 1 -endwhile -say "MERRA2 = "MERRA2 +* we can compute the Closeness plots to MERRA-2 and any CMPEXP ending with :V +* --------------------------------------------------------------------------- + + k = 1 +while( k <= numexp ) + cname.k = oname.k.1 + ctag.k = obsnam.k.1 +say 'Looping through experiments, k = 'k' CTAG = 'ctag.k' TYPE = 'type.k -if( MERRA2 != 0 ) +if( ( ctag.k = "MERRA-2" | type.k = V ) & cname.k != 'NULL' ) + TAG = k + say 'Performing Closeness plots to: 'ctag.TAG' k = 'k * Loop over Seasons to Process * ---------------------------- m = 1 while( m > 0 ) season = subwrd(seasons,m) + if( season = '' ) m = -1 else m = m+1 - say 'Processing Season: 'season + say 'm = 'm' Processing Season: 'season 'set dfile 'qfile.1 'set gxout shaded' 'rgbset' -'run setenv "LEVTYPE" 'DLEVS +'run getenv "DIFFTYPE"' + DIFFTYPE = result +'run setenv "LEVTYPE" 'DIFFTYPE'LEVS' + +* Horizontal Closeness Plot (Experiment_vs_Comparison to Verification) +* -------------------------------------------------------------------- + n = 1 + while( n <= numexp ) + say 'n = 'n' Testing 'qtag.1' and 'ctag.n' for closeness with 'ctag.TAG + + if( ctag.n != "merra" & ctag.n != "MERRA-2" & ctag.n != ctag.TAG & type.n != V & cname.n != 'NULL' ) + say 'Closeness plot between exp: 'qtag.1 + say ' cexp: 'ctag.n + say ' obs: 'ctag.TAG + say ' Total numexp: 'numexp + say '' + flag = "" + while ( flag = "" ) + + 'define zobs'TAG''season' = regrid2( obs'TAG''season',0.25,0.25,bs_p1,0,-90 )' + 'define zobs'n''season' = regrid2( obs'n''season' ,0.25,0.25,bs_p1,0,-90 )' + 'define zmod'season' = regrid2( mod'season' ,0.25,0.25,bs_p1,0,-90 )' + + 'closeness -CVAR 'zobs''n' -MVAR 'zmod' -OVAR 'zobs''TAG' -CNAME 'ctag.n' -MNAME 'EXPORT' -ONAME 'ctag.TAG' -CDESC 'obsdsc.n.1' -MDESC 'qdesc.1' -ODESC 'obsdsc.TAG.1' -MFILE 'qfile.1' -MBEGDATE 'begdate' -MENDDATE 'enddate' -OFILE 'obsfile.TAG.1' -OBEGDATE 'begdateo' -OENDDATE 'enddateo' -EXPID 'EXPID' -PREFIX 'NULL' -SEASON 'season' -OUTPUT 'OUTPUT' -CLIMATE 'climate' -GC 'GC.1' -MATH 'NULL' -LEVEL 'LEVEL + + 'myprint -name 'OUTPUT'/hdiag_'ctag.n'_'NAME'.'GC.1'_'LEVEL'_closeness_'ctag.TAG'.'season + + if( DEBUG = "debug" ) + say "Hit ENTER to repeat plot, or NON-BLANK to continue" + pull flag + else + flag = "next" + endif + 'c' + endwhile ;* END While_FLAG Loop + + endif :* END CTAG Test + + n = n + 1 + endwhile ;* END While_N Loop -* Closeness Plot (Experiment_vs_Comparison to MERRA-2) -* ---------------------------------------------------- - n = 1 -while( n <= numexp ) -if( obsnam.n.1 != "NULL" & obsnam.n.1 != "merra" & obsnam.n.1 != "MERRA-2" ) -say 'Closeness plot between exp: 'qtag.1 -say ' cexp: 'obsnam.n.1 -say ' obs: 'obsnam.MERRA2.1 -say '' - -'define zobs'MERRA2''season' = regrid2( obs'MERRA2''season',0.25,0.25,bs_p1,0,-90 )' -'define zobs'n''season' = regrid2( obs'n''season' ,0.25,0.25,bs_p1,0,-90 )' -'define zmod'season' = regrid2( mod'season' ,0.25,0.25,bs_p1,0,-90 )' - - flag = "" -while ( flag = "" ) - -'closeness -CVAR 'zobs''n' -MVAR 'zmod' -OVAR 'zobs''MERRA2' -CNAME 'obsnam.n.1' -MNAME 'NAME' -ONAME 'obsnam.MERRA2.1' -CDESC 'obsdsc.n.1' -MDESC 'qdesc.1' -ODESC 'obsdsc.MERRA2.1' -MFILE 'qfile.1' -MBEGDATE 'begdate' -MENDDATE 'enddate' -OFILE 'obsfile.MERRA2.1' -OBEGDATE 'begdateo' -OENDDATE 'enddateo' -EXPID 'EXPID' -PREFIX 'NULL' -SEASON 'season' -OUTPUT 'OUTPUT' -CLIMATE 'climate' -GC 'GC.1' -MATH 'NULL' -LEVEL 'LEVEL +* --------------- +endif ;* End Season Test -'myprint -name 'OUTPUT'/hdiag_'obsnam.n.1'_'NAME'.'GC.1'_'LEVEL'_closeness_'obsnam.MERRA2.1'.'season +* --------------- +endwhile ;* END SEASON Loop +endif ;* END Closeness If Test - if( DEBUG = "debug" ) - say "Hit ENTER to repeat plot, or NON-BLANK to continue" - pull flag - else - flag = "next" - endif -'c' -endwhile ;* END While_FLAG Loop -endif - n = n + 1 -endwhile ;* END While_N Loop +k = k + 1 +endwhile ;* END While_k Loop -* End Season Test -* --------------- -endif -* --------------- -endwhile ;* END While_m>0 Loop +return -endif ;* END MERRA-2 Test -return * Get Next EXP from CMPEXP List * ----------------------------- diff --git a/GEOS_Util/plots/grads_util/genplot.gs b/GEOS_Util/plots/grads_util/genplot.gs index 6ec88147..381a84aa 100644 --- a/GEOS_Util/plots/grads_util/genplot.gs +++ b/GEOS_Util/plots/grads_util/genplot.gs @@ -389,6 +389,8 @@ endif dummy = get_cmpexp (cmpexp,numexp) exp = subwrd(dummy,1) type = subwrd(dummy,2) + exp.numexp = exp + type.numexp = type while( exp != 'NULL' ) say ' ' @@ -399,20 +401,37 @@ say 'Comparing with: 'exp * analysis = true EXP=A CMP=A => ALEVS * analysis = true EXP=A CMP=M => DLEVS +* INPUT Experiment is an Analysis +********************************* if( analysis != "false" ) - if( type = A ) + if( type = A | type = V ) +* CMP Experiment is an Analysis 'run setenv "LEVTYPE" 'ALEVS + 'run setenv "DIFFTYPE" 'A + else +* CMP Experiment is an Model 'run setenv "LEVTYPE" 'DLEVS + 'run setenv "DIFFTYPE" 'D endif else + +* INPUT Experiment is a Model +********************************* if( type = A ) +* CMP Experiment is an Analysis 'run setenv "LEVTYPE" 'DLEVS + 'run setenv "DIFFTYPE" 'D + else +* CMP Experiment is an Model 'run setenv "LEVTYPE" 'ALEVS + 'run setenv "DIFFTYPE" 'A endif endif +* ------------------------------------------------------ + '!chckfile 'exp'/.HOMDIR' 'run getenv CHECKFILE' CHECKFILE = result @@ -616,29 +635,26 @@ endif dummy = get_cmpexp (cmpexp,numexp) exp = subwrd(dummy,1) type = subwrd(dummy,2) + exp.numexp = exp + type.numexp = type endwhile numexp = numexp - 1 '!/bin/mv HISTORY.Tmp HISTORY.T' -* --------------------------------------------------------- +* --------------------------------------------------------------------------- * Now that we have computed plots for each experiment, -* we can compute the Closeness plots to MERRA-2 -* --------------------------------------------------------- +* we can compute the Closeness plots to MERRA-2 and any CMPEXP ending with :V +* --------------------------------------------------------------------------- -* Find MERRA2 experiment -* ---------------------- - MERRA2 = 0 - n = 1 -while( n <= numexp ) -if( ctag.n.1 = "MERRA-2" ) - MERRA2 = n -endif - n = n + 1 -endwhile + k = 1 +while( k <= numexp ) +say 'Looping through experiments, k = 'k' CTAG = 'ctag.k.1' TYPE = 'type.k -if( MERRA2 != 0 ) +if( ( ctag.k.1 = "MERRA-2" | type.k = V ) & cname.k.1 != 'NULL' ) + TAG = k + say 'Performing Closeness plots to: 'ctag.TAG.1' k = 'k * Loop over Seasons to Process * ---------------------------- @@ -654,50 +670,64 @@ else 'set dfile 'qfile.1 'set gxout shaded' 'rgbset' -'run setenv "LEVTYPE" 'DLEVS +'run getenv "DIFFTYPE"' + DIFFTYPE = result +'run setenv "LEVTYPE" 'DIFFTYPE'LEVS' -* Horizontal Plot -* --------------- +* Horizontal Closeness Plot (Experiment_vs_Comparison to Verification) +* -------------------------------------------------------------------- mathparm = MATH while( mathparm != 'DONE' ) -* Closeness Plot (Experiment_vs_Comparison to MERRA-2) -* ---------------------------------------------------- n = 1 while( n <= numexp ) -if( ctag.n.1 != "NULL" & ctag.n.1 != "merra" & ctag.n.1 != "MERRA-2" ) -say 'Closeness plot between exp: 'qtag.1 -say ' cexp: 'ctag.n.1 -say ' obs: 'ctag.MERRA2.1 -say '' - flag = "" -while ( flag = "" ) -'closeness -CVAR 'cmod''n' -MVAR 'qmod' -OVAR 'cmod''MERRA2' -CNAME 'ctag.n.1' -MNAME 'NAME' -ONAME 'ctag.MERRA2.1' -CDESC 'cdesc.n.1' -MDESC 'qdesc.1' -ODESC 'cdesc.MERRA2.1' -MFILE 'qfile.1' -MBEGDATE 'begdate' -MENDDATE 'enddate' -OFILE 'cfile.MERRA2.1' -OBEGDATE 'begdateo' -OENDDATE 'enddateo' -EXPID 'EXPID' -PREFIX 'PREFIX' -SEASON 'season' -OUTPUT 'OUTPUT' -CLIMATE 'climate' -GC 'GC.1' -MATH 'mathparm + say 'n = 'n' Testing 'qtag.1' and 'ctag.n.1' for closeness with 'ctag.TAG.1 -if( mathparm != NULL ) - MTH = '_'mathparm -else - MTH = '' -endif -if( PREFIX != NULL ) - PFX = PREFIX'_' -else - PFX = '' -endif -'myprint -name 'OUTPUT'/'NAME''MTH'_'ctag.n.1'_closeness_'PFX''ctag.MERRA2.1'.'season + if( ctag.n.1 != "merra" & ctag.n.1 != "MERRA-2" & ctag.n.1 != ctag.TAG.1 & type.n != V & cname.n.1 != 'NULL' ) + say 'Closeness plot between exp: 'qtag.1 + say ' cexp: 'ctag.n.1 + say ' obs: 'ctag.TAG.1 + say ' Total numexp: 'numexp + say '' + + flag = "" + while ( flag = "" ) + + 'define zobs'TAG''season' = regrid2( cmod'TAG''season',0.25,0.25,bs_p1,0,-90 )' + 'define zobs'n''season' = regrid2( cmod'n''season' ,0.25,0.25,bs_p1,0,-90 )' + 'define zmod'season' = regrid2( qmod'season' ,0.25,0.25,bs_p1,0,-90 )' + + 'closeness -CVAR 'zobs''n' -MVAR 'zmod' -OVAR 'zobs''TAG' -CNAME 'ctag.n.1' -MNAME 'NAME' -ONAME 'ctag.TAG.1' -CDESC 'cdesc.n.1' -MDESC 'qdesc.1' -ODESC 'cdesc.TAG.1' -MFILE 'qfile.1' -MBEGDATE 'begdate' -MENDDATE 'enddate' -OFILE 'cfile.TAG.1' -OBEGDATE 'begdateo' -OENDDATE 'enddateo' -EXPID 'EXPID' -PREFIX 'PREFIX' -SEASON 'season' -OUTPUT 'OUTPUT' -CLIMATE 'climate' -GC 'GC.1' -MATH 'mathparm + + if( mathparm != NULL ) + MTH = '_'mathparm + else + MTH = '' + endif + if( PREFIX != NULL ) + PFX = PREFIX'_' + else + PFX = '' + endif + + 'myprint -name 'OUTPUT'/'NAME''MTH'_'ctag.n.1'_closeness_'PFX''ctag.TAG.1'.'season + + if( DEBUG = "debug" ) + say "Hit ENTER to repeat plot, or NON-BLANK to continue" + pull flag + else + flag = "next" + endif + + 'c' + endwhile ;* END While_FLAG Loop + + endif + +n = n + 1 +endwhile ;* END While n<=numexp Loop - if( DEBUG = "debug" ) - say "Hit ENTER to repeat plot, or NON-BLANK to continue" - pull flag - else - flag = "next" - endif -'c' -endwhile ;* END While_FLAG Loop -endif - n = n + 1 -endwhile ;* END While_N Loop if( mathparm != 'NULL' ) mathparm = 'NULL' else @@ -711,12 +741,15 @@ endif * --------------- endwhile ;* END While_m>0 Loop -endif ;* END MERRA-2 Test +endif ;* END CTAG Test + +k = k + 1 +endwhile ;* END While_k Loop if( cmpexp_only = TRUE ) ; return ; endif *********************************************************************************** -* Loop over Verification Datasets +* Loop over Observational Verification Datasets *********************************************************************************** 'getnumrc 'geosutil'/plots/'NAME @@ -1017,7 +1050,7 @@ endwhile ;* END While_FLAG Loop * --------------------------------------------------------- n = 1 while( n <= numexp ) -if( ctag.n.1 != "NULL" & ctag.n.1 != "merra" & ctag.n.1 != "MERRA-2" ) +if( ctag.n.1 != "NULL" & ctag.n.1 != "merra" & ctag.n.1 != "MERRA-2" & type.n != V ) say 'Closeness plot between exp: 'qtag.1 say ' cexp: 'ctag.n.1 say ' obs: 'otag.1 diff --git a/GEOS_Util/plots/grads_util/genplot_2G.gs b/GEOS_Util/plots/grads_util/genplot_2G.gs new file mode 100644 index 00000000..9708a69a --- /dev/null +++ b/GEOS_Util/plots/grads_util/genplot_2G.gs @@ -0,0 +1,1392 @@ +function genplot_2G (args) + +******************************************************* +**** INPUT Variables **** +******************************************************* + +***************************************************************************************************************************************************** +**** Note: Updates for genplot **** +**** ------------------- **** +**** **** +**** Original GOCART required HISTORY.rc to be written as 'EXPORT001' , 'GC' , for each output BIN001. **** +**** 'EXPORT002' , 'GC' , for each output BIN002. **** +**** 'EXPORT003' , 'GC' , for each output BIN003. **** +**** **** +**** GOCART_2G allowed HISTORY.rc to be written as 'EXPORT' , 'GC' which would automatically yield EXPORT001, EXPORT002, EXPORT003 **** +**** or, alternatively, HISTORY.rc to be written as 'EXPORT' , 'GC' , 'ALIAS1;ALIAS2,ALIAS3' which would yield ALIAS1, ALIAS2, ALIAS3 **** +**** **** +**** QUICKPLOT needs to be able to compare experiments derived from: GOCART vs GOCART, GOCART_2G vs GOCART_2G, and GOCART vs GOCART_2G **** +**** To accomplish this, genplot was modified to: **** +**** **** +**** 1) First check for EXPORT:GC as the OLD EXPORT and GC names **** +**** 2) Then check for EXPORT:GC:SUFFIX as the NEW EXPORT and GC names if OLD names are not found **** +**** **** +**** The SUFFIX is then used as an index to determine which ALIAS (if provided) to use, or ... **** +**** be concatentated with EXPORT to create the actual BIN name written to the output file. **** +**** **** +***************************************************************************************************************************************************** + + +'numargs 'args + numargs = result + +PREFIX = NULL +TAYLOR = FALSE +LAND = FALSE +OCEAN = FALSE +SCALE = 1.0 +RC = NULL +LEVEL = NULL +MATH = NULL + + mold = 0 + mnew = 0 + n = 0 + num = 0 +while ( num < numargs ) + num = num + 1 + +if( subwrd(args,num) = '-DIR' ) ; DIR = subwrd(args,num+1) ; endif +if( subwrd(args,num) = '-NAME' ) ; NAME = subwrd(args,num+1) ; endif +if( subwrd(args,num) = '-MATH' ) ; MATH = subwrd(args,num+1) ; endif +if( subwrd(args,num) = '-EXPID' ) ; EXPID = subwrd(args,num+1) ; endif +if( subwrd(args,num) = '-OUTPUT' ) ; OUTPUT = subwrd(args,num+1) ; endif +if( subwrd(args,num) = '-DEBUG' ) ; DEBUG = subwrd(args,num+1) ; endif +if( subwrd(args,num) = '-SCALE' ) ; SCALE = subwrd(args,num+1) ; endif +if( subwrd(args,num) = '-PREFIX' ) ; PREFIX = subwrd(args,num+1) ; endif +if( subwrd(args,num) = '-RC' ) ; RC = subwrd(args,num+1) ; endif +if( subwrd(args,num) = '-LEVEL' ) ; LEVEL = subwrd(args,num+1) ; endif +if( subwrd(args,num) = '-LAND' ) ; LAND = TRUE ; endif +if( subwrd(args,num) = '-OCEAN' ) ; OCEAN = TRUE ; endif +if( subwrd(args,num) = '-TAYLOR' ) ; TAYLOR = TRUE ; endif + +* Read Model EXPORT:GC +* -------------------- + m = mold +if( subwrd(args,num) = '-EXPORT' ) + m = m + 1 + OLD_EXPORT.m = subwrd(args,num+m ) + NEW_EXPORT.m = NULL + word = subwrd(args,num+m+1 ) + bit = checkbit(word) + while( bit != '-' ) + m = m + 1 + OLD_EXPORT.m = subwrd(args,num+m ) + NEW_EXPORT.m = NULL + word = subwrd(args,num+m+1 ) + bit = checkbit(word) + endwhile + +* Construct Model GCs from Model EXPORTS +* -------------------------------------- + numGCs = m + m = 0 + k = 1 + while ( k <= numGCs ) + EX = '' + j = 1 + bit = substr(OLD_EXPORT.k,j,1) + while(bit != ':' & bit != '') + EX = EX''bit + j = j + 1 + bit = substr(OLD_EXPORT.k,j,1) + endwhile + if( EX != OLD_EXPORT.k ) + m = m + 1 + j = j + 1 + OLD_GC.m = '' + bit = substr(OLD_EXPORT.k,j,1) + while(bit != '') + OLD_GC.m = OLD_GC.m''bit + j = j + 1 + bit = substr(OLD_EXPORT.k,j,1) + endwhile + OLD_EXPORT.k = EX + NEW_GC.k = NULL + endif + k = k + 1 + endwhile +endif + +* Read Alternate Model EXPORT:GC[:SUFFIX] +* --------------------------------------- + m = mnew +if( subwrd(args,num) = '-ALT_EXPORT' ) + say ' ' + say 'Reading ALT_EXPORTs' + say ' ' + m = m + 1 + ALT_EXPORT.m = subwrd(args,num+m ) + word = subwrd(args,num+m+1 ) + bit = checkbit(word) + say ' ALT_EXPORT.'m' 'ALT_EXPORT.m + + while( bit != '-' ) + m = m + 1 + ALT_EXPORT.m = subwrd(args,num+m ) + word = subwrd(args,num+m+1 ) + bit = checkbit(word) + say ' ALT_EXPORT.'m' 'ALT_EXPORT.m + endwhile + numGCs = m + + k = 1 + j = 2 + while( k <= numGCs ) + + '!remove NEW_EXPORT.txt' + '! echo 'ALT_EXPORT.k' | cut -d: -f1 > NEW_EXPORT.txt' + 'run getenv NEW_EXPORT' + NEW_EXPORT.k = result + + '!remove NEW_GC.txt' + '! echo 'ALT_EXPORT.k' | cut -d: -f2 > NEW_GC.txt' + 'run getenv NEW_GC' + NEW_GC.k = result + + '!remove SUFFIX.txt' + '! echo 'ALT_EXPORT.k' | grep : | cut -d: -f3 > SUFFIX.txt' + 'run getenv SUFFIX' + SUFFIX.k = result + + say ' NEW_EXPORT.'k': 'NEW_EXPORT.k + say ' NEW_GC.'k': 'NEW_GC.k + say ' SUFFIX.'k': 'SUFFIX.k + + if( SUFFIX.k = NULL ) + SUFFIX.k = '' + say 'Reset SUFFIX.'k': 'SUFFIX.k + endif + + k = k + 1 + endwhile + +endif + +* Read Verification OBS:OBSGC +* --------------------------- +if( subwrd(args,num) = '-OBS' ) + n = n + 1 + OBS.n = subwrd(args,num+n ) + word = subwrd(args,num+n+1 ) + bit = checkbit(word) + while( bit != '-' ) + n = n + 1 + OBS.n = subwrd(args,num+n ) + word = subwrd(args,num+n+1 ) + bit = checkbit(word) + endwhile +endif + +* Read SEASONS +* ----------- +if( subwrd(args,num) = '-SEASON' ) + seasons = '' + k = 1 + while( k > 0 ) + L = num + k + season = subwrd(args,L) + if( season = '' ) + k = -1 + else + bit = substr(season,1,1) + if( bit = '-' ) + k = -1 + else + seasons = seasons % ' ' % season + k = k+1 + endif + endif + endwhile +endif + +endwhile + + +* Construct OBS GCs from OBS EXPORTS +* ---------------------------------- + numn = n +if( numn = 0 ) + +* Set OBS and OBSGC based on Original (OLD) Model EXPORTS and GC +* -------------------------------------------------------------- + numn = numGCs + n = 1 + while ( n <= numn ) + OBS.n = OLD_EXPORT.n + OBSGC.n = OLD_GC.n + n = n + 1 + endwhile + +else + m = 0 + k = 1 +while ( k <= numn ) + EX = '' + j = 1 + bit = substr(OBS.k,j,1) + while(bit != ':' & bit != '') + EX = EX''bit + j = j + 1 + bit = substr(OBS.k,j,1) + endwhile + if( EX != OBS.k ) + m = m + 1 + j = j + 1 + OBSGC.m = '' + bit = substr(OBS.k,j,1) + while(bit != '') + OBSGC.m = OBSGC.m''bit + j = j + 1 + bit = substr(OBS.k,j,1) + endwhile + OBS.k = EX + endif +k = k + 1 +endwhile +endif + +************************************************** +************************************************** + +* Initialize +* ---------- +'reinit' +'set display color white' +'set clab off' +'c' + +'run getenv "GEOSUTIL"' + geosutil = result + +'run getenv "VERIFICATION"' + verification = result + +'run uppercase 'seasons + seasons = result + +'run getenv "CMPEXP_ONLY"' + cmpexp_only = result + +************************************************** +**** Echo Calling Sequence **** +************************************************** + +say ' ' +say 'NAME = 'NAME +say 'EXPID = 'EXPID +say 'OUTPUT = 'OUTPUT +say 'DEBUG = 'DEBUG +say 'SCALE = 'SCALE +say 'RC = 'RC +say 'LAND = 'LAND +say 'OCEAN = 'OCEAN +say 'TAYLOR = 'TAYLOR +say 'SEASON = 'seasons +say ' ' + +************************************************** +************************************************** + +* Get Model Variables +* ------------------- + m = 1 +while ( m <= numGCs ) + say 'run 1st call to getvar_2G for SOURCE, orig EXPORT: 'OLD_EXPORT.m' orig GC: 'OLD_GC.m + 'run getvar_2G 'OLD_EXPORT.m' 'OLD_GC.m + qname.m = subwrd(result,1) + qfile.m = subwrd(result,2) + qscal.m = subwrd(result,3) + qdesc.m = subwrd(result,4) + qtag.m = subwrd(result,5) + EXPORT.m = OLD_EXPORT.m + GC.m = OLD_GC.m + say 'qname from first getvar call = 'qname.m + +* If OLD_EXPORT is not found, try searching for NEW_EXPORT +* -------------------------------------------------------- + if( qname.m = 'NULL' ) + say ' ' + if( SUFFIX.m = '' ) + say 'run 2nd call to getvar_2G for SOURCE, alt EXPORT: 'NEW_EXPORT.m' alt_GC: 'NEW_GC.m + 'run getvar_2G 'NEW_EXPORT.m' 'NEW_GC.m + else + say 'run 2nd call to getvar_2G for SOURCE, alt EXPORT:SUFFIX 'NEW_EXPORT.m':'SUFFIX.m' alt_GC: 'NEW_GC.m + 'run getvar_2G 'NEW_EXPORT.m':'SUFFIX.m' 'NEW_GC.m + endif + qname.m = subwrd(result,1) + qfile.m = subwrd(result,2) + qscal.m = subwrd(result,3) + qdesc.m = subwrd(result,4) + qtag.m = subwrd(result,5) + say 'qname from second getvar call = 'qname.m + if( SUFFIX.m = '' ) + EXPORT.m = NEW_EXPORT.m + else + EXPORT.m = NEW_EXPORT.m':'SUFFIX.m + endif + GC.m = NEW_GC.m + if( qname.m = 'NULL' ) + return + endif + endif +m = m + 1 +endwhile + + +m = 1 +while( m<=numGCs ) + say 'EXPORT.'m' = 'EXPORT.m + say ' GC.'m' = 'GC.m +m = m + 1 +endwhile + +say ' ' +n = 1 +while( n<=numn ) + say ' OBS.'n' = 'OBS.n + say ' OBSGC.'n' = 'OBSGC.n +n = n + 1 +endwhile +say ' ' + + +* Set proper ZDIM +* --------------- + 'set dfile 'qfile.1 + 'getlevs 'qname.1 + nlevs = result +if( nlevs != 'NULL' ) + 'run setenv "ZDIM" 'nlevs +endif + + +* Ensure NAMES have no underscores +* -------------------------------- + m=1 +while ( m ALEVS +* analysis = false EXP=M CMP=A => DLEVS +* analysis = true EXP=A CMP=A => ALEVS +* analysis = true EXP=A CMP=M => DLEVS + +* INPUT Experiment is an Analysis +********************************* +if( analysis != "false" ) + if( type = A | type = V ) +* CMP Experiment is an Analysis + 'run setenv "LEVTYPE" 'ALEVS + 'run setenv "DIFFTYPE" 'A + + else +* CMP Experiment is an Model + 'run setenv "LEVTYPE" 'DLEVS + 'run setenv "DIFFTYPE" 'D + endif +else + +* INPUT Experiment is a Model +********************************* + if( type = A ) +* CMP Experiment is an Analysis + 'run setenv "LEVTYPE" 'DLEVS + 'run setenv "DIFFTYPE" 'D + + else +* CMP Experiment is an Model + 'run setenv "LEVTYPE" 'ALEVS + 'run setenv "DIFFTYPE" 'A + endif +endif + +* ------------------------------------------------------ + +'!chckfile 'exp'/.HOMDIR' + 'run getenv CHECKFILE' + CHECKFILE = result + if( CHECKFILE != 'NULL' ) + '!/bin/cp `cat 'exp'/.HOMDIR`/HISTORY.rc .' + else + '!/bin/cp 'exp'/HISTORY.rc .' + endif +'!remove CHECKFILE.txt' + +'!cat HISTORY.rc | sed -e "s/,/ , /g" | sed -e "s/*/@/g" > HISTORY.T' + +* Get EXP Comparison Variables +* ---------------------------- +FOUND = TRUE + m = 1 +while ( m <= numGCs & FOUND = TRUE ) + + say 'run 1st call to getvar_2G for CMPEXP, orig EXPORT: 'OLD_EXPORT.m' orig GC: 'OLD_GC.m + 'run getvar_2G 'OLD_EXPORT.m' 'OLD_GC.m' 'exp + cname.numexp.m = subwrd(result,1) + cfile.numexp.m = subwrd(result,2) + cscal.numexp.m = subwrd(result,3) + cdesc.numexp.m = subwrd(result,4) + ctag.numexp.m = subwrd(result,5) +say '' +* If OLD_EXPORT is not found, try searching for NEW_EXPORT +* -------------------------------------------------------- + if( cname.numexp.m = 'NULL' ) + if( SUFFIX.m = '' ) + say 'run 2nd call to getvar_2G for CMPEXP, alt EXPORT: 'NEW_EXPORT.m' alt_GC: 'NEW_GC.m + 'run getvar_2G 'NEW_EXPORT.m' 'NEW_GC.m' 'exp + else + say 'run 2nd call to getvar_2G for CMPEXP, alt EXPORT:SUFFIX 'NEW_EXPORT.m':'SUFFIX.m' alt_GC: 'NEW_GC.m + 'run getvar_2G 'NEW_EXPORT.m':'SUFFIX.m' 'NEW_GC.m' 'exp + endif + cname.numexp.m = subwrd(result,1) + cfile.numexp.m = subwrd(result,2) + cscal.numexp.m = subwrd(result,3) + cdesc.numexp.m = subwrd(result,4) + ctag.numexp.m = subwrd(result,5) +say '' + if( cname.numexp.m = 'NULL' ) + FOUND = FALSE + endif + endif + m = m + 1 +endwhile + +if( FOUND = TRUE ) +'setlons' +'setlats' + +* Land/Water Masks +* ---------------- +if( LAND = 'TRUE' | OCEAN = 'TRUE' ) + 'set dfile 'cfile.numexp.1 +if( LEVEL = "NULL" ) + 'set z 1' +else + 'set lev 'LEVEL +endif + 'set t 1' +* 'setmask obs' +* 'define lwmaskobs = regrid2( lwmaskobs,0.25,0.25,bs_p1,'lonmin','latmin')' + 'define lwmaskobs = lwmaskmod' + 'define omaskobs = maskout( 1, lwmaskobs-0.5 )' + 'define lmaskobs = maskout( 1, 0.5-lwmaskobs )' +endif + +'set dfile 'cfile.numexp.1 +if( LEVEL = "NULL" ) + 'set z 1' +else + 'set lev 'LEVEL +endif + 'getdates' + begdateo = subwrd(result,1) + enddateo = subwrd(result,2) + +* Perform OBS Formula Calculation +* ------------------------------- +if( numGCs = 1 ) + 'define cmod'numexp' = 'cname.numexp.1'.'cfile.numexp.1'*'cscal.numexp.1 +else + filename = geosutil'/plots/'NAME'/modform.gs' + ioflag = sublin( read(filename),1 ) + if(ioflag = 0) + close = close(filename) + cstring = '' + n = 1 + while ( n <= numGCs ) + cstring = cstring' 'cname.numexp.n'.'cfile.numexp.n'*'cscal.numexp.n + n = n + 1 + endwhile + 'run 'geosutil'/plots/'NAME'/modform 'cstring + 'define cmod'numexp' = qmod' + else + cstring = NAME + n = 1 + while ( n <= numGCs ) + ostring = ostring' 'cname.numexp.n'.'cfile.numexp.n'*'cscal.numexp.n + n = n + 1 + endwhile + 'run 'geosutil'/plots/'DIR'/'NAME'.gs 'ostring + 'define cmod'numexp' = 'NAME'.1' + endif +endif + +* Check for MERRA Resolution problem +* ---------------------------------- +'getinfo xdim' + xdim = result +if( xdim != 540 ) + + 'define cmod'numexp' = regrid2( cmod'numexp',0.25,0.25,bs_p1,'lonmin','latmin')' + if( LAND = 'TRUE' | OCEAN = 'TRUE' ) + if( LAND = 'TRUE' ) ; 'define cmod'numexp' = maskout( 'SCALE'*cmod'numexp',lmaskobs )' ; endif + if( OCEAN = 'TRUE' ) ; 'define cmod'numexp' = maskout( 'SCALE'*cmod'numexp',omaskobs )' ; endif + else + 'define cmod'numexp' = 'SCALE'*cmod'numexp + endif + +else + +* 'define cmod'numexp' = regrid2( cmod'numexp','dlon','dlat',bs_p1,'lonmin','latmin')' + 'define cmod'numexp' = regrid2( cmod'numexp',0.25,0.25,bs_p1,'lonmin','latmin')' + if( LAND = 'TRUE' | OCEAN = 'TRUE' ) + if( LAND = 'TRUE' ) ; 'define cmod'numexp' = maskout( 'SCALE'*cmod'numexp',lmaskobs )' ; endif + if( OCEAN = 'TRUE' ) ; 'define cmod'numexp' = maskout( 'SCALE'*cmod'numexp',omaskobs )' ; endif + else + 'define cmod'numexp' = 'SCALE'*cmod'numexp + endif + +endif + +* Compute Seasonal Means +* ---------------------- +'seasonal cmod'numexp + + +'run getenv "CLIMATE"' + climate = result + +* Loop over Seasons to Process +* ---------------------------- + m = 1 +while( m > 0 ) + season = subwrd(seasons,m) +if( season = '' ) + m = -1 +else + m = m+1 + say 'Processing Season: 'season + +'set dfile 'qfile.1 +'set gxout shaded' +'rgbset' + +* Horizontal Plot +* --------------- + mathparm = MATH +while( mathparm != 'DONE' ) + flag = "" +while ( flag = "" ) + +'makplot -MVAR 'qmod' -MNAME 'NAME ' -MFILE 'qfile.1' -MDESC 'qdesc.1' -MBEGDATE 'begdate' -MENDDATE 'enddate' -OVAR 'cmod''numexp' -ONAME 'ctag.numexp.1' -OFILE 'cfile.numexp.1' -ODESC 'cdesc.numexp.1' -OBEGDATE 'begdateo' -OENDDATE 'enddateo' -EXPID 'EXPID' -PREFIX 'PREFIX' -SEASON 'season' -OUTPUT 'OUTPUT' -CLIMATE 'climate' -GC 'GC.1' -MATH 'mathparm' -QNAME 'qname.1 + + if( DEBUG = "debug" ) + say "Hit ENTER to repeat plot, or NON-BLANK to continue" + pull flag + else + flag = "next" + endif +'c' +endwhile ;* END While_FLAG Loop + if( mathparm != 'NULL' ) + mathparm = 'NULL' + else + mathparm = 'DONE' + endif +endwhile ;* END While_MATH Loop + +* Zonal Mean Plot +* --------------- + mathparm = MATH +while( mathparm != 'DONE' ) + flag = "" +while ( flag = "" ) + +'makplotz -MVAR 'qmod' -MNAME 'NAME ' -MFILE 'qfile.1' -MDESC 'qdesc.1' -MBEGDATE 'begdate' -MENDDATE 'enddate' -OVAR 'cmod''numexp' -ONAME 'ctag.numexp.1' -OFILE 'cfile.numexp.1' -ODESC 'cdesc.numexp.1' -OBEGDATE 'begdateo' -OENDDATE 'enddateo' -EXPID 'EXPID' -PREFIX 'PREFIX' -SEASON 'season' -OUTPUT 'OUTPUT' -CLIMATE 'climate' -GC 'GC.1' -MATH 'mathparm' -RGFILE 'rgfile + + if( DEBUG = "debug" ) + say "Hit ENTER to repeat plot, or NON-BLANK to continue" + pull flag + else + flag = "next" + endif +'c' +endwhile ;* END While_FLAG Loop + if( mathparm != 'NULL' ) + mathparm = 'NULL' + else + mathparm = 'DONE' + endif +endwhile ;* END While_MATH Loop + + +* End Season Test +* --------------- +endif +* End Season Loop +* --------------- +endwhile +* End FOUND Test +* -------------- +endif + +* Check next Comparison Experiment Dataset +* ---------------------------------------- + numexp = numexp + 1 + dummy = get_cmpexp (cmpexp,numexp) + exp = subwrd(dummy,1) + type = subwrd(dummy,2) + exp.numexp = exp + type.numexp = type + +endwhile + numexp = numexp - 1 + +'!/bin/mv HISTORY.Tmp HISTORY.T' + +* --------------------------------------------------------------------------- +* Now that we have computed plots for each experiment, +* we can compute the Closeness plots to MERRA-2 and any CMPEXP ending with :V +* --------------------------------------------------------------------------- + + k = 1 +while( k <= numexp ) +say 'Looping through experiments, k = 'k' CTAG = 'ctag.k.1' TYPE = 'type.k + +if( ( ctag.k.1 = "MERRA-2" | type.k = V ) & cname.k.1 != 'NULL' ) + TAG = k + say 'Performing Closeness plots to: 'ctag.TAG.1' k = 'k + +* Loop over Seasons to Process +* ---------------------------- + m = 1 +while( m > 0 ) + season = subwrd(seasons,m) +if( season = '' ) + m = -1 +else + m = m+1 + say 'Processing Season: 'season + +'set dfile 'qfile.1 +'set gxout shaded' +'rgbset' +'run getenv "DIFFTYPE"' + DIFFTYPE = result +'run setenv "LEVTYPE" 'DIFFTYPE'LEVS' + +* Horizontal Closeness Plot (Experiment_vs_Comparison to Verification) +* -------------------------------------------------------------------- + mathparm = MATH +while( mathparm != 'DONE' ) + + n = 1 +while( n <= numexp ) + + say 'n = 'n' Testing 'qtag.1' and 'ctag.n.1' for closeness with 'ctag.TAG.1 + + if( ctag.n.1 != "merra" & ctag.n.1 != "MERRA-2" & ctag.n.1 != ctag.TAG.1 & type.n != V & cname.n.1 != 'NULL' ) + say 'Closeness plot between exp: 'qtag.1 + say ' cexp: 'ctag.n.1 + say ' obs: 'ctag.TAG.1 + say ' Total numexp: 'numexp + say '' + + flag = "" + while ( flag = "" ) + + 'define zobs'TAG''season' = regrid2( cmod'TAG''season',0.25,0.25,bs_p1,'lonmin','latmin' )' + 'define zobs'n''season' = regrid2( cmod'n''season' ,0.25,0.25,bs_p1,'lonmin','latmin' )' + 'define zmod'season' = regrid2( qmod'season' ,0.25,0.25,bs_p1,'lonmin','latmin' )' + + 'closeness -CVAR 'zobs''n' -MVAR 'zmod' -OVAR 'zobs''TAG' -CNAME 'ctag.n.1' -MNAME 'NAME' -ONAME 'ctag.TAG.1' -CDESC 'cdesc.n.1' -MDESC 'qdesc.1' -ODESC 'cdesc.TAG.1' -MFILE 'qfile.1' -MBEGDATE 'begdate' -MENDDATE 'enddate' -OFILE 'cfile.TAG.1' -OBEGDATE 'begdateo' -OENDDATE 'enddateo' -EXPID 'EXPID' -PREFIX 'PREFIX' -SEASON 'season' -OUTPUT 'OUTPUT' -CLIMATE 'climate' -GC 'GC.1' -MATH 'mathparm' -QNAME 'qname.1 + + if( mathparm != NULL ) + MTH = '_'mathparm + else + MTH = '' + endif + if( PREFIX != NULL ) + PFX = PREFIX'_' + else + PFX = '' + endif + + 'myprint -name 'OUTPUT'/'NAME''MTH'_'ctag.n.1'_closeness_'PFX''ctag.TAG.1'.'season + + if( DEBUG = "debug" ) + say "Hit ENTER to repeat plot, or NON-BLANK to continue" + pull flag + else + flag = "next" + endif + + 'c' + endwhile ;* END While_FLAG Loop + + endif + +n = n + 1 +endwhile ;* END While n<=numexp Loop + + if( mathparm != 'NULL' ) + mathparm = 'NULL' + else + mathparm = 'DONE' + endif +endwhile ;* END While_MATH Loop + +* End Season Test +* --------------- +endif +* --------------- +endwhile ;* END While_m>0 Loop + +endif ;* END CTAG Test + +k = k + 1 +endwhile ;* END While_k Loop + +if( cmpexp_only = TRUE ) ; return ; endif + +*********************************************************************************** +* Loop over Observational Verification Datasets +*********************************************************************************** + +'getnumrc 'geosutil'/plots/'NAME + rcinfo = result + numrc = subwrd( rcinfo,1 ) +say 'Initial RCINFO: 'rcinfo + +if( numrc = 0 ) + 'getnumrc 'geosutil'/plots/'DIR + rcinfo = result + numrc = subwrd( rcinfo,1 ) +say ' Final RCINFO: 'rcinfo +endif + + k = 1 +while( k <= numrc ) + loc = k + 1 + rcfile = subwrd( rcinfo,loc ) + RCFILE = rcfile + if(RC != 'NULL') ; RCFILE = geosutil'/plots/'NAME'/VERIFICATION.'RC'.rc' ; endif + if( RCFILE = rcfile ) + + say 'k = 'k' RCFILE = 'RCFILE + +* Check for VERIFICATION Formula File +* ----------------------------------- +'!remove OBSFORM.txt' +'!echo `basename 'RCFILE' | cut -d. -f2 > OBSFORM.txt`' +'run getenv OBSFORM' + OBSNAME = result + OBSFORM = OBSNAME'form.gs' + +say 'Checking for OBSFORM: 'geosutil'/plots/'NAME'/'OBSFORM + +'!remove CHECKFILE.txt' +'!chckfile 'geosutil'/plots/'NAME'/'OBSFORM + 'run getenv CHECKFILE' + CHECKFILE = result + +say 'CHECKFILE = 'CHECKFILE +if( CHECKFILE != 'NULL' ) + + LOBSFORM = 'TRUE' + 'run 'geosutil'/plots/'NAME'/'OBSFORM' -OBS' + OBS = result + say 'OBSFORM OBS: 'OBS + 'numargs 'OBS + numobs = result + say ' NUMOBS: 'numobs + +* Read Verification OBS:OBSGC +* --------------------------- + n = 1 + OBSNAME.n = subwrd(OBS,n ) + next = subwrd(OBS,n+1 ) + bit = checkbit(next) + say 'OBSNAME.'n': 'OBSNAME.n + while( bit != '' ) + n = n + 1 + OBSNAME.n = subwrd(OBS,n ) + next = subwrd(OBS,n+1 ) + bit = checkbit(next) + say 'OBSNAME.'n': 'OBSNAME.n + endwhile + +* Construct OBS GCs from OBS EXPORTS +* ---------------------------------- + m = 0 + n = 1 +while ( n <= numobs ) + EX = '' + j = 1 + bit = substr(OBSNAME.n,j,1) + while(bit != ':' & bit != '') + EX = EX''bit + j = j + 1 + bit = substr(OBSNAME.n,j,1) + endwhile + if( EX != OBSNAME.n ) + m = m + 1 + j = j + 1 + OBSNAMEGC.m = '' + bit = substr(OBSNAME.n,j,1) + while(bit != '') + OBSNAMEGC.m = OBSNAMEGC.m''bit + j = j + 1 + bit = substr(OBSNAME.n,j,1) + endwhile + OBSNAME.n = EX + endif +n = n + 1 +endwhile + +* Get Verification Variables +* -------------------------- +FOUND = TRUE + n = 1 +while ( n <= numobs & FOUND = TRUE ) +'run getobs 'OBSNAME.n' 'OBSNAMEGC.n' 'rcfile + oname.n = subwrd(result,1) + ofile.n = subwrd(result,2) + oscal.n = subwrd(result,3) + odesc.n = subwrd(result,4) + otag.n = subwrd(result,5) + +say 'VERIFICATION_EXPORT_name: 'oname.n +say ' description: 'odesc.n +say ' tag: ' otag.n +say ' file: 'ofile.n +say ' scaling: 'oscal.n +say '' + if( oname.n = 'NULL' ) ; FOUND = FALSE ; endif + n = n + 1 +endwhile + +* Save Original numn for other RCs +* -------------------------------- + numnorig = numn + numn = numobs + +else + + LOBSFORM = 'FALSE' + OBSFORM = 'obsform.gs' + +* Get Verification Variables +* -------------------------- +FOUND = TRUE + n = 1 +while ( n <= numn & FOUND = TRUE ) +'run getobs 'OBS.n' 'OBSGC.n' 'rcfile + oname.n = subwrd(result,1) + ofile.n = subwrd(result,2) + oscal.n = subwrd(result,3) + odesc.n = subwrd(result,4) + otag.n = subwrd(result,5) + +say 'VERIFICATION_EXPORT_name: 'oname.n +say ' description: 'odesc.n +say ' tag: ' otag.n +say ' file: 'ofile.n +say ' scaling: 'oscal.n +say '' + if( oname.n = 'NULL' ) ; FOUND = FALSE ; endif + n = n + 1 +endwhile + +endif + +if( FOUND = TRUE ) +'setlons' +'setlats' + +* Land/Water Masks +* ---------------- +if( LAND = 'TRUE' | OCEAN = 'TRUE' ) + 'set dfile 'ofile.1 +if( LEVEL = "NULL" ) + 'set z 1' +else + 'set lev 'LEVEL +endif + 'set t 1' + 'setmask obs' + 'define lwmaskobs = regrid2( lwmaskobs,0.25,0.25,bs_p1,'lonmin','latmin')' + 'define omaskobs = maskout( 1, lwmaskobs-0.5 )' + 'define lmaskobs = maskout( 1, 0.5-lwmaskobs )' +endif + + +'set dfile 'ofile.1 +if( LEVEL = "NULL" ) + 'set z 1' +else + 'set lev 'LEVEL +endif + 'getdates' + begdateo = subwrd(result,1) + enddateo = subwrd(result,2) + +* Perform OBS Formula Calculation +* ------------------------------- +if( numn = 1 ) + 'define qobs = 'oname.1'.'ofile.1'*'oscal.1 +else + filename = geosutil'/plots/'NAME'/'OBSFORM + ioflag = sublin( read(filename),1 ) + if(ioflag = 0) + close = close(filename) + ostring = '' + n = 1 + while ( n <= numn ) + ostring = ostring' 'oname.n'.'ofile.n'*'oscal.n + n = n + 1 + endwhile + 'run 'geosutil'/plots/'NAME'/'OBSFORM' 'ostring + else + ostring = NAME + n = 1 + while ( n <= numn ) + ostring = ostring' 'oname.n'.'ofile.n'*'oscal.n + n = n + 1 + endwhile + 'run 'geosutil'/plots/'DIR'/'NAME'.gs 'ostring + 'define qobs = 'NAME'.1' + endif +endif + +* Check for MERRA Resolution problem +* ---------------------------------- +'getinfo xdim' + xdim = result +if( xdim != 540 ) + + 'define qobs = regrid2( qobs,0.25,0.25,bs_p1,'lonmin','latmin')' + if( LAND = 'TRUE' | OCEAN = 'TRUE' ) + if( LAND = 'TRUE' ) ; 'define qobs = maskout( qobs,lmaskobs )' ; endif + if( OCEAN = 'TRUE' ) ; 'define qobs = maskout( qobs,omaskobs )' ; endif + endif + +else + +* 'define qobs = regrid2( qobs,'dlon','dlat',bs_p1,'lonmin','latmin')' + 'define qobs = regrid2( qobs,0.25,0.25,bs_p1,'lonmin','latmin')' + if( LAND = 'TRUE' | OCEAN = 'TRUE' ) + if( LAND = 'TRUE' ) ; 'define qobs = maskout( qobs,lmaskmod )' ; endif + if( OCEAN = 'TRUE' ) ; 'define qobs = maskout( qobs,omaskmod )' ; endif + endif + +endif + +* Compute Seaonal Means +* --------------------- +'seasonal qobs' + +'run getenv "CLIMATE"' + climate = result + + +* Perform Taylor Plots +* -------------------- +'set dfile 'qfile.1 +'run getenv "TAYLOR"' + taylor = result +if( taylor = 'true' & TAYLOR = 'TRUE' ) + +'taylor qmodmdjf qobsdjf djf 'EXPID +'taylor qmodmjja qobsjja jja 'EXPID +'taylor qmodmson qobsson son 'EXPID +'taylor qmodmmam qobsmam mam 'EXPID +'taylor qmodmann qobsann ann 'EXPID + +'taylor_write 'EXPID' 'NAME' 'OUTPUT +'taylor_read GFDL 'NAME' 'verification +'taylor_read CAM3 'NAME' 'verification +'taylor_read e0203 'NAME' 'verification + +"taylor_plt 4 CAM3 GFDL e0203 "EXPID" "OUTPUT" "NAME" '"EXPID" "NAME" vs "obsnam"' "DEBUG +endif + + +* Loop over Seasons to Process +* ---------------------------- + m = 1 +while( m > 0 ) + season = subwrd(seasons,m) +if( season = '' ) + m = -1 +else + m = m+1 + say 'Processing Season: 'season + +'set dfile 'qfile.1 +'set gxout shaded' +'rgbset' +'run setenv "LEVTYPE" 'DLEVS + +* Horizontal Plot +* --------------- + mathparm = MATH +while( mathparm != 'DONE' ) + +* Standard Plot (Experiment_vs_Verification) +* ------------------------------------------ + flag = "" +while ( flag = "" ) +'makplot -MVAR 'qmod' -MNAME 'NAME ' -MFILE 'qfile.1' -MDESC 'qdesc.1' -MBEGDATE 'begdate' -MENDDATE 'enddate' -OVAR 'qobs' -ONAME 'otag.1' -OFILE 'ofile.1' -ODESC 'odesc.1' -OBEGDATE 'begdateo' -OENDDATE 'enddateo' -EXPID 'EXPID' -PREFIX 'PREFIX' -SEASON 'season' -OUTPUT 'OUTPUT' -CLIMATE 'climate' -GC 'GC.1' -MATH 'mathparm' -QNAME 'qname.1 + if( DEBUG = "debug" ) + say "Hit ENTER to repeat plot, or NON-BLANK to continue" + pull flag + else + flag = "next" + endif +'c' +endwhile ;* END While_FLAG Loop + +* Closeness Plot (Experiment_vs_Comparison to Verification) +* --------------------------------------------------------- + n = 1 +while( n <= numexp ) +if( ctag.n.1 != "NULL" & ctag.n.1 != "merra" & ctag.n.1 != "MERRA-2" & type.n != V ) +say 'Closeness plot between exp: 'qtag.1 +say ' cexp: 'ctag.n.1 +say ' obs: 'otag.1 +say '' + flag = "" +while ( flag = "" ) +'closeness -CVAR 'cmod''n' -MVAR 'qmod' -OVAR 'qobs' -CNAME 'ctag.n.1' -MNAME 'NAME' -ONAME 'otag.1' -CDESC 'cdesc.n.1' -MDESC 'qdesc.1' -ODESC 'odesc.1' -MFILE 'qfile.1' -MBEGDATE 'begdate' -MENDDATE 'enddate' -OFILE 'ofile.1' -OBEGDATE 'begdateo' -OENDDATE 'enddateo' -EXPID 'EXPID' -PREFIX 'PREFIX' -SEASON 'season' -OUTPUT 'OUTPUT' -CLIMATE 'climate' -GC 'GC.1' -MATH 'mathparm' -QNAME 'qname.1 + +if( mathparm != NULL ) + MTH = '_'mathparm +else + MTH = '' +endif +if( PREFIX != NULL ) + PFX = PREFIX'_' +else + PFX = '' +endif +'myprint -name 'OUTPUT'/'NAME''MTH'_'ctag.n.1'_closeness_'PFX''otag.1'.'season + + if( DEBUG = "debug" ) + say "Hit ENTER to repeat plot, or NON-BLANK to continue" + pull flag + else + flag = "next" + endif +'c' +endwhile ;* END While_FLAG Loop + +endif + n = n + 1 +endwhile ;* END While_N Loop + if( mathparm != 'NULL' ) + mathparm = 'NULL' + else + mathparm = 'DONE' + endif +endwhile ;* END While_MATH Loop + +* Zonal Mean Plot +* --------------- + mathparm = MATH +while( mathparm != 'DONE' ) + flag = "" +while ( flag = "" ) + +'makplotz -MVAR 'qmod' -MNAME 'NAME ' -MFILE 'qfile.1' -MDESC 'qdesc.1' -MBEGDATE 'begdate' -MENDDATE 'enddate' -OVAR 'qobs' -ONAME 'otag.1' -OFILE 'ofile.1' -ODESC 'odesc.1' -OBEGDATE 'begdateo' -OENDDATE 'enddateo' -EXPID 'EXPID' -PREFIX 'PREFIX' -SEASON 'season' -OUTPUT 'OUTPUT' -CLIMATE 'climate' -GC 'GC.1' -MATH 'mathparm' -RGFILE 'rgfile + + if( DEBUG = "debug" ) + say "Hit ENTER to repeat plot, or NON-BLANK to continue" + pull flag + else + flag = "next" + endif +'c' +endwhile ;* END While_FLAG Loop + if( mathparm != 'NULL' ) + mathparm = 'NULL' + else + mathparm = 'DONE' + endif +endwhile ;* END While_MATH Loop + + +* End Season Test +* --------------- +endif +* End Season Loop +* --------------- +endwhile +* End FOUND Test +* -------------- +endif + + +* End RC=NULL Test +* ---------------- +endif +* Update Verification Loop Index +* ------------------------------ +k = k + 1 + +* Restore Original numn for other RCs +* ----------------------------------- +if( LOBSFORM = 'TRUE' ) + numn = numnorig +endif + +* End Verification Loop +* --------------------- +endwhile + + + +******************************************************* +**** No Verification Case **** +******************************************************* + +if( numrc = 0 ) + +* Loop over Seasons to Process +* ---------------------------- + m = 1 +while( m > 0 ) + season = subwrd(seasons,m) +if( season = '' ) + m = -1 +else + m = m+1 + say 'Processing Season: 'season + +'set dfile 'qfile.1 +'set gxout shaded' +'rgbset' + +* Horizontal Plot +* --------------- + flag = "" +while ( flag = "" ) + +'uniplot 'NAME' 'EXPID' 'PREFIX' 'season' 'OUTPUT' 'qfile.1' 'qdesc.1' 'begdate' 'enddate' 'begdateo' 'enddateo' 'climate + if( DEBUG = "debug" ) + say "Hit ENTER to repeat plot, or NON-BLANK to continue" + pull flag + else + flag = "next" + endif +'c' +endwhile + +* Zonal Mean Plot +* --------------- + flag = "" +while ( flag = "" ) +'uniplotz 'NAME' 'EXPID' 'PREFIX' 'season' 'OUTPUT' 'qfile.1' 'qdesc.1' 'begdate' 'enddate' 'begdateo' 'enddateo' 'climate + if( DEBUG = "debug" ) + say "Hit ENTER to repeat plot, or NON-BLANK to continue" + pull flag + else + flag = "next" + endif +'c' +endwhile + + +* End Season Test +* --------------- +endif +* End Season Loop +* --------------- +endwhile + + +* End Test for NUMRC +* ------------------ +endif +'quit' +return + +* Get Next EXP from CMPEXP List +* ----------------------------- +function get_cmpexp (cmpexp,num) + exp = subwrd(cmpexp,num) + len = get_length (exp) + bit = substr(exp,len-1,1) + if( bit = ":" ) + type = substr(exp,len,1) + exp = substr(exp,1,len-2) + else + type = M + endif +return exp' 'type + +function get_length (string) +tb = "" +i = 1 +while (i<=256) +blank = substr(string,i,1) +if( blank = tb ) +length = i-1 +i = 999 +else +i = i + 1 +endif +endwhile +return length + +* To Prevent Problem with BIT: E +* ------------------------------ +function checkbit (word) + bit = substr(word,1,1) + dum = bit'TEST' + if( dum = "ETEST" ) ; bit = A ; endif +return bit diff --git a/GEOS_Util/plots/grads_util/genplt.gs b/GEOS_Util/plots/grads_util/genplt.gs index 911760bc..8cf0859a 100644 --- a/GEOS_Util/plots/grads_util/genplt.gs +++ b/GEOS_Util/plots/grads_util/genplt.gs @@ -83,6 +83,11 @@ if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_CBSCALE' ; end if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_FACTOR' ; endif fact = result + 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_FIXED_PLOT_FACTOR' + fixpltfact = result + 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_FIXED_PLOT_CINT' + fixpltcint = result + 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_'level'_TITLE' if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_TITLE' ; endif title = result @@ -97,6 +102,10 @@ if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_'CLEVS ; endif if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_CLEVS' ; endif clevs = result + 'getresource 'PLOTRC' 'mname'_'GC'_'level'_DPCT' +if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'GC'_DPCT' ; endif + dpct = result + 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_REGRID' method = result 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_MASK' @@ -128,7 +137,10 @@ else endif if( cbscale = 'NULL' ) ; cbscale = 0.8 ; endif if( clab = 'NULL' ) ; clab = on ; endif +if( dpct = 'NULL' ) ; dpct = 0.1 ; endif + 'd 'dpct + dpct = subwrd(result,4) say '' say 'title: 'title say ' fact: ' fact @@ -240,21 +252,24 @@ say 'Analysis DLON: 'dlon 'define qobs = regrid2( qobs,0.25,0.25,bs_p1,'lonbeg','latbeg')' 'define qobs = maskout(qobs,maskm)' -m = 0 -if( ccols = NULL ) 'set gxout stat' 'd qmod' qminmax = sublin(result,8) qmin = subwrd(qminmax,4) qmax = subwrd(qminmax,5) - say 'Min Value: 'qmin - say 'Max Value: 'qmax + say 'QMin Value: 'qmin + say 'QMax Value: 'qmax 'set gxout shaded' 'd abs('qmin')' qmin = subwrd(result,4) 'd abs('qmax')' qmax = subwrd(result,4) if( qmin > qmax ) ; qmax = qmin ; endif + + say 'Absolute QMAX: 'qmax + +m = 0 +if( ccols = NULL ) if( qmax > 0 ) 'd log10('qmax')' m = subwrd(result,4) @@ -294,6 +309,21 @@ endif 'set parea 1.5 7.0 7.70 10.50' 'set grads off' + 'set gxout stat' + 'd qmod' + qmodminmax = sublin(result,8) + qmodmin = subwrd(qmodminmax,4) + qmodmax = subwrd(qmodminmax,5) + say 'QMOD_Max Value: 'qmodmax + say 'QMOD_Min Value: 'qmodmin + 'set gxout shaded' + 'd abs('qmodmin')' + aqmodmin = subwrd(result,4) + 'd abs('qmodmax')' + aqmodmax = subwrd(result,4) + if( aqmodmin > aqmodmax ) ; aqmodmax = aqmodmin ; endif + say 'Absolute QMOD_MAX: ' aqmodmax + 'set gxout shaded' if( ccols != NULL ) 'set clevs 'clevs @@ -302,6 +332,7 @@ if( ccols != NULL ) else 'shades 'qmod' 0' cint = result*2 + if( clevs != NULL ) ; 'set clevs 'clevs ; endif endif 'd qmod' @@ -312,12 +343,28 @@ endif 'set parea 1.5 7.0 4.30 7.10' 'set grads off' + 'set gxout stat' + 'd qobs' + qobsminmax = sublin(result,8) + qobsmin = subwrd(qobsminmax,4) + qobsmax = subwrd(qobsminmax,5) + say 'QOBS_Max Value: 'qobsmax + say 'QOBS_Min Value: 'qobsmin + 'set gxout shaded' + 'd abs('qobsmin')' + aqobsmin = subwrd(result,4) + 'd abs('qobsmax')' + aqobsmax = subwrd(result,4) + if( aqobsmin > aqobsmax ) ; aqobsmax = aqobsmin ; endif + say 'Absolute QOBS_MAX: ' aqobsmax + if( ccols != NULL ) 'set gxout shaded' 'set clevs 'clevs 'set ccols 'ccols else 'shades 'qmod' 0' + if( clevs != NULL ) ; 'set clevs 'clevs ; endif endif 'd qobs' @@ -352,10 +399,27 @@ endif avgdif = subwrd(result,1) stddif = subwrd(result,2) + dqmax = stddif/3 + 'set gxout shaded' - qmax = stddif/3 - if( qmax > 0 ) - 'd log10('qmax')' + + say 'Absolute DQMAX: 'dqmax' qmax: 'qmax + dqrel = dqmax / qmax * 100 * 100 + 'getint 'dqrel + dqrel = result/100 + + say 'QMAX: 'qmax' DQMAX: 'dqmax + say 'Relative PCT Difference: 'dqrel' (100*DQMAX/QMAX)' + say ' Minimum PCT for Plots: 'dpct + + if( dqrel < dpct ) + dqrel = dpct + endif + dqmax = dqrel * qmax / 100 + say 'Setting CINT using DQREL: 'dqrel'%, DQMAX: 'dqmax + + if( dqmax > 0 ) + 'd log10('dqmax')' n = subwrd(result,4) else n = 0 @@ -371,15 +435,51 @@ endif n = n+2 endif endif + + if( fixpltfact != NULL ) + 'd 'fixpltfact + n =subwrd(result,4) + endif + say 'Diff Scaling Factor: 'n - 'd 'qmax'/1e'n + + if( fixpltcint != NULL ) + 'd 'fixpltcint + fixpltcint =subwrd(result,4) + cint = fixpltcint + else + 'd 'dqmax'/1e'n cint = subwrd(result,4) + endif + 'shades 'cint 'define qdif = (qmod-qobs)/1e'n 'd qdif' -* 'cbarn -snum 0.55' -'cbarn -snum 0.55 -xmid 4.25 -ymid 0.4' + 'cbarn -snum 0.55 -xmid 4.25 -ymid 0.4' + 'set gxout stat' + 'd qdif' + qdifminmax = sublin(result,8) + qdifmin = subwrd(qdifminmax,4) + qdifmax = subwrd(qdifminmax,5) + say 'QDIF_Max Value: 'qdifmax + say 'QDIF_Min Value: 'qdifmin + 'set gxout shaded' + 'd abs('qdifmin')' + aqdifmin = subwrd(result,4) + 'd abs('qdifmax')' + aqdifmax = subwrd(result,4) + if( aqdifmin > aqdifmax ) ; aqdifmax = aqdifmin ; endif + say 'Absolute QDIF_MAX: ' aqdifmax + + 'set gxout stat' + 'd maskout(qdif,abs(qobs))' + dqminmax = sublin(result,8) + dqmin = subwrd(qminmax,4) + dqmax = subwrd(qminmax,5) + say 'DQMin Value: 'dqmin + say 'DQMax Value: 'dqmax + 'set gxout shaded' 'stats maskout(qdif,abs(qobs))' avgdif = subwrd(result,1) @@ -438,17 +538,35 @@ eyearo = subwrd(date,2) 'set string 1 l 4' 'set strsiz .08' -'draw string 0.050 10.50 Beg: 'bmnthm' 'byearm -'draw string 0.050 10.35 End: 'emnthm' 'eyearm -'draw string 0.050 7.10 Beg: 'bmntho' 'byearo -'draw string 0.050 6.95 End: 'emntho' 'eyearo - -'draw string 0.050 9.85 Mean: 'avgmod -'draw string 0.050 9.70 Std: 'stdmod -'draw string 0.050 6.45 Mean: 'avgobs -'draw string 0.050 6.30 Std: 'stdobs -'draw string 0.050 3.05 Mean: 'avgdif -'draw string 0.050 2.90 Std: 'stddif + +'draw string 0.050 10.25 Beg: 'bmnthm' 'byearm +'draw string 0.050 10.10 End: 'emnthm' 'eyearm +'draw string 0.050 9.85 Max: 'qmodmax +'draw string 0.050 9.70 Min: 'qmodmin +'draw string 0.050 9.40 Mean: 'avgmod +'draw string 0.050 9.25 Std: 'stdmod + +'draw string 0.050 6.85 Beg: 'bmntho' 'byearo +'draw string 0.050 6.70 End: 'emntho' 'eyearo +'draw string 0.050 6.45 Max: 'qobsmax +'draw string 0.050 6.30 Min: 'qobsmin +'draw string 0.050 6.00 Mean: 'avgobs +'draw string 0.050 5.85 Std: 'stdobs + +'draw string 0.050 3.45 Beg: 'bmntho' 'byearo +'draw string 0.050 3.30 End: 'emntho' 'eyearo +'draw string 0.050 3.05 Max: 'qdifmax +'draw string 0.050 2.90 Min: 'qdifmin +'draw string 0.050 2.60 Mean: 'avgdif +'draw string 0.050 2.45 Std: 'stddif + +if( CINTDIFF != 'NULL' ) + 'set strsiz .07' + 'draw string 0.050 1.77 Plot represents' + 'draw string 0.050 1.62 values > 'dqrel' %' + 'draw string 0.050 1.47 Relative Difference' + 'draw string 0.050 1.32 ( DQ/QMax )' +endif 'myprint -name 'output'/hdiag_'PRFX''anal'_'EXPORT'.'GC'_'level'.'season 'set clab on' diff --git a/GEOS_Util/plots/grads_util/genpltz.gs b/GEOS_Util/plots/grads_util/genpltz.gs index b982d529..4207594a 100644 --- a/GEOS_Util/plots/grads_util/genpltz.gs +++ b/GEOS_Util/plots/grads_util/genpltz.gs @@ -124,6 +124,10 @@ if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_CCOLS' ; endif if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_DCOLS' ; endif dcols = result + 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_Z_DPCT' +if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_DPCT' ; endif + dpct = result + if( zlog = 'ON' & ptop < 10 ) 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_ZLOG_CLEVS' if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_Z_CLEVS' ; endif @@ -142,7 +146,9 @@ if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_'LEVTYPE ; end 'getresource 'PLOTRC' 'PRFX''EXPORT'_'GC'_DIFFMIN' diffmin = result -if( fact = 'NULL' ) ; fact = 1 ; endif +if( fact = 'NULL' ) ; fact = 1 ; endif +if( dpct = 'NULL' ) ; dpct = 0.5 ; endif + if( title = 'NULL' ) 'getdesc 'alias title = alias': 'result @@ -253,6 +259,8 @@ if( qmin > qmax ) if( qzmin > qzmax ) ; qzmax = qzmin ; endif endif +say 'Absolute QMAX: 'qmax +say 'Absolute QZMAX: 'qzmax * Determin if ZLOG is appropriate * ------------------------------- @@ -348,9 +356,11 @@ if( ccols = NULL ) say 'Scaling Factor: 'qn if( qn>0 ) 'shades modz*'fact'/1e'qm' 0' + if( clevs != NULL ) ; 'set clevs 'clevs ; endif 'd modz*'fact'/1e'qm else 'shades modz*'fact'*1e'qm' 0' + if( clevs != NULL ) ; 'set clevs 'clevs ; endif 'd modz*'fact'*1e'qm endif @@ -412,9 +422,11 @@ say '------------' if( ccols = NULL ) if( qn>0 ) 'shades modz*'fact'/1e'qm' 0' + if( clevs != NULL ) ; 'set clevs 'clevs ; endif 'd obsz*'fact'/1e'qm else 'shades modz*'fact'*1e'qm' 0' + if( clevs != NULL ) ; 'set clevs 'clevs ; endif 'd obsz*'fact'*1e'qm endif else @@ -491,12 +503,32 @@ if( dcols = NULL | CINTDIFF != NULL | USE_PLOTRC = TRUE ) 'd abs('dqmax')' dqmax = subwrd(result,4) if( dqmin > dqmax ) ; dqmax = dqmin ; endif + + say 'Absolute DQMAX: 'dqmax' qmax: 'qmax + dqrel = dqmax / qmax * 100 * 100 + 'getint 'dqrel + dqrel = result/100 + dqact = result/100 + 'd 'dpct + dpct = subwrd(result,4) + + say 'QMAX: 'qmax' DQMAX: 'dqmax + say 'Relative PCT Difference: 'dqrel' (100*DQMAX/QMAX)' + say ' Minimum PCT for Plots: 'dpct + + if( dqrel < dpct ) + dqrel = dpct + endif + dqmax = dqrel * qmax / 100 + say 'Setting CINT using DQREL: 'dqrel'%, DQMAX: 'dqmax + if( dqmax > 0 ) 'd log10('dqmax')' dn = subwrd(result,4) else dn = 0 endif + say ' Log Factor: 'dn if( dn<0 ) ; dn = dn-2 ; endif 'getint 'dn @@ -566,9 +598,6 @@ endif 'cbarn -snum 0.55 -xmid 4.25 -ymid 0.4' -if( numlevs > 1 ) -'draw ylab Pressure (mb)' -endif 'set gxout contour' 'set ccolor 1' if( dcols = NULL | CINTDIFF != NULL | USE_PLOTRC = TRUE ) @@ -586,8 +615,19 @@ endif ************************************************************ ************************************************************ +if( numlevs>1 & CINTDIFF = 'NULL' ) + 'draw ylab Pressure (mb)' +endif + 'set vpage off' -'set string 1 l 4' + +if( numlevs>1 & CINTDIFF != 'NULL' ) + 'set string 1 l 6 90' + 'set strsiz .17' + 'draw string 0.75 1.8 Pressure (mb)' +endif + +'set string 1 l 4 0' 'set strsiz 0.065' 'draw string 0.05 0.08 ( EXPID: 'expid' )' @@ -617,10 +657,11 @@ endif 'draw string 4.25 7.24 'odesc' 'season' ('nobs') ('climate')' endif + if( dn != 0 ) -'draw string 4.25 3.80 Difference (Top-Middle) (x 10**'dn')' + 'draw string 4.25 3.80 Difference (Top-Middle) (x 10**'dn')' else -'draw string 4.25 3.80 Difference (Top-Middle)' + 'draw string 4.25 3.80 Difference (Top-Middle)' endif date = getdate (begdate) @@ -643,6 +684,15 @@ if( numlevs > 1 ) 'draw string 0.10 10.24 End: 'emnthm' 'eyearm 'draw string 0.10 6.97 Beg: 'bmntho' 'byearo 'draw string 0.10 6.84 End: 'emntho' 'eyearo + +if( CINTDIFF != 'NULL' ) + 'set strsiz .07' + 'draw string 0.050 1.67 Plot represents' + 'draw string 0.050 1.52 values > 'dqrel' %' + 'draw string 0.050 1.36 Relative Difference' + 'draw string 0.050 1.22 ( DQ/QMax )' +endif + else 'set string 4 l 4' 'set strsiz .08' diff --git a/GEOS_Util/plots/grads_util/getinfo b/GEOS_Util/plots/grads_util/getinfo index 3da9ad55..5aa2a668 100644 --- a/GEOS_Util/plots/grads_util/getinfo +++ b/GEOS_Util/plots/grads_util/getinfo @@ -25,6 +25,8 @@ endif 'query ctlinfo 'file ctlinfo = result + dset = sublin(result,1) + dset = subwrd(dset,2) 'query file 'file xlab = sublin(result,1) @@ -316,6 +318,7 @@ pagey = subwrd(pagey ,6) * Return Options * -------------- + if (name="dset" ) ; return dset ; endif if (name="file" ) ; return file ; endif if (name="desc" ) ; return desc ; endif if (name="page" ) ; return pagex' 'pagey ; endif diff --git a/GEOS_Util/plots/grads_util/getvar_2G.gs b/GEOS_Util/plots/grads_util/getvar_2G.gs new file mode 100755 index 00000000..422b7715 --- /dev/null +++ b/GEOS_Util/plots/grads_util/getvar_2G.gs @@ -0,0 +1,156 @@ +function getvar_2G (args) + +EXPORT = subwrd(args,1) +GC = subwrd(args,2) +SOURCE = subwrd(args,3) + +* Check for SUFFIX appended to EXPORT (as EXPORT:SUFFIX) +* ------------------------------------------------------ +SUFFIX = '' + m = 0 + n = 1 + bit = substr(EXPORT,n,1) +while( bit != '' ) + n = n + 1 + bit = substr(EXPORT,n,1) + if( bit = ':' ) ; m = n ; endif +endwhile +if( m != 0 ) + n = m + 1 + bit = substr(EXPORT,n,1) + SUFFIX = '' + while( bit != '' ) + if( n = m+1 ) + SUFFIX = bit + else + SUFFIX = SUFFIX''bit + endif + n = n + 1 + bit = substr(EXPORT,n,1) + endwhile +endif + +say ' ' +say 'Inside GETVAR_2G, INPUT_EXPORT = 'EXPORT' GC = 'GC' SUFFIX = 'SUFFIX + + +*'!remove EXPORT.txt' +*'! echo 'EXPORT' | cut -d: -f1 > EXPORT.txt' +*'run getenv "EXPORT"' +* EXPORT = result +*say 'Inside GETVAR_2G, CHCKHIST_EXPORT = 'EXPORT +*say ' ' + + +* Ensure UpperCase EXPORT and GC +* ------------------------------ +*'run uppercase 'EXPORT +* EXPORT = result +*'run uppercase 'GC +* GC = result + +* Get Info from HISTORY.rc File +* ----------------------------- +'run getenv "GEOSUTIL"' + geosutil = result + +'run getenv "PLOTS_DIR"' + PLOTS_DIR = result + +say 'Running chckhist for EXPORT: 'EXPORT' GC: 'GC +'!./chckhist 'EXPORT' 'GC' 'SOURCE +say ' finish chckhist for EXPORT: 'EXPORT' GC: 'GC + +say 'CAT hist.txt:' +'!cat hist.txt' + +expdsc = sublin( read(hist.txt),2 ) +qname = sublin( read(hist.txt),2 ) +qfile = sublin( read(hist.txt),2 ) +scale = sublin( read(hist.txt),2 ) +format = sublin( read(hist.txt),2 ) +base = sublin( read(hist.txt),2 ) + rc = close(hist.txt) + +if( qfile = "NULL" ) + say ' ' + say EXPORT' from 'GC' not found in HISTORY.rc!' + say ' ' + return 'NULL NULL 1 NULL NULL NULL' +endif + +'getfile 'qfile + file = result + +* Open New Experiment Dataset +* --------------------------- +say 'Opening: 'qfile +say ' Desc: 'expdsc +say ' ' + +if( file = "NULL" ) +if( substr(format,1,4) = "flat" ) ; ' open 'qfile ; endif +if( substr(format,1,4) = "CFIO" ) ; 'xdfopen 'qfile ; endif +if( substr(format,1,3) = "HDF" ) ; 'sdfopen 'qfile ; endif + +'getinfo numfiles' + numfiles = result + +* Set CASHE SIZE +* -------------- +'getinfo file' + curfile = result + +'set dfile 'numfiles +'getinfo xdim' + xdim = result +'getinfo ydim' + ydim = result + cash = xdim * ydim * 4 + +'run getenv CASHESZ' + CASHESZ = result + +if( CASHESZ = 'NULL' ) + say 'setting cachesf 'cash + 'set cachesf 'cash + 'run setenv "CASHESZ" 'cash +endif + +if( CASHESZ != 'NULL' & cash > CASHESZ ) + say 'updating cachesf 'cash + 'set cachesf 'cash + 'run setenv "CASHESZ" 'cash +endif + +* Check for Alias within File +* --------------------------- + 'lowercase 'qname + qnamelc = result +*if( SUFFIX != 'NULL' ) +* qnamelc = qnamelc''SUFFIX +* qname = qname''SUFFIX +*endif + +say 'Looking for 'qnamelc + 'query file' + numvar = sublin(result,6) + numvar = subwrd(numvar,5) + flag = false + n = 1 + while ( n 0 ) + line = sublin(ctlinfo,n) + word = subwrd(line,1) + if( word = 'tdef' ) + tinc = subwrd(line,5) + n = 0 + else + n = n + 1 + endif + endwhile +say 'tmin: 'tmin' tmax: 'tmax' tinc: 'tinc +'set t 'tmin +'run getinfo date' + begdate = result +say 'BEGDATE = 'begdate 'getinfo lonmin' lonbeg = result @@ -67,8 +85,8 @@ endwhile 'getinfo latmax' latend = result -* Create Array of Target Pressure Levels -* -------------------------------------- +* Find ZDIM for each File +* ----------------------- 'set dfile 'file1 'getinfo zdim' zdim1 = result @@ -81,6 +99,8 @@ endwhile level = result if( level > ptop ) ; ptop = level ; endif +* Create Array of Target Pressure Levels based on File2 +* ----------------------------------------------------- levs = '' nlev = 0 z = 1 @@ -97,8 +117,8 @@ while( z<=zdim2 ) endwhile say '' -say 'Number of Target Pressure Levels: 'nlev -say ' Pressure Levels: 'levs +say 'Number of Target Pressure Levels from File2: 'nlev +say ' Target Pressure Levels from File2: 'levs say '' @@ -116,27 +136,43 @@ else endif 'set lat -90 90' +* Loop over Time +* -------------- '!remove 'name'.data' + tdim = tmax-tmin+1 + t = tmin +while( t<= tmax ) + +* Interpolate Q1 Variable to Target Pressure Levels from File2 +* ------------------------------------------------------------ +'set dfile 'file1 +'set t 't +'run getinfo date' + curdate = result +say 'CURRENT DATE = 'curdate + z = 1 while( z<=nlev ) - say 'Checking for: 'level.z - say '------------- ' +* say 'Regrid Q2 to 0.25x0.25-Deg RSLV at File2 Target Pressure: 'level.z +* say '--------------------------------------------------------- ' 'set dfile 'file2 'set lev 'level.z 'define qtmp = 'q2' + lon-lon' 'define qobs = regrid2( qtmp,0.25,0.25,bs_p1,0,-90)' 'undefine qtmp' - if( z=1 ) + + if( z=1 & t=tmin ) 'set gxout stat' 'd 'q2 undef = sublin(result,6) undef = subwrd(undef,4) - say 'UNDEF = 'undef 'set gxout fwrite' 'set fwrite 'name'.data' endif +* say 'Find File1 Bounding Levels around File2 Target Pressure: 'level.z +* say '--------------------------------------------------------- ' 'set dfile 'file1 k = 1 'set z 'k @@ -148,10 +184,20 @@ while( z<=nlev ) 'getinfo level' level = result endwhile +* say 'File1 Bounding Levels to File2 Target Pressure: 'level.z +* say '----------------------------------------------- ' +* say 'k above: 'k ' Pressure Above: 'level + if( k > 1 ) + 'set z 'k-1 + 'getinfo level' + levm1 = result +* say 'k below: 'k-1' Pressure Below: 'levm1 + 'set z 'k + endif if( level = level.z ) - say 'Using Level :'k' ('level')' - say '----------- ' +* say 'Regrid Q1 to 0.25x0.25-Deg RSLV at File1 Pressure: 'level +* say '-------------------------------------------------- ' 'define qtmp = 'q1' + lon-lon' 'define qmod = regrid2( qtmp,0.25,0.25,bs_p1,0,-90)' 'undefine qtmp' @@ -160,17 +206,67 @@ while( z<=nlev ) else ' d qmod-qobs' endif + else + 'define qk = 'q1' + lon-lon' if( k > 1 ) + kp1 = k+1 + kp0 = k +* p <= level.z km1 = k-1 + km2 = k-2 + 'set z 'km1 'getinfo level' levm1 = result 'define qkm1 = 'q1' + lon-lon' - 'define qint = qkm1 + (qk-qkm1)*( log('level.z'/'levm1') / log('level'/'levm1') )' - say 'Using Levels :'k' ('level') and 'km1' ('levm1')' - say '------------ ' +* say 'k: 'k' km1: 'km1' levm1: 'levm1 + + if( km1 > 1 & kp0 < zdim1 ) + 'set z 'km2 + 'getinfo level' + levm2 = result + 'define qkm2 = 'q1' + lon-lon' +* say 'k: 'k' km2: 'km2' levm2: 'levm2 + + 'set z 'kp0 + 'getinfo level' + levp0 = result + 'define qkp0 = 'q1' + lon-lon' +* say 'k: 'k' kp0: 'kp0' levp0: 'levp0 + + 'set z 'kp1 + 'getinfo level' + levp1 = result + 'define qkp1 = 'q1' + lon-lon' +* say 'k: 'k' kp1: 'kp1' levp1: 'levp1 + + P = math_log(''level.z'') + PLP1 = math_log(''levp1'') + PLP0 = math_log(''levp0'') + PLM1 = math_log(''levm1'') + PLM2 = math_log(''levm2'') + + DLP0 = PLP1-PLP0 + DLM1 = PLP0-PLM1 + DLM2 = PLM1-PLM2 + + ap1 = (P-PLP0)*(P-PLM1)*(P-PLM2)/( DLP0*(DLP0+DLM1)*(DLP0+DLM1+DLM2) ) + ap0 = (PLP1-P)*(P-PLM1)*(P-PLM2)/( DLP0* DLM1 *( DLM1+DLM2) ) + am1 = (PLP1-P)*(PLP0-P)*(P-PLM2)/( DLM1* DLM2 *(DLP0+DLM1 ) ) + am2 = (PLP1-P)*(PLP0-P)*(PLM1-P)/( DLM2*(DLM1+DLM2)*(DLP0+DLM1+DLM2) ) + +* say 'AP1: 'ap1' AP0: 'ap0' AM1: 'am1' AM2: 'am2' sum: 'ap1+ap0+am1+am2 + + 'define qint = 'ap1'*qkp1 + 'ap0'*qkp0 + 'am1'*qkm1 + 'am2'*qkm2' +* say 'Using Levels :'kp1' 'kp0' 'km1' 'km2 +* say '------------ ' + else + 'define qint = qkm1 + (qk-qkm1)*( log('level.z'/'levm1') / log('level'/'levm1') )' +* say 'Using Levels :'k' ('level') and 'km1' ('levm1')' +* say '------------ ' + endif else kp1 = k+1 'set z 'kp1 @@ -178,8 +274,8 @@ while( z<=nlev ) levp1 = result 'define qkp1 = 'q1' + lon-lon' 'define qint = qkp1 + (qk-qkp1)*( log('level.z'/'levp1') / log('level'/'levp1') )' - say 'Using Levels :'k' ('level') and 'kp1' ('levp1')' - say '------------ ' +* say 'Using Levels :'k' ('level') and 'kp1' ('levp1')' +* say '------------ ' endif 'define qmod = regrid2( qint,0.25,0.25,bs_p1,0,-90)' if( abs = TRUE ) @@ -188,31 +284,48 @@ while( z<=nlev ) ' d qmod-qobs' endif endif - say ' ' +* say ' ' z = z + 1 endwhile +t = t + 1 +endwhile 'disable fwrite' +say 'Creating 'name'.ctl' +say 'TDIM: 'tdim + '!remove sedfile' '!remove 'name'.ctl' '!echo "s@GRADSDATA@"'name'.data@g > sedfile' '!echo "s@UNDEF@"'undef'@g >> sedfile' '!echo "s@ZDIM2@"'nlev'@g >> sedfile' +'!echo "s@TDIM@"'tdim'@g >> sedfile' '!echo "s@LEVS@"'levs'@g >> sedfile' +'!echo "s@BEGDATE@"'begdate'@g >> sedfile' +'!echo "s@TINC@"'tinc'@g >> sedfile' '!sed -f sedfile 'geosutil'/plots/grads_util/zdiff.template > 'name'.ctl' 'open 'name'.ctl' 'getinfo numfiles' newfile = result +say 'NEWFILE = 'newfile + 'set dfile 'newfile -'set t 1' 'setx' 'sety' 'setlons' 'setlats' 'setz' -'makez q z' -'define 'name'z = qz' +'set t 1 'tdim +say 'DIMS before: makezf q 'name' z' +'q dims' +say result +say ' ' +say 'CAT 'name'.ctl' +'!cat 'name'.ctl' +say ' ' + +'makezf q 'name' z' maxval = -1e15 minval = 1e15 @@ -220,7 +333,7 @@ minval = 1e15 z = 1 while( z <= nlev ) 'set z 'z -'minmax.simple qz' +'minmax.simple 'name'z' qmax = subwrd(result,1) qmin = subwrd(result,2) @@ -244,7 +357,7 @@ minval = 1e15 if( qmin < minval ) ; minval = qmin ; endif z = z + 1 endwhile - say ' ' +*say ' ' *'close 'newfile '!remove ZDIFILE.txt' diff --git a/GEOS_Util/plots/grads_util/makezf b/GEOS_Util/plots/grads_util/makezf index 8a0cdfcd..f3a22eae 100644 --- a/GEOS_Util/plots/grads_util/makezf +++ b/GEOS_Util/plots/grads_util/makezf @@ -69,7 +69,14 @@ tag = subwrd(args,3) line = sublin(result,n) word = subwrd(line,1) if( word = 'tdef' ) - dt = subwrd(line,5) + dt = subwrd(line,5) + length = strlen(dt) + unit = substr( dt,length-1,length ) + if( unit = 'yr' ) ; tunit = year ; endif + if( unit = 'mo' ) ; tunit = month ; endif + if( unit = 'dy' ) ; tunit = day ; endif + if( unit = 'hr' ) ; tunit = hour ; endif + if( unit = 'mn' ) ; tunit = minute ; endif n = 0 else n = n + 1 @@ -129,6 +136,8 @@ tag = subwrd(args,3) '!touch sedfile' '!remove 'alias''tag'.ddf' + 'set looping off' + t = tmin while( t<=tmax ) say ' Computing Zonal Mean Variable: 'alias''tag' for t = 't @@ -150,7 +159,35 @@ tag = subwrd(args,3) 'getinfo month' month = result month = getnum(month) - fname = alias''tag'.'year''month'.nc4' + + if( tunit = 'day' | tunit = 'hour' | tunit = 'minute' ) + 'getinfo date' + date = result + delim = substr( date,3,1 ) + 'uppercase 'delim + delim = result + if( delim = 'Z' ) + day = substr( date,4,2 ) + hour = substr( date,1,2 ) + minute = 00 + endif + if( delim = ':' ) + day = substr( date,7,2 ) + hour = substr( date,1,2 ) + minute = substr( date,4,2 ) + endif + if( tunit = 'minute' ) + fname = alias''tag'.'year''month''day'_'hour''minute'z.nc4' + tstamp = '%y4%m2%d2_%h2%n2z' + else + fname = alias''tag'.'year''month''day'_'hour'z.nc4' + tstamp = '%y4%m2%d2_%h2z' + endif + else + fname = alias''tag'.'year''month'.nc4' + tstamp = '%y4%m2' + endif + 'set sdfwrite -5d 'fname 'set undef 'undef 'sdfwrite tempz' @@ -164,7 +201,7 @@ tag = subwrd(args,3) '!echo "s?@DT?"'dt'?g >> sedfile' '!echo "s?@TDIM?"'tdim'?g >> sedfile' '!echo "s?@BDATE?"'begdate'?g >> sedfile' -'!echo "s?qz.data?"'alias''tag'.%y4%m2.nc4?g >> sedfile' +'!echo "s?qz.data?"'alias''tag'.'tstamp'.nc4?g >> sedfile' '!/bin/cp 'geosutil'/plots/grads_util/makez.tmpl .' '!sed -f sedfile makez.tmpl > 'alias''tag'.ddf' diff --git a/GEOS_Util/plots/grads_util/makplot.gs b/GEOS_Util/plots/grads_util/makplot.gs index 2e5d5c83..e2b1ecca 100644 --- a/GEOS_Util/plots/grads_util/makplot.gs +++ b/GEOS_Util/plots/grads_util/makplot.gs @@ -3,6 +3,8 @@ function makplot (args) 'numargs 'args numargs = result +qname = NULL + * Initialize INPUT Parameters * --------------------------- num = 0 @@ -11,6 +13,7 @@ while ( num < numargs ) if( subwrd(args,num) = '-MVAR' ) ; mvar = subwrd(args,num+1) ; say 'mvar = 'mvar ; endif if( subwrd(args,num) = '-MNAME' ) ; mname = subwrd(args,num+1) ; say 'mname = 'mname ; endif +if( subwrd(args,num) = '-QNAME' ) ; qname = subwrd(args,num+1) ; say 'qname = 'qname ; endif if( subwrd(args,num) = '-MFILE' ) ; mfile = subwrd(args,num+1) ; say 'mfile = 'mfile ; endif if( subwrd(args,num) = '-MDESC' ) ; mdesc = subwrd(args,num+1) ; endif if( subwrd(args,num) = '-MBEGDATE' ) ; bdate = subwrd(args,num+1) ; endif @@ -28,7 +31,7 @@ if( subwrd(args,num) = '-PREFIX' ) ; prefix = subwrd(args,num+1) ; endif if( subwrd(args,num) = '-SEASON' ) ; season = subwrd(args,num+1) ; endif if( subwrd(args,num) = '-OUTPUT' ) ; output = subwrd(args,num+1) ; endif if( subwrd(args,num) = '-CLIMATE' ) ; climate = subwrd(args,num+1) ; endif -if( subwrd(args,num) = '-GC' ) ; gridcomp = subwrd(args,num+1) ; endif +if( subwrd(args,num) = '-GC' ) ; gridcomp = subwrd(args,num+1) ; say ' gc = 'gridcomp ; endif if( subwrd(args,num) = '-MATH' ) ; math = subwrd(args,num+1) ; endif endwhile @@ -37,6 +40,7 @@ endwhile if( math = NULL ) ; math = '' ; endif if( season = NULL ) ; season = '' ; endif if( gridcomp = NULL ) ; gridcomp = '' ; endif +if( qname = NULL ) ; qname = mname ; endif 'set t 1' 'run getenv "GEOSUTIL"' @@ -51,6 +55,7 @@ if( prefix != NULL ) else PFX = '' endif + say '' title = 'NULL' @@ -92,6 +97,11 @@ if( result = 'NULL' ) ; 'getresource 'PLOTRC' DLEVS' ; endif 'getresource 'PLOTRC' 'PFX'DCOLS' if( result = 'NULL' ) ; 'getresource 'PLOTRC' DCOLS' ; endif dcols = result + + 'getresource 'PLOTRC' 'PFX'DPCT' +if( result = 'NULL' ) ; 'getresource 'PLOTRC' DPCT' ; endif + dpct = result + factor = 1 else @@ -124,10 +134,18 @@ if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_CCOLS' ; endif if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_CLEVS' ; endif clevs = result + 'getresource 'PLOTRC' 'mname'_'gridcomp'_'level'_DPCT' +if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'gridcomp'_DPCT' ; endif + dpct = result + 'getresource 'PLOTRC' 'mname'_'gridcomp'_REGRID' method = result endif +if( dpct = 'NULL' ) ; dpct = 0.1 ; endif + 'd 'dpct + dpct = subwrd(result,4) + 'run getenv "CINTDIFF"' CINTDIFF = result if( CINTDIFF != 'NULL' ) ; dcols = 'NULL' ; endif @@ -135,7 +153,7 @@ endif say '' if( factor = 'NULL' ) ; factor = 1 ; endif if( title = 'NULL' ) - 'getdesc 'mname + 'getdesc 'qname desc = result title = mname':'gridcomp' 'desc "rmstring '"title"' '[column]'" @@ -150,16 +168,13 @@ endif 'define qmod = 'mvar''season'*'factor 'define qobs = 'ovar''season'*'factor -'d log10('factor')' - m = subwrd(result,4) -if( ccols = NULL ) 'set gxout stat' 'd qmod' qminmax = sublin(result,8) qmin = subwrd(qminmax,4) qmax = subwrd(qminmax,5) - say 'Original QMIN: 'qmin say 'Original QMAX: 'qmax + say 'Original QMIN: 'qmin say 'Original STATS: 'result 'set gxout shaded' 'd abs('qmin')' @@ -173,7 +188,7 @@ if( ccols = NULL ) else m = 0 endif - say ' Log Factor: 'm + say ' Log Factor for qmod: 'm if( m<0 ) ; m = m-2 ; endif 'getint 'm m = result @@ -184,8 +199,10 @@ if( ccols = NULL ) m = m-2 endif endif - say 'Field Scaling Factor: 'm + say 'Field Scaling Factor for qmod: 'm minv = -m + +if( ccols = NULL ) 'define qmod = qmod * 1e'minv 'define qobs = qobs * 1e'minv 'set gxout stat' @@ -193,15 +210,15 @@ if( ccols = NULL ) qminmax = sublin(result,8) qmin = subwrd(qminmax,4) qmax = subwrd(qminmax,5) - say 'Final QMIN: 'qmin say 'Final QMAX: 'qmax + say 'Final QMIN: 'qmin say 'Final STATS: 'result 'set gxout shaded' endif if( math = LOG ) - 'define qmod = log(qmod+0.00001)' - 'define qobs = log(qobs+0.00001)' + 'define qmod = log10(qmod)' + 'define qobs = log10(qobs)' endif 'set vpage off' @@ -229,6 +246,22 @@ endif 'set vpage 0 8.5 0.0 11' 'set parea 1.5 7.0 7.70 10.50' 'set grads off' + + 'set gxout stat' + 'd qmod' + qmodminmax = sublin(result,8) + qmodmin = subwrd(qmodminmax,4) + qmodmax = subwrd(qmodminmax,5) + say 'QMOD_Max Value: 'qmodmax + say 'QMOD_Min Value: 'qmodmin + 'set gxout shaded' + 'd abs('qmodmin')' + aqmodmin = subwrd(result,4) + 'd abs('qmodmax')' + aqmodmax = subwrd(result,4) + if( aqmodmin > aqmodmax ) ; aqmodmax = aqmodmin ; endif + say 'Absolute QMOD_MAX: ' aqmodmax + if( ccols != NULL ) 'set clevs 'clevs 'set ccols 'ccols @@ -249,6 +282,22 @@ endif 'set vpage 0 8.5 0.0 11' 'set parea 1.5 7.0 4.30 7.10' 'set grads off' + + 'set gxout stat' + 'd qobs' + qobsminmax = sublin(result,8) + qobsmin = subwrd(qobsminmax,4) + qobsmax = subwrd(qobsminmax,5) + say 'QOBS_Max Value: 'qobsmax + say 'QOBS_Min Value: 'qobsmin + 'set gxout shaded' + 'd abs('qobsmin')' + aqobsmin = subwrd(result,4) + 'd abs('qobsmax')' + aqobsmax = subwrd(result,4) + if( aqobsmin > aqobsmax ) ; aqobsmax = aqobsmin ; endif + say 'Absolute QOBS_MAX: ' aqobsmax + if( ccols != NULL ) 'set clevs 'clevs 'set ccols 'ccols @@ -267,6 +316,8 @@ endif 'set vpage 0 8.5 0.0 11' 'set parea 1.5 7.0 0.90 3.70' 'set grads off' + + 'rgbset' 'getinfo lon' lon = result @@ -285,9 +336,32 @@ else 'stats difg' avgdif = subwrd(result,1) stddif = subwrd(result,2) - qmax = stddif/3 - if( qmax > 0 ) - 'd log10('qmax')' + dqmax = stddif/3 + + say '1/3 Diff. Std.Dev.: 'dqmax' QMax: 'aqmodmax + 'd 'aqmodmax + aqmodmax = subwrd(result,4) + say 'aqmodmax = 'aqmodmax + if( aqmodmax = 0 ) + dqrel = 100 * 100 + else + dqrel = dqmax / aqmodmax * 100 * 100 + endif + + 'getint 'dqrel + dqrel = result/100 + + say ' Relative % Difference for Plots: 'dqrel' (100* 1/3*Std.Dev / QMAX)' + say 'Minimum Allowed % Difference for Plots: 'dpct + + if( dqrel < dpct ) + dqrel = dpct + endif + dqmax = dqrel * aqmodmax / 100 + say 'Setting CINT using DQREL: 'dqrel'%, DQMAX: 'dqmax + + if( dqmax > 0 ) + 'd log10('dqmax')' n = subwrd(result,4) else n = 0 @@ -304,12 +378,28 @@ else endif endif say 'Diff Scaling Factor: 'n - 'd 'qmax'/1e'n + 'd 'dqmax'/1e'n cint = subwrd(result,4) 'shades 'cint 'define difg = difg/1e'n 'd difg' endif + + 'set gxout stat' + 'd difg' + qdifminmax = sublin(result,8) + qdifmin = subwrd(qdifminmax,4) + qdifmax = subwrd(qdifminmax,5) + say 'QDIF_Max Value: 'qdifmax + say 'QDIF_Min Value: 'qdifmin + 'set gxout shaded' + 'd abs('qdifmin')' + aqdifmin = subwrd(result,4) + 'd abs('qdifmax')' + aqdifmax = subwrd(result,4) + if( aqdifmin > aqdifmax ) ; aqdifmax = aqdifmin ; endif + say 'Absolute QDIF_MAX: ' aqdifmax + 'cbarn -snum 0.55 -xmid 4.25 -ymid 0.4' 'stats maskout(modg,abs(obsg))' @@ -368,17 +458,35 @@ eyearo = subwrd(date,2) 'set string 1 l 4' 'set strsiz .08' -'draw string 0.050 10.50 Beg: 'bmnthm' 'byearm -'draw string 0.050 10.35 End: 'emnthm' 'eyearm -'draw string 0.050 7.10 Beg: 'bmntho' 'byearo -'draw string 0.050 6.95 End: 'emntho' 'eyearo - -'draw string 0.050 9.85 Mean: 'avgmod -'draw string 0.050 9.70 Std: 'stdmod -'draw string 0.050 6.45 Mean: 'avgobs -'draw string 0.050 6.30 Std: 'stdobs -'draw string 0.050 3.05 Mean: 'avgdif -'draw string 0.050 2.90 Std: 'stddif + +'draw string 0.050 10.25 Beg: 'bmnthm' 'byearm +'draw string 0.050 10.10 End: 'emnthm' 'eyearm +'draw string 0.050 9.85 QMax: 'qmodmax +'draw string 0.050 9.70 QMin: 'qmodmin +'draw string 0.050 9.40 Mean: 'avgmod +'draw string 0.050 9.25 Std: 'stdmod + +'draw string 0.050 6.85 Beg: 'bmntho' 'byearo +'draw string 0.050 6.70 End: 'emntho' 'eyearo +'draw string 0.050 6.45 QMax: 'qobsmax +'draw string 0.050 6.30 QMin: 'qobsmin +'draw string 0.050 6.00 Mean: 'avgobs +'draw string 0.050 5.85 Std: 'stdobs + +'draw string 0.050 3.45 Beg: 'bmntho' 'byearo +'draw string 0.050 3.30 End: 'emntho' 'eyearo +'draw string 0.050 3.05 DQMax: 'qdifmax +'draw string 0.050 2.90 DQMin: 'qdifmin +'draw string 0.050 2.60 Mean: 'avgdif +'draw string 0.050 2.45 Std: 'stddif + +if( CINTDIFF != 'NULL' ) + 'set strsiz .07' + 'draw string 0.050 1.77 Plot represents' + 'draw string 0.050 1.62 values > 'dqrel' %' + 'draw string 0.050 1.47 Relative Difference' + 'draw string 0.050 1.32 ( DQ/QMax )' +endif if( output != 'NULL' ) if( math = LOG ) diff --git a/GEOS_Util/plots/grads_util/makplotz.gs b/GEOS_Util/plots/grads_util/makplotz.gs index e8cbfa61..e6b5ae05 100644 --- a/GEOS_Util/plots/grads_util/makplotz.gs +++ b/GEOS_Util/plots/grads_util/makplotz.gs @@ -288,13 +288,14 @@ endif 'setlons' 'set vpage off' -'set string 1 c 6' +'set string 4 c 6' 'set strsiz .11' *'xlabel 1 4.25 10.5' 'draw string 4.25 10.5 EXPID: 'expid' 'mdesc -'draw string 4.25 9.95 'math' 'title' 'season' ('nmod')' +'draw string 4.25 9.95 'math' 'title' 'season' ('nmod') (blue)' +'set string 1 c 6' 'draw string 4.25 9.70 vs' -'draw string 4.25 9.45 'odesc' 'season' ('nobs') ('climate')' +'draw string 4.25 9.45 'odesc' 'season' ('nobs') ('climate') (black)' * Print Beginning and Ending Dates * -------------------------------- diff --git a/GEOS_Util/plots/grads_util/movie b/GEOS_Util/plots/grads_util/movie index 481b328b..d433a45d 100644 --- a/GEOS_Util/plots/grads_util/movie +++ b/GEOS_Util/plots/grads_util/movie @@ -15,6 +15,7 @@ if( numargs = 0 ) say ' [-print ]' say ' [-pause ]' say ' [-name ]' + say ' [-loopdim loopdim]' return endif @@ -54,17 +55,26 @@ endif rotate = false print = false pause = false + loopdim = t num = 0 while( num < numargs ) num = num + 1 -if( subwrd(args,num)='-tbeg' ) ; tbeg = subwrd(args,num+1) ; endif -if( subwrd(args,num)='-tend' ) ; tend = subwrd(args,num+1) ; endif -if( subwrd(args,num)='-print' ) ; print = true ; endif -if( subwrd(args,num)='-pause' ) ; pause = true ; endif -if( subwrd(args,num)='-rotate' ) ; rotate = true ; endif -if( subwrd(args,num)='-name' ) ; name = subwrd(args,num+1) ; endif +if( subwrd(args,num)='-tbeg' ) ; tbeg = subwrd(args,num+1) ; endif +if( subwrd(args,num)='-tend' ) ; tend = subwrd(args,num+1) ; endif +if( subwrd(args,num)='-print' ) ; print = true ; endif +if( subwrd(args,num)='-pause' ) ; pause = true ; endif +if( subwrd(args,num)='-rotate' ) ; rotate = true ; endif +if( subwrd(args,num)='-name' ) ; name = subwrd(args,num+1) ; endif +if( subwrd(args,num)='-loopdim' ) ; loopdim = subwrd(args,num+1) ; endif endwhile +if( loopdim != t ) + 'run getinfo 'loopdim'min' + tbeg = result + 'run getinfo 'loopdim'max' + tend = result +endif + if( tbeg != 0 ) t = tbeg else @@ -77,10 +87,12 @@ else tmax = gettmax() endif -say 't = 't -say 'tmax = 'tmax + +say 'movie loop begin, 'loopdim' = 'tbeg +say 'movie loop end, 'loopdim' = 'tmax say 'print = 'print + frame = 1000 'run getenv "GEOSUTIL"' @@ -90,7 +102,7 @@ frame = 1000 if( print != true ) ; 'set dbuff on' ; endif 'set csmooth on' while (t ***** +***** Usage: parea xloc yloc xmax ymax ***** ***** ***** ************************************************************* @@ -28,16 +28,30 @@ while( num < numargs ) if( subwrd(args,num)='-scalex' ) ; scalex = subwrd(args,num+1) ; endif if( subwrd(args,num)='-scaley' ) ; scaley = subwrd(args,num+1) ; endif if( subwrd(args,num)='-top' ) ; top = subwrd(args,num+1) ; endif +if( subwrd(args,num)='-bot' ) ; bot = subwrd(args,num+1) ; endif +if( subwrd(args,num)='-left' ) ; left = subwrd(args,num+1) ; endif +if( subwrd(args,num)='-right' ) ; right = subwrd(args,num+1) ; endif endwhile -'set vpage off' +say ' parea: 'xloc' 'yloc' 'xmax' 'ymax +say 'scalex: 'scalex +say 'scaley: 'scaley +say ' top: 'top + +*'set vpage off' + +'set parea off' 'getinfo page' pagex = subwrd(result,1) pagey = subwrd(result,2) - sizex = pagex sizey = pagey +say ' ' +say 'page sizex: 'sizex +say 'page sizey: 'sizey +say ' ' + pagex = pagex - left - right pagey = pagey - top - bot @@ -76,28 +90,33 @@ if( yloc != 1 & yloc != ymax ) y1 = y2 - dely endif -if( x1 < 0 ) -x1 = 0 -endif -if( y1 < 0 ) -y1 = 0 -endif -if( x2 > sizex ) -x2 = sizex -endif -if( y2 > sizey ) -y2 = sizey -endif - -'set vpage 0 'sizex' 0 'sizey + if( x1 < 0 ) + x1 = 0 + endif + if( y1 < 0 ) + y1 = 0 + endif + if( x2 > sizex ) + x2 = sizex + endif + if( y2 > sizey ) + y2 = sizey + endif + +*'set vpage 0 'sizex' 0 'sizey 'set mproj scaled' say 'parea 'x1' 'x2' (dx: 'x2-x1') 'y1' 'y2' (dy: 'y2-y1')' 'set parea 'x1' 'x2' 'y1' 'y2 'set grads off' -xmid = ( x1 + x2 )/2 +xmid = ( x1 + x2 )/2 +xleft = x1 - 0.20*delx +xright = x2 + 0.10*delx ybot = y1 - 0.12*dely ytop = y2 + 0.03*dely +ytop = y2 + 0.04*dely +ymid = ( ybot + ytop )/2 -return xmid' 'ybot' 'ytop +say 'xmid: 'xmid' ybot: 'ybot' ytop: 'ytop' ymid: 'ymid' xleft: 'xleft' xright: 'xright +return xmid' 'ybot' 'ytop' 'ymid' 'xleft' 'xright diff --git a/GEOS_Util/plots/grads_util/plot.rc b/GEOS_Util/plots/grads_util/plot.rc index ffec7c81..ae49753d 100644 --- a/GEOS_Util/plots/grads_util/plot.rc +++ b/GEOS_Util/plots/grads_util/plot.rc @@ -14,6 +14,14 @@ For Single 2-D Variable Plots: YFMT is the zonal mean Y-Format (eg: set ylab %.1f ) AXLIM is the zonal mean Axis Value Range (eg: set axlim x1 x2) +* To produce Fixed Contour Intervals and Scaling for DIFF and Closeness Plots +* --------------------------------------------------------------------------- + Add, for example: EXPORT_GC_FIXED_PLOT_FACTOR: -2 + Add, for example: EXPORT_GC_FIXED_PLOT_CINT: 45 + + Add, for example: EXPORT_GC_CLOSE_PLOT_FACTOR: -3 + Add, for example: EXPORT_GC_CLOSE_PLOT_CINT: 10 + ************************************************************************************ ************************************************************************************ @@ -93,6 +101,16 @@ SLP_DYN_1000_DLEVS: -18 -16 -14 -12 -10 -8 -6 -4 -2 2 4 6 8 10 12 14 16 18 SLP_DYN_1000_ALEVS: -4.5 -4 -3.5 -3 -2.5 -2 -1.5 -1 -.5 0.5 1 1.5 2 2.5 3 3.5 4 4.5 SLP_DYN_CINT: 4 +*SLP_DYN_FIXED_PLOT_FACTOR: -2 +*SLP_DYN_FIXED_PLOT_CINT: 45 +*SLP_DYN_CLOSE_PLOT_FACTOR: 0 +*SLP_DYN_CLOSE_PLOT_CINT: 4 + +*U_DYN_FIXED_PLOT_FACTOR: -3 +*U_DYN_FIXED_PLOT_CINT: 15 +*U_DYN_CLOSE_PLOT_FACTOR: -3 +*U_DYN_CLOSE_PLOT_CINT: 15 + U_DYN_TITLE: Zonal U-Wind (m/s) U_DYN_30_CINT: 5 U_DYN_50_CINT: 5 @@ -281,6 +299,11 @@ T_DYN_850_ALEVS: -2.7 -2.4 -2.1 -1.8 -1.5 -1.2 -.9 -.6 -.3 .3 .6 .9 1.2 1.5 1 T_DYN_925_ALEVS: -2.7 -2.4 -2.1 -1.8 -1.5 -1.2 -.9 -.6 -.3 .3 .6 .9 1.2 1.5 1.8 2.1 2.4 2.7 T_DYN_1000_ALEVS: -2.7 -2.4 -2.1 -1.8 -1.5 -1.2 -.9 -.6 -.3 .3 .6 .9 1.2 1.5 1.8 2.1 2.4 2.7 +*T_DYN_FIXED_PLOT_FACTOR: -2 +*T_DYN_FIXED_PLOT_CINT: 15 +*T_DYN_CLOSE_PLOT_FACTOR: -3 +*T_DYN_CLOSE_PLOT_CINT: 20 + O3_CHEMISTRY_TITLE: Ozone (ppm) O3_CHEMISTRY_CLAB: off O3_CHEMISTRY_Z_CCOLS: 0 56 55 49 47 45 44 37 36 34 33 32 31 21 22 23 24 25 26 27 28 @@ -313,6 +336,11 @@ O3_CHEMISTRY_.4_CVALS: 2.5 2.6 2.7 2.8 2.9 3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 O3_CHEMISTRY_.3_CVALS: 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 O3_CHEMISTRY_.1_CVALS: 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 +*Q_MOIST_FIXED_PLOT_FACTOR: -3 +*Q_MOIST_FIXED_PLOT_CINT: 35 +*Q_MOIST_CLOSE_PLOT_FACTOR: -4 +*Q_MOIST_CLOSE_PLOT_CINT: 35 + Q_MOIST_TITLE: Specific Humidity (g/kg) Q_MOIST_30_TITLE: Specific Humidity (mg/kg) Q_MOIST_50_TITLE: Specific Humidity (mg/kg) @@ -401,7 +429,6 @@ Q_MOIST_850_ALEVS: -1.8 -1.6 -1.4 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0.2 0.4 0.6 0.8 1 Q_MOIST_925_ALEVS: -1.8 -1.6 -1.4 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Q_MOIST_1000_ALEVS: -1.8 -1.6 -1.4 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 - RH2_MOIST_TITLE: Relative Humidity (%) RH2_MOIST_CCOLS: 59 58 57 56 55 54 53 52 51 50 42 43 44 45 46 47 48 49 39 38 37 36 35 34 33 32 31 21 22 23 24 25 26 27 28 29 RH2_MOIST_CVALS: 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 99 100 @@ -607,6 +634,10 @@ DUDTDYN_DYN_200_CLEVS: -7 -6 -5 -4 -3 -2 -1.5 -1 -0.5 0.5 1 1.5 2 3 4 5 6 7 DUDTDYN_DYN_150_CLEVS: -7 -6 -5 -4 -3 -2 -1.5 -1 -0.5 0.5 1 1.5 2 3 4 5 6 7 DUDTDYN_DYN_100_CLEVS: -7 -6 -5 -4 -3 -2 -1.5 -1 -0.5 0.5 1 1.5 2 3 4 5 6 7 +*DUDTDYN_DYN_FIXED_PLOT_FACTOR: -2 +*DUDTDYN_DYN_FIXED_PLOT_CINT: 1.2 +*DVDTDYN_DYN_FIXED_PLOT_FACTOR: -2 +*DVDTDYN_DYN_FIXED_PLOT_CINT: 3.0 DVDTDYN_DYN_TITLE: DVDT from Dynamics (m/sec/day) DVDTDYN_DYN_FACTOR: 86400 @@ -835,6 +866,9 @@ TIM_PHYSICS_950_CLEVS: -9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 TIM_PHYSICS_975_CLEVS: -9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 TIM_PHYSICS_1000_CLEVS: -9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 +*TIM_PHYSICS_FIXED_PLOT_FACTOR: -2 +*TIM_PHYSICS_FIXED_PLOT_CINT: 6 + DQDT_MOIST_TITLE: DQVDT from Moist Processes (g/kg/day) DQDT_MOIST_FACTOR: 86400*1000 DQDT_MOIST_CBSCALE: 0.6 @@ -880,6 +914,10 @@ CNV_MFC_MOIST_Z_DLEVS: -180 -160 -140 -120 -100 -80 -60 -40 -20 20 40 60 80 100 CNV_MFC_MOIST_Z_ACOLS: 55 49 47 45 44 36 34 33 32 0 21 22 23 24 25 26 27 28 69 CNV_MFC_MOIST_Z_ALEVS: -180 -160 -140 -120 -100 -80 -60 -40 -20 20 40 60 80 100 120 140 160 +*CNV_MFC_MOIST_FIXED_PLOT_FACTOR: 0 +*CNV_MFC_MOIST_FIXED_PLOT_CINT: 2 + + CNV_MF0_MOIST_TITLE: Cloud Base mass flux (kg/m`a2`n/day) CNV_MF0_MOIST_FACTOR: 86400 CNV_MF0_MOIST_CCOLS: 0 49 47 45 44 37 36 34 33 32 31 21 22 23 24 25 26 27 28 @@ -1230,31 +1268,46 @@ STD_DTDT_ANA_AGCM_TITLE: DTDT from Analysis (K/day) Standard_Deviation Error STD_DTDT_ANA_AGCM_FACTOR: 86400 STD_DQVDT_ANA_AGCM_TITLE: DQVDT from Analysis (g/kg/day) Standard_Deviation Error STD_DQVDT_ANA_AGCM_FACTOR: 86400000 +STD_DQVDT_ANA_AGCM_CCOLS: 50 42 44 46 48 39 37 36 34 32 31 21 22 24 25 26 27 28 29 +STD_DQVDT_ANA_AGCM_CLEVS: 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 RMS_DMDTANA_DYN_TITLE: DMDT from Analysis (mb/day) Root_Mean_Square Error RMS_DMDTANA_DYN_FACTOR: 864 RMS_DUDT_ANA_AGCM_TITLE: DUDT from Analysis (m/sec/day) Root_Mean_Square Error RMS_DUDT_ANA_AGCM_FACTOR: 86400 +RMS_DUDT_ANA_AGCM_Z_CCOLS: 50 42 44 46 48 39 37 36 34 32 31 21 22 24 25 26 27 28 29 +RMS_DUDT_ANA_AGCM_Z_CLEVS: 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.5 3 3.5 4 4.5 5 6 7 +RMS_DUDT_ANA_AGCM_ZLOG_CLEVS: 0.5 1.0 1.5 2.0 2.5 3.0 4.0 5.0 6 7 8 9 10 12 15 20 25 30 RMS_DVDT_ANA_AGCM_TITLE: DVDT from Analysis (m/sec/day) Root_Mean_Square Error RMS_DVDT_ANA_AGCM_FACTOR: 86400 +RMS_DVDT_ANA_AGCM_Z_CCOLS: 50 42 44 46 48 39 37 36 34 32 31 21 22 24 25 26 27 28 29 +RMS_DVDT_ANA_AGCM_Z_CLEVS: 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.5 3 3.5 4 4.5 5 6 7 +RMS_DVDT_ANA_AGCM_ZLOG_CLEVS: 0.5 1.0 1.5 2.0 2.5 3.0 4.0 5.0 6 7 8 9 10 12 15 20 25 30 RMS_DTDT_ANA_AGCM_TITLE: DTDT from Analysis (K/day) Root_Mean_Square Error RMS_DTDT_ANA_AGCM_FACTOR: 86400 +RMS_DTDT_ANA_AGCM_Z_CCOLS: 50 42 44 46 48 39 37 36 34 32 31 21 22 24 25 26 27 28 29 +*RMS_DTDT_ANA_AGCM_Z_CLEVS: 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3.0 3.5 4 4.5 +RMS_DTDT_ANA_AGCM_Z_CLEVS: 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.2 1.4 1.6 1.8 2.0 2.4 2.8 3.2 +RMS_DTDT_ANA_AGCM_ZLOG_CLEVS: 0.5 1.0 1.5 2.0 2.5 3.0 4.0 5.0 6 7 8 9 10 11 12 13 14 15 RMS_DQVDT_ANA_AGCM_TITLE: DQVDT from Analysis (g/kg/day) Root_Mean_Square Error RMS_DQVDT_ANA_AGCM_FACTOR: 86400000 +*RMS_DQVDT_ANA_AGCM_Z_CCOLS: 50 42 44 46 48 39 37 36 34 32 31 21 22 24 25 26 27 28 29 +*RMS_DQVDT_ANA_AGCM_Z_CLEVS: 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 + +*RES_DYN_FIXED_PLOT_FACTOR: 0 +*RES_DYN_FIXED_PLOT_CINT: 0.5 +*STR_DYN_FIXED_PLOT_FACTOR: 0 +*STR_DYN_FIXED_PLOT_CINT: 0.2 -* Uncomment These Parameters to used Fixed Contour Intervals and Scaling in Stat DIFF Plots -* ----------------------------------------------------------------------------------------- *RMS_DMDTANA_DYN_FIXED_PLOT_FACTOR: -2 *RMS_DMDTANA_DYN_FIXED_PLOT_CINT: 1.5 *RMS_DUDT_ANA_AGCM_FIXED_PLOT_FACTOR: -2 *RMS_DUDT_ANA_AGCM_FIXED_PLOT_CINT: 4 *RMS_DVDT_ANA_AGCM_FIXED_PLOT_FACTOR: -2 *RMS_DVDT_ANA_AGCM_FIXED_PLOT_CINT: 4 -*RMS_DTDT_ANA_AGCM_FIXED_PLOT_FACTOR: -2 -*RMS_DTDT_ANA_AGCM_FIXED_PLOT_CINT: 1.5 -*RMS_DQVDT_ANA_AGCM_FIXED_PLOT_FACTOR: -2 -*RMS_DQVDT_ANA_AGCM_FIXED_PLOT_CINT: 1 +*RMS_DTDT_ANA_AGCM_FIXED_PLOT_FACTOR: -3 +*RMS_DTDT_ANA_AGCM_FIXED_PLOT_CINT: 4.5 BIAS_DMDTANA_DYN_TITLE: DMDT from Analysis (mb/day) Root_Bias Error BIAS_DMDTANA_DYN_FACTOR: 864 @@ -1267,6 +1320,28 @@ BIAS_DTDT_ANA_AGCM_FACTOR: 86400 BIAS_DQVDT_ANA_AGCM_TITLE: DQVDT from Analysis (g/kg/day) Root_Bias Error BIAS_DQVDT_ANA_AGCM_FACTOR: 86400000 +*BIAS_DTDT_ANA_AGCM_FIXED_PLOT_FACTOR: -2 +*BIAS_DTDT_ANA_AGCM_FIXED_PLOT_CINT: 1 + +*RMS_DQVDT_ANA_AGCM_FIXED_PLOT_FACTOR: -2 +*RMS_DQVDT_ANA_AGCM_FIXED_PLOT_CINT: 2.0 +RMS_DQVDT_ANA_AGCM_Z_CCOLS: 50 42 44 46 48 39 37 36 34 32 31 21 22 24 25 26 27 28 29 +RMS_DQVDT_ANA_AGCM_Z_CLEVS: 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 +RMS_DQVDT_ANA_AGCM_CLEVS: 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 + +STD_DQVDT_ANA_AGCM_FIXED_PLOT_FACTOR: -3 +STD_DQVDT_ANA_AGCM_FIXED_PLOT_CINT: 30.0 +STD_DQVDT_ANA_AGCM_Z_CCOLS: 50 42 44 46 48 39 37 36 34 32 31 21 22 24 25 26 27 28 29 +STD_DQVDT_ANA_AGCM_Z_CLEVS: 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 + +*BIAS_DQVDT_ANA_AGCM_FIXED_PLOT_FACTOR: -2 +*BIAS_DQVDT_ANA_AGCM_FIXED_PLOT_CINT: 4 +*BIAS_DQVDT_ANA_AGCM_Z_CCOLS: 50 42 44 46 48 39 37 36 34 32 31 21 22 24 25 26 27 28 29 + BIAS_DQVDT_ANA_AGCM_Z_CLEVS: 2.5 5.0 7.5 10.0 12.5 15.0 17.5 20.0 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 + +*BIAS_DQVDT_ANA_AGCM_CLEVS: 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 + BIAS_DQVDT_ANA_AGCM_CLEVS: 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 + BIAS_DTDT_ANA_AGCM_Z_CLEVS: 0.04 0.08 0.12 0.16 0.20 0.24 0.28 0.32 0.36 0.40 0.44 0.48 0.52 0.56 0.60 0.64 0.68 0.72 0.76 DUDT_ANA_AGCM_TITLE: DUDT from Analysis (m/sec/day) DUDT_ANA_AGCM_FACTOR: 86400 @@ -1302,6 +1377,14 @@ DTDT_ANA_AGCM_ZLOG_CLEVS: -6 -4 -3 -2 -1.5 -1 -0.75 -0.5 -.25 .25 .5 0.75 1 1.5 DTDT_ANA_AGCM_Z_DLEVS: -2.25 -2 -1.75 -1.5 -1.25 -1 -0.75 -0.5 -.25 .25 .5 0.75 1 1.25 1.5 1.75 2 2.25 DTDT_ANA_AGCM_Z_ALEVS: -1.4 -1.2 -1.0 -.8 -.6 -.4 -0.3 -0.2 -.1 .1 .2 .3 .4 .6 .8 1.0 1.2 1.4 +*DTDT_ANA_AGCM_FIXED_PLOT_FACTOR: -2 +*DTDT_ANA_AGCM_FIXED_PLOT_CINT: 1.5 + +DQVDT_CON_AGCM_TITLE: DQVDT from Constraint (g/kg/day) +DQVDT_CON_AGCM_FACTOR: 86400000 + +*DQVDT_ANA_AGCM_FIXED_PLOT_FACTOR: -3 +*DQVDT_ANA_AGCM_FIXED_PLOT_CINT: 6 DQVDT_ANA_AGCM_TITLE: DQVDT from Analysis (g/kg/day) DQVDT_ANA_AGCM_FACTOR: 86400000 @@ -1346,13 +1429,16 @@ DQVDT_AGCM_Z_CLEVS: -1.4 -1.2 -1.0 -.8 -.6 -.4 -0.3 -0.2 -.1 .1 .2 .3 .4 .6 .8 1 DMDTDYNANAPHY_DYN_TITLE: Surface Pressure Tendency from DYN+ANA+PHY (mb/day) DMDTDYNANAPHY_DYN_FACTOR: 9.80665*864 DMDTDYNANAPHY_DYN_CCOLS: 55 49 47 45 44 36 34 33 32 0 21 22 23 24 25 26 27 28 69 -DMDTDYNANAPHY_DYN_CLEVS: -.3 -.25 -.2 -.15 -.1 -.08 -.06 -.04 -.02 .02 .04 .06 .08 .10 .15 .2 .25 .3 +DMDTDYNANAPHY_DYN_CLEVS: -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.1 0.2 0.3 0.4 0.5 .6 0.7 0.8 0.9 DMDTDYNANA_DYN_TITLE: Surface Pressure Tendency from DYN+ANA (mb/day) DMDTDYNANA_DYN_FACTOR: 9.80665*864 DMDTDYNANA_DYN_CCOLS: 55 49 47 45 44 36 34 33 32 0 21 22 23 24 25 26 27 28 69 DMDTDYNANA_DYN_CLEVS: -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.1 0.2 0.3 0.4 0.5 .6 0.7 0.8 0.9 +DPSDT_CON_AGCM_TITLE: Surface Pressure Tendency from Constraint (mb/day) +DPSDT_CON_AGCM_FACTOR: 864 + DMDTANA_DYN_TITLE: Surface Pressure Tendency from Analysis (mb/day) DMDTANA_DYN_FACTOR: 9.80665*864 DMDTANA_DYN_CCOLS: 55 49 47 45 44 36 34 33 32 0 21 22 23 24 25 26 27 28 69 diff --git a/GEOS_Util/plots/grads_util/pltsys.gs b/GEOS_Util/plots/grads_util/pltsys.gs index 6dacf576..dc393baa 100644 --- a/GEOS_Util/plots/grads_util/pltsys.gs +++ b/GEOS_Util/plots/grads_util/pltsys.gs @@ -201,7 +201,7 @@ while ( n<=numflds ) **** Begin Systematic Error Plots ... **** ******************************************************* -say 'Processing 'field' for pltsys:' +say 'Processing 'field' for pltsys, level: 'level0 if( level0 = 'NULL' | level0 = 'HORIZ' | level0 = 'ZONAL' ) diff --git a/GEOS_Util/plots/grads_util/rmscmp_plot.gs b/GEOS_Util/plots/grads_util/rmscmp_plot.gs index 544beee4..ccabb8a7 100644 --- a/GEOS_Util/plots/grads_util/rmscmp_plot.gs +++ b/GEOS_Util/plots/grads_util/rmscmp_plot.gs @@ -201,6 +201,7 @@ endwhile * ------------------------------- month = '' months = '' +season = '' n = filebeg while ( n <= fileend ) 'set dfile 'n @@ -210,16 +211,61 @@ while ( n <= fileend ) dummy = substr(date,6,3) if( dummy != month ) month = dummy + if( months = '' ) months = month else months = months'-'month - endif - endif + endif + + if( months = 'DEC-JAN-FEB' ) + if( season = '' ) + season = 'DJF' + else + season = season'-DJF' + endif + months = '' + endif + + if( months = 'MAR-APR-MAY' ) + if( season = '' ) + season = 'MAM' + else + season = season'-MAM' + endif + months = '' + endif + + if( months = 'JUN-JUL-AUG' ) + if( season = '' ) + season = 'JJA' + else + season = season'-JJA' + endif + months = '' + endif + + if( months = 'SEP-OCT-NOV' ) + if( season = '' ) + season = 'SON' + else + season = season'-SON' + endif + months = '' + endif + endif n = n + 1 endwhile +if( season != '' ) + if( months != '' ) + months = season'-'months + else + months = season + endif +endif say 'Months Used in Forecasts: 'months + * Define NDAY and NDAYMAX across ALL Experiments * ---------------------------------------------- ndaymax = 999 diff --git a/GEOS_Util/plots/grads_util/rmscmpz_plot.gs b/GEOS_Util/plots/grads_util/rmscmpz_plot.gs index 1d06c9f1..9537b3a6 100644 --- a/GEOS_Util/plots/grads_util/rmscmpz_plot.gs +++ b/GEOS_Util/plots/grads_util/rmscmpz_plot.gs @@ -182,6 +182,7 @@ endwhile * ------------------------------- month = '' months = '' +season = '' n = filebeg while ( n <= fileend ) 'set dfile 'n @@ -191,19 +192,65 @@ while ( n <= fileend ) dummy = substr(date,6,3) if( dummy != month ) month = dummy + if( months = '' ) months = month else months = months'-'month - endif - endif + endif + + if( months = 'DEC-JAN-FEB' ) + if( season = '' ) + season = 'DJF' + else + season = season'-DJF' + endif + months = '' + endif + + if( months = 'MAR-APR-MAY' ) + if( season = '' ) + season = 'MAM' + else + season = season'-MAM' + endif + months = '' + endif + + if( months = 'JUN-JUL-AUG' ) + if( season = '' ) + season = 'JJA' + else + season = season'-JJA' + endif + months = '' + endif + + if( months = 'SEP-OCT-NOV' ) + if( season = '' ) + season = 'SON' + else + season = season'-SON' + endif + months = '' + endif + + endif n = n + 1 endwhile +if( season != '' ) + if( months != '' ) + months = season'-'months + else + months = season + endif +endif say 'Months Used in Forecasts: 'months + * Define TOPLEV, NDAY and NDAYMAX across ALL Experiments * ------------------------------------------------------ - toplev = 1000 + toplev = 0 ndaymax = 999 m = 0 while( m<=mexps ) @@ -216,7 +263,7 @@ while( m<=mexps ) 'set z 'zdim 'getinfo level' level = result - if( level < toplev ) + if( level > toplev ) toplev = level endif @@ -988,57 +1035,58 @@ if( level >= levmin ) zcnt = zcnt + 1 'minmax rave0' -maxval = subwrd(result,1) -maxval = 1.02 * maxval - -axmax = 1.08 * maxval -axmin = - 0.08 * maxval - -'set vpage off' -'set parea off' -'set grads off' -'set parea 2.25 9.75 4.0 7.5' -'set axlim 'axmin' 'axmax -'d rave0' -'d rave1' -'q gr2xy 1 0' - xval = subwrd(result,3) - yval = subwrd(result,6) - - if( xval != environment ) - - say 'xval = 'xval - say 'yval = 'yval - say 'GR2XY Result, xval:yval = 'result - 'set line 2 1 3' - 'draw line 'xval' 'yval' 4 'yval - yval = yval + 0.03 - say 'New yval = 'yval - 'q xy2gr 'xval' 'yval - say 'XY2GR Result: 'result - thickness.xpos.z = subwrd(result,6) - thickness.xpos.z = thickness.xpos.z * 1000 - zsum = zsum + thickness.xpos.z - if( thickness.xpos.z > zmax ) ; zmax = thickness.xpos.z ; endif - if( thickness.xpos.z < zmin ) ; zmin = thickness.xpos.z ; endif - 'set line 3 1 3' - 'draw line 3.5 'yval' 7.5 'yval - say ' ' - say 'z = 'z' Level: 'level' LEVMIN: 'levmin' LINE_THICKNESS x 1000 = 'thickness.xpos.z - say 'zmin = 'zmin' zmax = 'zmax' zsum = 'zsum - say ' ' - say 'Hit Enter to Continue ...' - pull flag - 'c' - - else - zsum = 0 - zmin = 0 - endif +if( subwrd(result,1) != 1e+15 ) + + maxval = subwrd(result,1) + maxval = 1.02 * maxval + axmax = 1.08 * maxval + axmin = - 0.08 * maxval + + 'set vpage off' + 'set parea off' + 'set grads off' + 'set parea 2.25 9.75 4.0 7.5' + 'set axlim 'axmin' 'axmax + 'd rave0' + 'd rave1' + 'q gr2xy 1 0' + xval = subwrd(result,3) + yval = subwrd(result,6) + + if( xval != environment ) + say 'xval = 'xval + say 'yval = 'yval + say 'GR2XY Result, xval:yval = 'result + 'set line 2 1 3' + 'draw line 'xval' 'yval' 4 'yval + yval = yval + 0.03 + say 'New yval = 'yval + 'q xy2gr 'xval' 'yval + say 'XY2GR Result: 'result + thickness.xpos.z = subwrd(result,6) + thickness.xpos.z = thickness.xpos.z * 1000 + zsum = zsum + thickness.xpos.z + if( thickness.xpos.z > zmax ) ; zmax = thickness.xpos.z ; endif + if( thickness.xpos.z < zmin ) ; zmin = thickness.xpos.z ; endif + 'set line 3 1 3' + 'draw line 3.5 'yval' 7.5 'yval + say ' ' + say 'z = 'z' Level: 'level' LEVMIN: 'levmin' LINE_THICKNESS x 1000 = 'thickness.xpos.z + say 'zmin = 'zmin' zmax = 'zmax' zsum = 'zsum + say ' ' + say 'Hit Enter to Continue ...' + pull flag + 'c' + else + zsum = 0 + zmin = 0 + endif +endif endif z = z + 1 endwhile + zsum = zsum / zcnt say 'Average zthick = 'zsum @@ -1058,6 +1106,31 @@ if( mean_thickness > dcint ) ; dcint = mean_thickness ; endif say ' DCINT for plots: 'dcint say 'MIN_THICKNESS for plots: 'min_thickness +************************************************************************ +**** To hardwire contour levels within Montage plots ******** +************************************************************************ +* if( field = 'h' ) +* say 'Hardwire values for plots, dcint = '350 ; dcint = 350 +* say 'Hardwire values for plots, min_thickness = '100 ; min_thickness = 100 +* endif +* if( field = 't' ) +* say 'Hardwire values for plots, dcint = '35 ; dcint = 35 +* say 'Hardwire values for plots, min_thickness = '7 ; min_thickness = 7 +* endif +* if( field = 'u' ) +* say 'Hardwire values for plots, dcint = '50 ; dcint = 50 +* say 'Hardwire values for plots, min_thickness = '20 ; min_thickness = 20 +* endif +* if( field = 'v' ) +* say 'Hardwire values for plots, dcint = '50 ; dcint = 50 +* say 'Hardwire values for plots, min_thickness = '20 ; min_thickness = 20 +* endif +* if( field = 'q' ) +* say 'Hardwire values for plots, dcint = '20 ; dcint = 20 +* say 'Hardwire values for plots, min_thickness = '0.05 ; min_thickness = 0.05 +* endif +************************************************************************ + flag = '' while( flag = '' ) 'set vpage off' @@ -1110,6 +1183,10 @@ endif 'set clevs 'clevs 'set ccols 59 57 55 47 44 37 36 34 32 30 0 20 21 22 23 24 25 26 27 28 29' + say 'DISPLAY sigdiffcrit:' + say 'CLEVS: 'clevs + say 'CCOLS: 'ccols + ' d sigdiffcrit ' ' cbarn -xmid 6 -snum 0.70 -ndot 1' diff --git a/GEOS_Util/plots/grads_util/statdplt.gs b/GEOS_Util/plots/grads_util/statdplt.gs index 16759ca3..2f6c67bd 100644 --- a/GEOS_Util/plots/grads_util/statdplt.gs +++ b/GEOS_Util/plots/grads_util/statdplt.gs @@ -17,14 +17,14 @@ function stdiff (args) **** F Variance => FVAR = 1/N * SUM[ (F-FBAR)**2 ] **** **** A Variance => AVAR = 1/N * SUM[ (A-ABAR)**2 ] **** **** CoVariance => COV = 1/N * SUM[ (F-FBAR)*(A-ABAR) ] **** +**** **** +**** BIAS Error => BIA = [ FBAR - ABAR ]**2 **** **** Amplitude Error => AMP = [ FSTD - ASTD ]**2 **** -**** + [ FBAR - ABAR ]**2 **** **** Phase Error => PHZ = 2*[ FSTD*ASTD - COV ] **** **** **** -**** Mean Square Error = BIAS**2 + Variance **** -**** = Amplitude Error + Phase Error **** -**** MSE = VAR + MES **** -**** = AMP + PHZ **** +**** Mean Square Error = BIAS- + Amplitude- + Phase-Error **** +**** **** +**** MSE = BIA + AMP + PHZ **** **** **** ******************************************************************************** @@ -135,8 +135,8 @@ if( tipe = Dres ) else * To Unify Contour Interval and Scaling, use: delDmse , otherwise use: del'type' * ------------------------------------------------------------------------------ -* 'define dumm = regrid2( delDmse, .25, .25, bs_p1, 0, -90 )' - 'define dumm = regrid2( del'type',.25, .25, bs_p1, 0, -90 )' + 'define dumm = regrid2( delDmse, .25, .25, bs_p1, 0, -90 )' +* 'define dumm = regrid2( del'type',.25, .25, bs_p1, 0, -90 )' endif dummy = getstuff( 'dumm' ) diff --git a/GEOS_Util/plots/grads_util/statmak.gs b/GEOS_Util/plots/grads_util/statmak.gs index 1379c11b..5fbb59d8 100644 --- a/GEOS_Util/plots/grads_util/statmak.gs +++ b/GEOS_Util/plots/grads_util/statmak.gs @@ -139,184 +139,158 @@ say 'Default File DIMS: 'result **** F Variance => FVAR = 1/N * SUM[ (F-FBAR)**2 ] **** **** A Variance => AVAR = 1/N * SUM[ (A-ABAR)**2 ] **** **** CoVariance => COV = 1/N * SUM[ (F-FBAR)*(A-ABAR) ] **** +**** **** +**** BIAS Error => BIA = [ FBAR - ABAR ]**2 **** **** Amplitude Error => AMP = [ FSTD - ASTD ]**2 **** -**** + [ FBAR - ABAR ]**2 **** **** Phase Error => PHZ = 2*[ FSTD*ASTD - COV ] **** **** **** -**** Mean Square Error = BIAS**2 + Variance **** -**** = Amplitude Error + Phase Error **** -**** MSE = VAR + MES **** -**** = AMP + PHZ **** +**** Mean Square Error = BIAS Error **** +**** + Amplitude Error **** +**** + Phase Error **** +**** **** +**** MSE = BIA + AMP + PHZ **** **** **** ******************************************************************************** * Compute forecast statistics * --------------------------- * fma: forecast minus analysis -* fmc: forecast minus climatology * mes: mean error squared * mse: mean square error * rms: root mean square error * std: standard deviation * -------------------------------------------------- -* Define FMA variables -* -------------------- -say 'Defining FMA variables for Field: 'field' and tag: 'tag -say '--------------------------------- ' - - n = 1 +* Compute 2D Fields +* ----------------- +'setlons' +'sety' + +'define 'field'fm'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'am'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'fma'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'mse'tag' = lat-lat + lon-lon + lev-lev' + +n = 1 while ( n <= numfiles ) +say 'Processing Field: 'field' for File: 'n' Tag: 'tag * Note: Add and Subtract uf & vf to force similar UNDEF locations * --------------------------------------------------------------- if( field = chi ) - 'define uaa = ua.'n'+uf.'n'-uf.'n - 'define vaa = va.'n'+vf.'n'-vf.'n + 'define uaa'n' = ua.'n'+uf.'n'-uf.'n + 'define vaa'n' = va.'n'+vf.'n'-vf.'n 'define chif'n' = fish_chi(uf.'n',vf.'n')' - 'define chia'n' = fish_chi(uaa,vaa)' + 'define chia'n' = fish_chi(uaa'n',vaa'n')' 'define chif'n' = chif'n'-aave(chif'n',g)' 'define chia'n' = chia'n'-aave(chia'n',g)' endif if( field = psi ) - 'define uaa = ua.'n'+uf.'n'-uf.'n - 'define vaa = va.'n'+vf.'n'-vf.'n + 'define uaa'n' = ua.'n'+uf.'n'-uf.'n + 'define vaa'n' = va.'n'+vf.'n'-vf.'n 'define psif'n' = fish_psi(uf.'n',vf.'n')' - 'define psia'n' = fish_psi(uaa,vaa)' + 'define psia'n' = fish_psi(uaa'n',vaa'n')' 'define psif'n' = psif'n'-aave(psif'n',g)' 'define psia'n' = psia'n'-aave(psia'n',g)' endif + if( field = chi | field = psi ) - 'define f = 'field'f'n - 'define a = 'field'a'n + 'define 'field'fm'tag' = 'field'fm'tag' + 'field'f'n + 'define 'field'am'tag' = 'field'am'tag' + 'field'a'n + 'define 'field'fma'tag' = 'field'fma'tag' + 'field'f'n'-'field'a'n + 'define 'field'mse'tag' = 'field'mse'tag' + pow('field'f'n'-'field'a'n',2)' + 'define 'field'mse'tag''n' = pow('field'f'n'-'field'a'n',2)' else - 'define f = 'field'f.'n - 'define a = 'field'a.'n + 'define 'field'fs = 'field'f.'n'*'scale + 'define 'field'as = 'field'a.'n'*'scale + 'define 'field'cs = 'field'c.'n'*'scale + + 'define 'field'fm'tag' = 'field'fm'tag' + 'field'fs' + 'define 'field'am'tag' = 'field'am'tag' + 'field'as' + 'define 'field'fma'tag' = 'field'fma'tag' + 'field'fs-'field'as' + 'define 'field'mse'tag' = 'field'mse'tag' + pow('field'fs-'field'as,2)' + 'define 'field'mse'tag''n' = pow('field'fs-'field'as,2)' endif - 'define 'field'f'tag''n' = f *'scale - 'define 'field'a'tag''n' = a *'scale - 'define 'field'fma'tag''n' = (f-a)*'scale +n = n + 1 +endwhile - 'define 'field'Xmse'tag''n' = pow( 'field'fma'tag''n',2 )' +'define 'field'fm'tag' = 'field'fm'tag' /'numfiles +'define 'field'am'tag' = 'field'am'tag' /'numfiles +'define 'field'fma'tag' = 'field'fma'tag'/'numfiles +'define 'field'mse'tag' = 'field'mse'tag'/'numfiles - n = n + 1 -endwhile +'undefine 'field'fs' +'undefine 'field'as' -* Compute MeanErrorSquared MES and MeanSquareError MSE for f, a, and fma -* ---------------------------------------------------------------------- -* fbar = 1/N * SUM[ F ] -* abar = 1/N * SUM[ A ] -* fma1 = 1/N * SUM[ (F-A) ] -* fma2 = 1/N * SUM[ (F-A)**2 ] -* ---------------------------------------------------------------------- - 'define 'field'fma1'tag' = lat-lat+lon-lon' - 'define 'field'fma2'tag' = lat-lat+lon-lon' - 'define 'field'fbar'tag' = lat-lat+lon-lon' - 'define 'field'abar'tag' = lat-lat+lon-lon' - n = 1 -while ( n <= numfiles ) - 'define 'field'fbar'tag' = 'field'fbar'tag' + 'field'f'tag''n - 'define 'field'abar'tag' = 'field'abar'tag' + 'field'a'tag''n - 'define 'field'fma1'tag' = 'field'fma1'tag' + 'field'fma'tag''n - 'define 'field'fma2'tag' = 'field'fma2'tag' + pow( 'field'fma'tag''n',2 )' - n = n + 1 -endwhile - 'define 'field'fbar'tag' = 'field'fbar'tag' / 'numfiles - 'define 'field'abar'tag' = 'field'abar'tag' / 'numfiles - 'define 'field'fma1'tag' = 'field'fma1'tag' / 'numfiles - 'define 'field'fma2'tag' = 'field'fma2'tag' / 'numfiles -* ---------------------------------------------------------------------- -* Xmes = { 1/N * SUM[ (F-A) ] }**2 = [ fbar-abar ]**2 -* Xmse = { 1/N * SUM[ (F-A)**2 ] } -* ---------------------------------------------------------------------- - 'define 'field'Xmes'tag' = pow( 'field'fma1'tag',2 )' - 'define 'field'Xmse'tag' = 'field'fma2'tag - - -* Compute Variance VAR for f, a, and fma -* -------------------------------------- -* fvar = 1/N * SUM[ (F-FBAR)**2 ] -* avar = 1/N * SUM[ (A-ABAR)**2 ] -* cvar = 1/N * SUM[ (F-FBAR)*(A-ABAR ] -* Xvar = 1/N * SUM[ ( (F-A)-(FBAR-ABAR) )**2 ] -* fstd = SQRT[ fvar ] -* astd = SQRT[ avar ] -* ---------------------------------------------------------------------- - n = 1 +'define 'field'mes'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'varf'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'vara'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'cov'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'rnd'tag' = lat-lat + lon-lon + lev-lev' +n = 1 while ( n <= numfiles ) - 'define 'field'fvar'tag''n' = pow( 'field'f'tag''n' -'field'fbar'tag',2 )' - 'define 'field'avar'tag''n' = pow( 'field'a'tag''n' -'field'abar'tag',2 )' - 'define 'field'cvar'tag''n' = ( 'field'f'tag''n' -'field'fbar'tag') * ( 'field'a'tag''n' -'field'abar'tag') ' - 'define 'field'Xvar'tag''n' = pow( 'field'fma'tag''n'-'field'fma1'tag',2 )' - 'define 'field'fstd'tag''n' = sqrt( 'field'fvar'tag''n' )' - 'define 'field'astd'tag''n' = sqrt( 'field'avar'tag''n' )' -* 'define 'field'ampl'tag''n' = pow( 'field'fstd'tag''n'-'field'astd'tag''n',2 ) + pow( 'field'fbar'tag'-'field'abar'tag',2 )' - 'define 'field'ampl'tag''n' = pow( 'field'fstd'tag''n'-'field'astd'tag''n',2 ) ' - 'define 'field'phaz'tag''n' = 2*( 'field'fstd'tag''n'*'field'astd'tag''n' - 'field'cvar'tag''n' )' - - 'undefine 'field'f'tag''n - 'undefine 'field'a'tag''n - 'undefine 'field'fma'tag''n - 'undefine 'field'fstd'tag''n - 'undefine 'field'astd'tag''n - n = n + 1 +'define 'field'mes'tag' = 'field'mes'tag' + pow( 'field'fm'tag'-'field'am'tag',2)' +'define 'field'varf'tag' = 'field'varf'tag' + pow( 'field'f.'n'*'scale'-'field'fm'tag',2)' +'define 'field'vara'tag' = 'field'vara'tag' + pow( 'field'a.'n'*'scale'-'field'am'tag',2)' +'define 'field'cov'tag' = 'field'cov'tag' + ('field'f.'n'*'scale'-'field'fm'tag') * ('field'a.'n'*'scale'-'field'am'tag')' +'define 'field'rnd'tag' = 'field'rnd'tag' + pow( ('field'f.'n'*'scale'-'field'fm'tag') - ('field'a.'n'*'scale'-'field'am'tag') , 2)' +n = n + 1 endwhile +'define 'field'mes'tag' = 'field'mes'tag' /'numfiles +'define 'field'varf'tag' = 'field'varf'tag'/'numfiles +'define 'field'vara'tag' = 'field'vara'tag'/'numfiles +'define 'field'cov'tag' = 'field'cov'tag' /'numfiles +'define 'field'rnd'tag' = 'field'rnd'tag' /'numfiles - 'define 'field'fvar'tag' = lat-lat+lon-lon' - 'define 'field'avar'tag' = lat-lat+lon-lon' - 'define 'field'cvar'tag' = lat-lat+lon-lon' - 'define 'field'Xvar'tag' = lat-lat+lon-lon' - n = 1 -while ( n <= numfiles ) - 'define 'field'fvar'tag' = 'field'fvar'tag' + 'field'fvar'tag''n - 'define 'field'avar'tag' = 'field'avar'tag' + 'field'avar'tag''n - 'define 'field'cvar'tag' = 'field'cvar'tag' + 'field'cvar'tag''n - 'define 'field'Xvar'tag' = 'field'Xvar'tag' + 'field'Xvar'tag''n - n = n + 1 -endwhile - 'define 'field'fvar'tag' = 'field'fvar'tag' / 'numfiles - 'define 'field'avar'tag' = 'field'avar'tag' / 'numfiles - 'define 'field'cvar'tag' = 'field'cvar'tag' / 'numfiles - 'define 'field'Xvar'tag' = 'field'Xvar'tag' / 'numfiles - 'define 'field'fstd'tag' = sqrt( 'field'fvar'tag' )' - 'define 'field'astd'tag' = sqrt( 'field'avar'tag' )' +'define 'field'stdf'tag' = sqrt('field'varf'tag')' +'define 'field'stda'tag' = sqrt('field'vara'tag')' -* 'define 'field'ampl'tag' = pow( 'field'fstd'tag'-'field'astd'tag',2 ) + pow( 'field'fbar'tag'-'field'abar'tag',2 )' - 'define 'field'ampl'tag' = pow( 'field'fstd'tag'-'field'astd'tag',2 ) ' - 'define 'field'phaz'tag' = 2*( 'field'fstd'tag'*'field'astd'tag' - 'field'cvar'tag' )' +'define 'field'ampl'tag' = pow( 'field'stdf'tag'-'field'stda'tag',2 )' +'define 'field'phaz'tag' = 2*( 'field'stdf'tag'*'field'stda'tag' - 'field'cov'tag')' +'define 'field'ramp'tag' = sqrt( 'field'ampl'tag' )' +'define 'field'rphz'tag' = sqrt( 'field'phaz'tag' )' +'define 'field'rrnd'tag' = sqrt( 'field'rnd'tag' )' -* -------------------------------------------------------------- -* -------------------------------------------------------------- +'define 'field'rmes'tag' = sqrt('field'mes'tag')' +'define 'field'rms'tag' = sqrt('field'mse'tag')' +'define 'field'var'tag' = 'field'mse'tag'-'field'mes'tag +'define 'field'std'tag' = sqrt('field'mse'tag'-'field'mes'tag')' -* Define Zonal-Mean F, A, and FMA variables -* ----------------------------------------- -if( zfreq = 'varying' ) - say 'Defining Zonal-Mean FMA variables for Field: 'field' and tag: 'tag - say '-------------------------------------------- ' - - 'makez 'field'Xmes'tag' z' - 'makez 'field'Xmse'tag' z' - 'makez 'field'fvar'tag' z' - 'makez 'field'avar'tag' z' - 'makez 'field'cvar'tag' z' - 'makez 'field'Xvar'tag' z' - 'makez 'field'ampl'tag' z' - 'makez 'field'phaz'tag' z' +* ----------------------------------------------------------------- -else - say 'Skipping: Defining Zonal-Mean FMA variables for Field: 'field' and tag: 'tag - say '------------------------------------------------------ ' + +'define 'field'rmes'tag' = sqrt('field'mes'tag')' +'define 'field'ramp'tag' = sqrt('field'ampl'tag')' +'define 'field'rphz'tag' = sqrt('field'phaz'tag')' + + +* ----------------------------------------------------------------- + +if( zfreq = 'varying' ) + 'makez 'field'fm'tag' z' + 'makez 'field'am'tag' z' + 'makez 'field'fma'tag' z' + 'makez 'field'mes'tag' z' + 'makez 'field'mse'tag' z' + 'makez 'field'ampl'tag' z' + 'makez 'field'phaz'tag' z' + 'define 'field'rmes'tag'z = sqrt('field'mes'tag'z)' + 'define 'field'ramp'tag'z = sqrt('field'ampl'tag'z)' + 'define 'field'rphz'tag'z = sqrt('field'phaz'tag'z)' + 'define 'field'rms'tag'z = sqrt('field'mse'tag'z)' + 'define 'field'var'tag'z = 'field'mse'tag'z-'field'mes'tag'z' + 'define 'field'std'tag'z = sqrt('field'mse'tag'z-'field'mes'tag'z)' endif -* -------------------------------------------------------------- * Compute TAG & CTL Variables: X & Y, and Diff Variable: Z = X-Y * For: mean-error-squared(mes), mean-square-error(mse), variance(var) * ------------------------------------------------------------------- + if( tag != ctl ) say 'Computing Difference Variables for Field: 'field' and TAGs: 'tag' and 'ctl say '----------------------------------------- ' @@ -332,64 +306,21 @@ if( tag != ctl ) * AMP: Damp = ampl_tag - ampl_ctl * PHZ: Dphz = phaz_tag - phaz_ctl * ---------------------------------------------------------------------- - n = 1 - while ( n <= numfiles ) - 'define 'field'Dmse'tag''n' = 'field'Xmse'tag''n' - 'field'Xmse'ctl''n - 'define 'field'Dfvr'tag''n' = 'field'fvar'tag''n' - 'field'fvar'ctl''n - 'define 'field'Davr'tag''n' = 'field'avar'tag''n' - 'field'avar'ctl''n - 'define 'field'Dcvr'tag''n' = 'field'cvar'tag''n' - 'field'cvar'ctl''n - 'define 'field'Dvar'tag''n' = 'field'Xvar'tag''n' - 'field'Xvar'ctl''n - 'define 'field'Dmes'tag''n' = 'field'Xmes'tag' - 'field'Xmes'ctl - 'define 'field'Damp'tag''n' = 'field'ampl'tag''n' - 'field'ampl'ctl''n - 'define 'field'Dphz'tag''n' = 'field'phaz'tag''n' - 'field'phaz'ctl''n - n = n + 1 - endwhile -* Define D-Variable Means -* ---------------------- - 'define 'field'Dmse'tag' = lat-lat+lon-lon' - 'define 'field'Dfvr'tag' = lat-lat+lon-lon' - 'define 'field'Davr'tag' = lat-lat+lon-lon' - 'define 'field'Dcvr'tag' = lat-lat+lon-lon' - 'define 'field'Dvar'tag' = lat-lat+lon-lon' - 'define 'field'Dmes'tag' = lat-lat+lon-lon' - 'define 'field'Damp'tag' = lat-lat+lon-lon' - 'define 'field'Dphz'tag' = lat-lat+lon-lon' + 'define 'field'Dmse'tag' = 'field'mse'tag' - 'field'mse'ctl + 'define 'field'Dmes'tag' = 'field'mes'tag' - 'field'mes'ctl + 'define 'field'Damp'tag' = 'field'ampl'tag' - 'field'ampl'ctl + 'define 'field'Dphz'tag' = 'field'phaz'tag' - 'field'phaz'ctl + n = 1 while ( n <= numfiles ) - 'define 'field'Dmse'tag' = 'field'Dmse'tag' + 'field'Dmse'tag''n - 'define 'field'Dfvr'tag' = 'field'Dfvr'tag' + 'field'Dfvr'tag''n - 'define 'field'Davr'tag' = 'field'Davr'tag' + 'field'Davr'tag''n - 'define 'field'Dcvr'tag' = 'field'Dcvr'tag' + 'field'Dcvr'tag''n - 'define 'field'Dvar'tag' = 'field'Dvar'tag' + 'field'Dvar'tag''n - 'define 'field'Dmes'tag' = 'field'Dmes'tag' + 'field'Dmes'tag''n - 'define 'field'Damp'tag' = 'field'Damp'tag' + 'field'Damp'tag''n - 'define 'field'Dphz'tag' = 'field'Dphz'tag' + 'field'Dphz'tag''n - - 'undefine 'field'Dfvr'tag''n - 'undefine 'field'Davr'tag''n - 'undefine 'field'Dcvr'tag''n - 'undefine 'field'Dvar'tag''n - 'undefine 'field'Dmes'tag''n - 'undefine 'field'Damp'tag''n - 'undefine 'field'Dphz'tag''n + 'define 'field'Dmse'tag''n' = 'field'mse'tag''n' - 'field'mse'ctl''n n = n + 1 endwhile - 'define 'field'Dmse'tag' = 'field'Dmse'tag' / 'numfiles - 'define 'field'Dfvr'tag' = 'field'Dfvr'tag' / 'numfiles - 'define 'field'Davr'tag' = 'field'Davr'tag' / 'numfiles - 'define 'field'Dcvr'tag' = 'field'Dcvr'tag' / 'numfiles - 'define 'field'Dvar'tag' = 'field'Dvar'tag' / 'numfiles - 'define 'field'Dmes'tag' = 'field'Dmes'tag' / 'numfiles - 'define 'field'Damp'tag' = 'field'Damp'tag' / 'numfiles - 'define 'field'Dphz'tag' = 'field'Dphz'tag' / 'numfiles - -* 'define 'field'Damp'tag' = 'field'ampl'tag' - 'field'ampl'ctl -* 'define 'field'Dphz'tag' = 'field'phaz'tag' - 'field'phaz'ctl * Define Variances of MSE Differences * ----------------------------------- - 'define 'field'DDmse'tag' = lat-lat+lon-lon' + 'define 'field'DDmse'tag' = lat-lat + lon-lon + lev-lev' n = 1 while ( n <= numfiles ) 'define 'field'DDmse'tag' = 'field'DDmse'tag' + pow( 'field'Dmse'tag''n'-'field'Dmse'tag',2 )' @@ -405,7 +336,6 @@ if( zfreq = 'varying' ) say '------------------------------------------------------ ' 'makez 'field'Dmes'tag' z' 'makez 'field'Dmse'tag' z' - 'makez 'field'Dvar'tag' z' 'makez 'field'Damp'tag' z' 'makez 'field'Dphz'tag' z' @@ -416,7 +346,7 @@ if( zfreq = 'varying' ) endwhile 'set lon 0' - 'define 'field'DDmse'tag'z = lat-lat' + 'define 'field'DDmse'tag'z = lat-lat + lev-lev' n = 1 while ( n <= numfiles ) 'define 'field'DDmse'tag'z = 'field'DDmse'tag'z + pow( 'field'Dmse'tag''n'z-'field'Dmse'tag'z,2 )' diff --git a/GEOS_Util/plots/grads_util/statmak_sys.gs b/GEOS_Util/plots/grads_util/statmak_sys.gs index 49c7ecd3..d1ba3768 100644 --- a/GEOS_Util/plots/grads_util/statmak_sys.gs +++ b/GEOS_Util/plots/grads_util/statmak_sys.gs @@ -50,11 +50,8 @@ endif 'set dfile 1' 'set t 1' -'setlons' -'sety' 'set z 'zmin' 'zmax - * Define Number of Forecast Days and Time Interval (hrs) * ------------------------------------------------------ 'run getinfo tinc' @@ -85,23 +82,17 @@ endif * std: standard deviation * -------------------------------------------------- -'define 'field'fm = lat-lat+lon-lon' -'define 'field'am = lat-lat+lon-lon' -'define 'field'cm = lat-lat+lon-lon' -'define 'field'fma = lat-lat+lon-lon' -'define 'field'fmc = lat-lat+lon-lon' -'define 'field'mes = lat-lat+lon-lon' -'define 'field'mse = lat-lat+lon-lon' -'define 'field'rms = lat-lat+lon-lon' -'define 'field'std = lat-lat+lon-lon' -'define 'field'var = lat-lat+lon-lon' - -'define 'field'varf = lat-lat+lon-lon' -'define 'field'vara = lat-lat+lon-lon' -'define 'field'stdf = lat-lat+lon-lon' -'define 'field'stda = lat-lat+lon-lon' -'define 'field'cov = lat-lat+lon-lon' -'define 'field'rnd = lat-lat+lon-lon' +* Compute 2D Fields +* ----------------- +'setlons' +'sety' + +'define 'field'fm'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'am'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'cm'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'fma'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'fmc'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'mse'tag' = lat-lat + lon-lon + lev-lev' n = 1 while ( n <= numfiles ) @@ -131,95 +122,199 @@ say 'Processing Field: 'field' for File: 'n' Tag: 'tag endif if( field = chi | field = psi ) - 'define 'field'fm = 'field'fm + 'field'f'n - 'define 'field'am = 'field'am + 'field'a'n - 'define 'field'cm = 'field'cm + 'field'c'n - 'define 'field'fma = 'field'fma + 'field'f'n'-'field'a'n - 'define 'field'fmc = 'field'fmc + 'field'f'n'-'field'c'n - 'define 'field'mse = 'field'mse + pow('field'f'n'-'field'a'n',2)' - endif - if( field != chi & field != psi ) + 'define 'field'fm'tag' = 'field'fm'tag' + 'field'f'n + 'define 'field'am'tag' = 'field'am'tag' + 'field'a'n + 'define 'field'cm'tag' = 'field'cm'tag' + 'field'c'n + 'define 'field'fma'tag' = 'field'fma'tag' + 'field'f'n'-'field'a'n + 'define 'field'fmc'tag' = 'field'fmc'tag' + 'field'f'n'-'field'c'n + 'define 'field'mse'tag' = 'field'mse'tag' + pow('field'f'n'-'field'a'n',2)' + else 'define 'field'fs = 'field'f.'n'*'scale 'define 'field'as = 'field'a.'n'*'scale 'define 'field'cs = 'field'c.'n'*'scale - 'define 'field'fm = 'field'fm + 'field'fs' - 'define 'field'am = 'field'am + 'field'as' - 'define 'field'cm = 'field'cm + 'field'cs' - 'define 'field'fma = 'field'fma + 'field'fs-'field'as' - 'define 'field'fmc = 'field'fmc + 'field'fs-'field'cs' - 'define 'field'mse = 'field'mse + pow('field'fs-'field'as,2)' + 'define 'field'fm'tag' = 'field'fm'tag' + 'field'fs' + 'define 'field'am'tag' = 'field'am'tag' + 'field'as' + 'define 'field'cm'tag' = 'field'cm'tag' + 'field'cs' + 'define 'field'fma'tag' = 'field'fma'tag' + 'field'fs-'field'as' + 'define 'field'fmc'tag' = 'field'fmc'tag' + 'field'fs-'field'cs' + 'define 'field'mse'tag' = 'field'mse'tag' + pow('field'fs-'field'as,2)' endif n = n + 1 endwhile -'define 'field'fm'tag' = 'field'fm /'numfiles -'define 'field'am'tag' = 'field'am /'numfiles -'define 'field'cm'tag' = 'field'cm /'numfiles -'define 'field'fma'tag' = 'field'fma/'numfiles -'define 'field'fmc'tag' = 'field'fmc/'numfiles -'define 'field'mse'tag' = 'field'mse/'numfiles +'define 'field'fm'tag' = 'field'fm'tag' /'numfiles +'define 'field'am'tag' = 'field'am'tag' /'numfiles +'define 'field'cm'tag' = 'field'cm'tag' /'numfiles +'define 'field'fma'tag' = 'field'fma'tag'/'numfiles +'define 'field'fmc'tag' = 'field'fmc'tag'/'numfiles +'define 'field'mse'tag' = 'field'mse'tag'/'numfiles 'undefine 'field'fs' 'undefine 'field'as' 'undefine 'field'cs' -'undefine 'field'fm' -'undefine 'field'am' -'undefine 'field'cm' -'undefine 'field'fmc' -'undefine 'field'mse' + + +'define 'field'mes'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'varf'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'vara'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'cov'tag' = lat-lat + lon-lon + lev-lev' +'define 'field'rnd'tag' = lat-lat + lon-lon + lev-lev' n = 1 while ( n <= numfiles ) -'define 'field'mes = 'field'mes + pow( 'field'fm'tag'-'field'am'tag',2)' -'define 'field'varf = 'field'varf + pow( 'field'f.'n'*'scale'-'field'fm'tag',2)' -'define 'field'vara = 'field'vara + pow( 'field'a.'n'*'scale'-'field'am'tag',2)' -'define 'field'cov = 'field'cov + ('field'f.'n'*'scale'-'field'fm'tag') * ('field'a.'n'*'scale'-'field'am'tag')' -'define 'field'rnd = 'field'rnd + pow( ('field'f.'n'*'scale'-'field'fm'tag') - ('field'a.'n'*'scale'-'field'am'tag') , 2)' +'define 'field'mes'tag' = 'field'mes'tag' + pow( 'field'fm'tag'-'field'am'tag',2)' +'define 'field'varf'tag' = 'field'varf'tag' + pow( 'field'f.'n'*'scale'-'field'fm'tag',2)' +'define 'field'vara'tag' = 'field'vara'tag' + pow( 'field'a.'n'*'scale'-'field'am'tag',2)' +'define 'field'cov'tag' = 'field'cov'tag' + ('field'f.'n'*'scale'-'field'fm'tag') * ('field'a.'n'*'scale'-'field'am'tag')' +'define 'field'rnd'tag' = 'field'rnd'tag' + pow( ('field'f.'n'*'scale'-'field'fm'tag') - ('field'a.'n'*'scale'-'field'am'tag') , 2)' n = n + 1 endwhile +'define 'field'mes'tag' = 'field'mes'tag' /'numfiles +'define 'field'varf'tag' = 'field'varf'tag'/'numfiles +'define 'field'vara'tag' = 'field'vara'tag'/'numfiles +'define 'field'cov'tag' = 'field'cov'tag' /'numfiles +'define 'field'rnd'tag' = 'field'rnd'tag' /'numfiles -'define 'field'cov'tag' = 'field'cov /'numfiles -'define 'field'rnd'tag' = 'field'rnd /'numfiles -'define 'field'varf'tag' = 'field'varf/'numfiles -'define 'field'vara'tag' = 'field'vara/'numfiles -'define 'field'stdf'tag' = sqrt('field'varf'tag')' -'define 'field'stda'tag' = sqrt('field'vara'tag')' -* Original AMPL definition (includes both Mean and STD diffs) -* ----------------------------------------------------------- -*'define 'field'ampl'tag' = pow( 'field'stdf'tag'-'field'stda'tag',2 ) + pow( 'field'fm'tag'-'field'am'tag',2 )' +'define 'field'stdf'tag' = sqrt('field'varf'tag')' +'define 'field'stda'tag' = sqrt('field'vara'tag')' -'define 'field'ampl'tag' = pow( 'field'stdf'tag'-'field'stda'tag',2 )' -'define 'field'phaz'tag' = 2*( 'field'stdf'tag'*'field'stda'tag' - 'field'cov'tag')' -'define 'field'ramp'tag' = sqrt( 'field'ampl'tag' )' -'define 'field'rphz'tag' = sqrt( 'field'phaz'tag' )' -'define 'field'rrnd'tag' = sqrt( 'field'rnd'tag' )' +'define 'field'ampl'tag' = pow( 'field'stdf'tag'-'field'stda'tag',2 )' +'define 'field'phaz'tag' = 2*( 'field'stdf'tag'*'field'stda'tag' - 'field'cov'tag')' +'define 'field'ramp'tag' = sqrt( 'field'ampl'tag' )' +'define 'field'rphz'tag' = sqrt( 'field'phaz'tag' )' +'define 'field'rrnd'tag' = sqrt( 'field'rnd'tag' )' -'define 'field'mes'tag' = 'field'mes/'numfiles 'define 'field'rmes'tag' = sqrt('field'mes'tag')' 'define 'field'rms'tag' = sqrt('field'mse'tag')' 'define 'field'var'tag' = 'field'mse'tag'-'field'mes'tag 'define 'field'std'tag' = sqrt('field'mse'tag'-'field'mes'tag')' +* ----------------------------------------------------------------- + + +'define 'field'rmes'tag' = sqrt('field'mes'tag')' +'define 'field'ramp'tag' = sqrt('field'ampl'tag')' +'define 'field'rphz'tag' = sqrt('field'phaz'tag')' + + +* ----------------------------------------------------------------- + if( zfreq = 'varying' ) -'makez 'field'fm'tag' z' -'makez 'field'am'tag' z' -'makez 'field'cm'tag' z' -'makez 'field'fma'tag' z' -'makez 'field'fmc'tag' z' -'makez 'field'mes'tag' z' -'makez 'field'mse'tag' z' -'makez 'field'ampl'tag' z' -'makez 'field'phaz'tag' z' - -'define 'field'rmes'tag'z = sqrt('field'mes'tag'z)' -'define 'field'ramp'tag'z = sqrt('field'ampl'tag'z)' -'define 'field'rphz'tag'z = sqrt('field'phaz'tag'z)' -'define 'field'rms'tag'z = sqrt('field'mse'tag'z)' -'define 'field'var'tag'z = 'field'mse'tag'z-'field'mes'tag'z' -'define 'field'std'tag'z = sqrt('field'mse'tag'z-'field'mes'tag'z)' + 'makez 'field'fm'tag' z' + 'makez 'field'am'tag' z' + 'makez 'field'cm'tag' z' + 'makez 'field'fma'tag' z' + 'makez 'field'fmc'tag' z' + 'makez 'field'mes'tag' z' + 'makez 'field'mse'tag' z' + 'makez 'field'ampl'tag' z' + 'makez 'field'phaz'tag' z' + 'define 'field'rmes'tag'z = sqrt('field'mes'tag'z)' + 'define 'field'ramp'tag'z = sqrt('field'ampl'tag'z)' + 'define 'field'rphz'tag'z = sqrt('field'phaz'tag'z)' + 'define 'field'rms'tag'z = sqrt('field'mse'tag'z)' + 'define 'field'var'tag'z = 'field'mse'tag'z-'field'mes'tag'z' + 'define 'field'std'tag'z = sqrt('field'mse'tag'z-'field'mes'tag'z)' endif return + +function region(args) + +reg = subwrd(args,1) + + 'set dfile 1' + + if( reg = 'GLO' ) + 'setx' + 'sety' + 'run getinfo xdim' + xend = result + xbeg = 1 + 'run getinfo ydim' + yend = result + ybeg = 1 + endif + if( reg = 'NHE' ) + 'setx' + 'set lat 20 90' + 'run getinfo xdim' + xend = result + xbeg = 1 + 'run getinfo ymax' + yend = result + 'run getinfo ymin' + ybeg = result + endif + if( reg = 'TRO' ) + 'setx' + 'set lat -20 20' + 'run getinfo xdim' + xend = result + xbeg = 1 + 'run getinfo ymax' + yend = result + 'run getinfo ymin' + ybeg = result + endif + if( reg = 'SHE' ) + 'setx' + 'set lat -90 -20' + 'run getinfo xdim' + xend = result + xbeg = 1 + 'run getinfo ymax' + yend = result + 'run getinfo ymin' + ybeg = result + endif + +return xbeg' 'xend' 'ybeg' 'yend + +function masks (name,latbeg,latend) +'set dfile 1' +'set lon -180 360' +'sety' +'setz' +'define masc = maskout( 1 ,lat-'latbeg' )' +'define masc = maskout( masc,'latend'-lat )' +'set sdfwrite -4d mask.nc4' +'set undef 0.0' +'sdfwrite masc' + +'sdfopen mask.nc4' +'getinfo numfiles' + newfile = result +'set dfile 'newfile + +'q ctlinfo' + ctlinfo = result + + fname = mask.ctl +'!remove 'fname + n = 1 + line = sublin(ctlinfo,n) + write(fname,line) + while( line != 'endvars' ) + n = n + 1 + line = sublin(ctlinfo,n) + word = subwrd(line,1) + if( word = 'undef' ) + line = 'undef 1e15' + endif + write(fname,line,append) + endwhile + close = close(fname) + +'close 'newfile +'open 'fname +'getinfo numfiles' + newfile = result +'set dfile 'newfile +'define 'name' = masc.'newfile +'close 'newfile +return + diff --git a/GEOS_Util/plots/grads_util/stats b/GEOS_Util/plots/grads_util/stats index 8c8f7150..3e8cee65 100644 --- a/GEOS_Util/plots/grads_util/stats +++ b/GEOS_Util/plots/grads_util/stats @@ -2,6 +2,10 @@ function stats (args) name = subwrd(args,1) pi = 3.141592654 +'getinfo undef' + undef = result +'set undef 'undef + 'getinfo xfreq' xfreq = result 'getinfo zfreq' @@ -42,35 +46,142 @@ if( xfreq = 'fixed' & zfreq = 'varying' ) if( zlev2 < zlev1 ) zmin = zlev2 zmax = zlev1 - endif + endif + + 'set lat 'lat1 + 'getinfo ypos' + ypos1=result + 'set lat 'lat2 + 'getinfo ypos' + ypos2=result + n = 0 z = zmin 'set z 'z - 'define avg = lat-lat' - 'define rms = lat-lat' + 'set lat 'lat1 + 'define avg = 0' + 'define rms = 0' while( z<=zmax ) 'set z 'z - 'define avg = avg + ave('name' *cos(lat*'pi'/180),lat='lat1',lat='lat2')' - 'define rms = rms + ave( pow('name',2)*cos(lat*'pi'/180),lat='lat1',lat='lat2')' - n = n + 1 + +* Old Method (Fails where UNDEF) +* ------------------------------ +* 'define avg = avg + ave('name' ,lat='lat1',lat='lat2')' +* 'define rms = rms + ave( pow('name',2),lat='lat1',lat='lat2')' +* n = n + 1 + +* New Method (Accounts for UNDEF) +* ------------------------------- + sumave = 0 + sumrms = 0 + sumcos = 0 + + y =ypos1 + while( y<=ypos2 ) + 'set y 'y + 'd 'name + value = subwrd(result,4) + if( value != undef ) + 'd 'name'*cos(lat*'pi'/180)' + value = subwrd(result,4) + sumave = sumave + value + 'd pow('name',2)*cos(lat*'pi'/180)' + value = subwrd(result,4) + sumrms = sumrms + value + 'd cos(lat*'pi'/180)' + value = subwrd(result,4) + sumcos = sumcos + value + endif + y = y + 1 + endwhile + + if( sumcos != 0 ) + 'd 'sumave'/'sumcos + ratave = subwrd(result,4) + 'define avg = avg + 'ratave + 'd 'sumrms'/'sumcos + ratrms = subwrd(result,4) + 'define rms = rms + 'ratrms + n = n + 1 + endif + z = z + 1 endwhile 'define avg = avg / 'n 'define rms = rms / 'n - 'set z 'zmin' 'zmax - 'define varz = ('name')*('name') - avg*avg' + +* Prints for Old vs New Methods +* ----------------------------- +* 'd avg' +* avg = subwrd(result,4) +* 'd avg2' +* avg2 = subwrd(result,4) +* 'd rms' +* rms = subwrd(result,4) +* 'd rms2' +* rms2 = subwrd(result,4) +* say 'AVG1 = 'avg ' RMS1 = 'rms +* say 'AVG2 = 'avg2' RMS2 = 'rms2 +* ----------------------------- + + 'set z 'zmin' 'zmax + 'set lat 'lat1' 'lat2 + 'define varz = ('name')*('name') - avg*avg' n = 0 z = zmin 'set z 'z - 'define var = lat-lat' + 'set lat 'lat1 + 'define var = 0' while( z<=zmax ) 'set z 'z - 'define var = var + ave(varz*cos(lat*'pi'/180),lat='lat1',lat='lat2')' - n = n + 1 + +* Old Method (Fails where UNDEF) +* ------------------------------ +* 'define var = var + ave(varz,lat='lat1',lat='lat2')' +* n = n + 1 + +* New Method (Accounts for UNDEF) +* ------------------------------- + sumvar = 0 + sumcos = 0 + y =ypos1 + while( y<=ypos2 ) + 'set y 'y + 'd varz' + value = subwrd(result,4) + if( value != undef ) + 'd varz*cos(lat*'pi'/180)' + value = subwrd(result,4) + sumvar = sumvar + value + 'd cos(lat*'pi'/180)' + value = subwrd(result,4) + sumcos = sumcos + value + endif + y = y + 1 + endwhile + + if( sumcos != 0 ) + 'd 'sumvar'/'sumcos + ratvar = subwrd(result,4) + 'define var = var + 'ratvar + n = n + 1 + endif z = z + 1 endwhile + 'define var = var / 'n + +* Prints for Old vs New Methods +* ----------------------------- +* 'd var' +* var = subwrd(result,4) +* 'd var2' +* var2 = subwrd(result,4) +* say 'VAR1 = 'var +* say 'VAR2 = 'var2 +* ----------------------------- + endif 'set lon 'lon1 diff --git a/GEOS_Util/plots/grads_util/vpage b/GEOS_Util/plots/grads_util/vpage index e166d1ee..f5031c41 100644 --- a/GEOS_Util/plots/grads_util/vpage +++ b/GEOS_Util/plots/grads_util/vpage @@ -90,3 +90,14 @@ endif 'set vpage 'x1' 'x2' 'y1' 'y2 'set grads off' +xmid = ( x1 + x2 )/2 +xleft = x1 - 0.20*delx +xright = x2 + 0.10*delx +ybot = y1 - 0.12*dely +ytop = y2 + 0.03*dely +ytop = y2 + 0.04*dely +ymid = ( ybot + ytop )/2 + +say 'xmid: 'xmid' ybot: 'ybot' ytop: 'ytop' ymid: 'ymid' xleft: 'xleft' xright: 'xright +return xmid' 'ybot' 'ytop' 'ymid' 'xleft' 'xright + diff --git a/GEOS_Util/plots/grads_util/writegrads.gs b/GEOS_Util/plots/grads_util/writegrads.gs index 16852733..bd2c76d9 100755 --- a/GEOS_Util/plots/grads_util/writegrads.gs +++ b/GEOS_Util/plots/grads_util/writegrads.gs @@ -1,23 +1,103 @@ function writegrads(args) +'numargs 'args + numargs = result + +'q gxout' + gxout = sublin(result,4) + gxout = subwrd(gxout,6) + 'run getenv ZFLIP' zflip = result -************************************* +******************************************* * Note: To Write Data in Reverse Order * run setenv ZFLIP ON -************************************* +* args: list of variables to write +* (Default, all variables) +******************************************* 'setx' 'sety' -'set gxout fwrite' -'set undef 1e15' +'setz' +'getinfo xdim' + xdim = result +'getinfo ydim' + ydim = result +'getinfo zdim' + zdim = result 'getinfo tdim' tdim = result + +'getinfo dlon' + dlon = result +'getinfo dlat' + dlat = result + +if( xdim = 1 ) ; dlon = 1 ; endif + +'set x 1' +'set y 1' +'getinfo lon' + lonbeg = result +'getinfo lat' + latbeg = result + +'setx' +'sety' + +z = 1 +levels = '' +while( z<=zdim ) + 'set z 'z + 'getinfo level' + level = result + levels = levels' 'level +z = z + 1 +endwhile + +'set t 1' +'getinfo date' + begdate = result +'getinfo tinc' + tinc = result +'getinfo tunit' + tunit = result +'getinfo label' + label = result + 'getinfo nvars' nvars = result +if( tunit = 'year' ) ; tunit = yr ; endif +if( tunit = 'month' ) ; tunit = mo ; endif +if( tunit = 'day' ) ; tunit = dy ; endif +if( tunit = 'hour' ) ; tunit = hr ; endif + +* Write grads.ctl +* --------------- +'!remove grads.ctl' +'!touch grads.ctl' +'!echo dset ^grads.data >> grads.ctl' +'!echo title 'label' >> grads.ctl' +'!echo undef 1e15 >> grads.ctl' +'!echo xdef 'xdim' linear 'lonbeg' 'dlon' >> grads.ctl' +'!echo ydef 'ydim' linear 'latbeg' 'dlat' >> grads.ctl' +'!echo zdef 'zdim' levels 'levels' >> grads.ctl' +'!echo tdef 'tdim' linear 'begdate' 'tinc''tunit' >> grads.ctl' + +if( numargs = 0 ) + '!echo vars 'nvars' >> grads.ctl' +else + '!echo vars 'numargs' >> grads.ctl' +endif + +'set gxout fwrite' +'set fwrite grads.data' + +'set undef 1e15' + t=1 while(t<=tdim) 'set t 't @@ -25,18 +105,43 @@ while(t<=tdim) n=1 while(n<=nvars) -'run getvarz 'n +'run getvarz 'n' noprint' var = result name = subwrd(result,1) zdim = subwrd(result,2) + found = true + +if( numargs != 0 ) + found = false + k=1 + while( k<=numargs ) + if( subwrd(args,k) = name ) ; found = true ; endif + k=k+1 + endwhile +endif + + if( found = true ) + + 'q file' + loc = 6 + n + varinfo = sublin(result,loc) + '!remove DESC.txt' + '!echo "'varinfo'" > DESC.txt' + 'run getenv "DESC"' + desc = result + '!remove DESC.txt' + say 'Writing: 'desc + if( name = slp ) ; zdim = 0 ; endif if( zdim = 0 ) - say 'Writing Variable: 'name + '!echo "'desc'" >> grads.ctl' +* say 'Writing Variable: 'name 'set z 1' 'd 'name else + '!echo "'desc'" >> grads.ctl' if(zflip != 'ON' ) z=1 @@ -44,7 +149,7 @@ while(n<=nvars) 'set z 'z 'getinfo level' lev = result - say 'Writing Variable: 'name' for Level: 'lev +* say 'Writing Variable: 'name' for Level: 'lev 'd 'name z=z+1 endwhile @@ -54,19 +159,22 @@ while(n<=nvars) 'set z 'z 'getinfo level' lev = result - say 'Writing Variable: 'name' for Level: 'lev +* say 'Writing Variable: 'name' for Level: 'lev 'd 'name z=z-1 endwhile endif endif - say ' ' - +* say ' ' + endif n=n+1 endwhile t=t+1 endwhile +'!echo endvars >> grads.ctl' +'disable fwrite' +'set gxout 'gxout return diff --git a/GEOS_Util/plots/grads_util/zdiff.template b/GEOS_Util/plots/grads_util/zdiff.template index c9d49a66..6ea0e20d 100644 --- a/GEOS_Util/plots/grads_util/zdiff.template +++ b/GEOS_Util/plots/grads_util/zdiff.template @@ -1,10 +1,10 @@ dset ^GRADSDATA undef UNDEF -title template for 1-deg data +title template for 0.25-deg data xdef 1440 linear 0.000 0.25 ydef 721 linear -90.000 0.25 zdef ZDIM2 levels LEVS -tdef 1 linear 00z01JAN2005 1mo +tdef TDIM linear BEGDATE TINC vars 1 q ZDIM2 0 Arbitray 1-degree data endvars diff --git a/GEOS_Util/plots/hcmp/SHADES_CCOLS.txt b/GEOS_Util/plots/hcmp/SHADES_CCOLS.txt new file mode 100644 index 00000000..481fd09e --- /dev/null +++ b/GEOS_Util/plots/hcmp/SHADES_CCOLS.txt @@ -0,0 +1 @@ +59 57 55 47 44 37 36 34 33 0 21 22 23 24 25 26 27 28 29 diff --git a/GEOS_Util/plots/hcmp/SHADES_CINT.txt b/GEOS_Util/plots/hcmp/SHADES_CINT.txt new file mode 100644 index 00000000..49d59571 --- /dev/null +++ b/GEOS_Util/plots/hcmp/SHADES_CINT.txt @@ -0,0 +1 @@ +0.1 diff --git a/GEOS_Util/plots/hcmp/SHADES_CLEVS.txt b/GEOS_Util/plots/hcmp/SHADES_CLEVS.txt new file mode 100644 index 00000000..6c47c659 --- /dev/null +++ b/GEOS_Util/plots/hcmp/SHADES_CLEVS.txt @@ -0,0 +1 @@ +-0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 diff --git a/GEOS_Util/plots/hcmp/hcmp2 b/GEOS_Util/plots/hcmp/hcmp2 index 68949cef..5f083376 100644 --- a/GEOS_Util/plots/hcmp/hcmp2 +++ b/GEOS_Util/plots/hcmp/hcmp2 @@ -426,9 +426,9 @@ endif if( cname.numexp != 'NULL' ) 'set dfile 'cfile.numexp - 'getinfo cxdim' + 'getinfo xdim' cxdim = result - 'getinfo cydim' + 'getinfo ydim' cydim = result 'set lev 'level 'getinfo level' diff --git a/GEOS_Util/plots/hcmp/hplt b/GEOS_Util/plots/hcmp/hplt index f49a5860..6f38ae8e 100644 --- a/GEOS_Util/plots/hcmp/hplt +++ b/GEOS_Util/plots/hcmp/hplt @@ -124,6 +124,10 @@ if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'GC'_CVALS' ; endif if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'GC'_DCOLS' ; endif dcols = result + 'getresource 'PLOTRC' 'mname'_'GC'_'level'_DPCT' +if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'GC'_DPCT' ; endif + dpct = result + 'getresource 'PLOTRC' 'mname'_'GC'_'level'_'DIFFTYPE'LEVS' if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'GC'_'DIFFTYPE'LEVS' ; endif dlevs = result @@ -136,12 +140,8 @@ if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'GC'_CLAB' ; endif if( result = 'NULL' ) ; 'getresource 'PLOTRC' 'mname'_'GC'_CBSCALE' ; endif cbscale = result -if( cbscale = 'NULL' ) ; cbscale = 0.8 ; endif -if( clab = 'NULL' ) ; clab = on ; endif - -say 'After GETRESOURCE, CLEVS = 'cvals -say 'After GETRESOURCE, CINT = 'cint -say 'After GETRESOURCE, FACT = 'fact +if( cbscale = 'NULL' ) ; cbscale = 0.8 ; endif +if( clab = 'NULL' ) ; clab = on ; endif * Set Default Plotting Variables ******************************** @@ -169,6 +169,8 @@ i = i+1 endwhile fact = dum +default_pct = 0.1 + * Sea-Level Pressure * ------------------ if( mname = 'SLP' ) @@ -177,6 +179,7 @@ if( mname = 'SLP' ) std_cint = 2 std_cvals = '4 8' std_dlevs = "-3 -2.6 -2.3 -2 -1.6 -1.3 -1 -.6 -.3 .3 .6 1 1.3 1.6 2 2.3 2.6 3" + default_pct = 0.01 endif * Temperature @@ -186,6 +189,7 @@ if( mname = 'T' ) std_cint = 0.5 std_cvals = '1 2' std_dlevs = "-2.25 -2 -1.75 -1.5 -1.25 -1 -.75 -.5 -.25 .25 .5 .75 1 1.25 1.5 1.75 2 2.25" + default_pct = 0.05 endif * OMEGA @@ -194,6 +198,7 @@ if( mname = 'OMEGA' ) std_cint = 0.5 std_cvals = '1 2' std_dlevs = "-2.25 -2 -1.75 -1.5 -1.25 -1 -.75 -.5 -.25 .25 .5 .75 1 1.25 1.5 1.75 2 2.25" + default_pct = 0.5 endif * Winds @@ -203,6 +208,7 @@ if( mname = 'U' ) std_cint = 1.0 std_cvals = '2 5' std_dlevs = "-2.25 -2 -1.75 -1.5 -1.25 -1 -.75 -.5 -.25 .25 .5 .75 1 1.25 1.5 1.75 2 2.25" + default_pct = 0.5 endif if( mname = 'V' ) @@ -210,6 +216,7 @@ if( mname = 'V' ) std_cint = 1.0 std_cvals = '2 5' std_dlevs = "-2.25 -2 -1.75 -1.5 -1.25 -1 -.75 -.5 -.25 .25 .5 .75 1 1.25 1.5 1.75 2 2.25" + default_pct = 0.5 endif @@ -222,6 +229,7 @@ if( mname = 'Q' ) std_cint = 0.2 std_cvals = '.4 1' std_dlevs = "-.9 -.8 -.7 -.6 -.5 -.4 -.3 -.2 -.1 .1 .2 .3 .4 .5 .6 .7 .8 .9" + default_pct = 0.1 if( level = 100 ) std_cint = 0.1 @@ -257,6 +265,7 @@ if( mname = 'RH2' ) std_cint = 4.0 std_cvals = '8 12' std_dlevs = "-9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9" + default_pct = 0.1 if( level = 30 ) dlevs = "-18 -16 -14 -12 -10 -8 -6 -4 -2 2 4 6 8 10 12 14 16 18" @@ -315,10 +324,12 @@ if( mname = 'ZLE' ) endif if( level >= 300 ) + default_pct = 0.5 std_cint = 10.0 std_cvals = '30 60' std_dlevs = "-27 -24 -21 -18 -15 -12 -9 -6 -3 3 6 9 12 15 18 21 24 27" else + default_pct = 0.5 std_cint = 0.02 std_cvals = '0.04 0.1' std_dlevs = "-.09 -.08 -.07 -.06 -.05 -.04 -.03 -.02 -.01 .01 .02 .03 .04 .05 .06 .07 .08 .09" @@ -348,6 +359,7 @@ if( mname = 'HE' ) title = 'Eddy Height (m)' cvals = "0" + default_pct = 0.5 std_cint = 10.0 std_cvals = '30 60' std_dlevs = "-27 -24 -21 -18 -15 -12 -9 -6 -3 3 6 9 12 15 18 21 24 27" @@ -429,6 +441,15 @@ if( mname = 'HE' ) endif endif +if( dpct = 'NULL' ) ; dpct = default_pct ; endif + 'd 'dpct + dpct = subwrd(result,4) + +say 'After GETRESOURCE, CLEVS = 'cvals +say 'After GETRESOURCE, CINT = 'cint +say 'After GETRESOURCE, FACT = 'fact +say 'After GETRESOURCE, DPCT = 'dpct + dcols = "55 49 47 45 44 36 34 33 32 0 21 22 23 24 25 26 27 28 69" std_dcols = "55 49 47 45 44 36 34 33 32 0 21 22 23 24 25 26 27 28 69" @@ -499,6 +520,7 @@ say 'Analysis DLON: 'dlon say 'define masko = regrid2( maskm,'dlon','dlat',bs_p1,'lonbeg','latbeg' )' 'define masko = regrid2( maskm,'dlon','dlat',bs_p1,'lonbeg','latbeg' )' 'define qobso = regrid2( qobs ,'dlon','dlat',bs_p1,'lonbeg','latbeg' )' + 'define qobso = maskout(qobso,masko)' 'set dfile 'mfile 'set lon 'lonbeg' 'lonend @@ -516,7 +538,20 @@ if( std_dev = 'true' ) cint = std_cint endif + 'set gxout stat' + 'd qmod' + qmodminmax = sublin(result,8) + qmodmin = subwrd(qmodminmax,4) + qmodmax = subwrd(qmodminmax,5) + say 'QMOD_Max Value: 'qmodmax + say 'QMOD_Min Value: 'qmodmin 'set gxout shaded' + 'd abs('qmodmin')' + aqmodmin = subwrd(result,4) + 'd abs('qmodmax')' + aqmodmax = subwrd(result,4) + if( aqmodmin > aqmodmax ) ; aqmodmax = aqmodmin ; endif + say 'Absolute QMOD_MAX: ' aqmodmax if( mname = "QLTOT" | mname = "QITOT" ) 'shades qmod 0 -cint 'cint' -minval 0' @@ -541,15 +576,28 @@ endif 'set parea 1.5 7.0 4.30 7.10' 'set grads off' + 'set gxout stat' + 'd qobso' + qobsminmax = sublin(result,8) + qobsmin = subwrd(qobsminmax,4) + qobsmax = subwrd(qobsminmax,5) + say 'QOBS_Max Value: 'qobsmax + say 'QOBS_Min Value: 'qobsmin 'set gxout shaded' + 'd abs('qobsmin')' + aqobsmin = subwrd(result,4) + 'd abs('qobsmax')' + aqobsmax = subwrd(result,4) + if( aqobsmin > aqobsmax ) ; aqobsmax = aqobsmin ; endif + say 'Absolute QOBS_MAX: ' aqobsmax if( mname = "QLTOT" | mname = "QITOT" ) 'shades qmod 0 -cint 'cint' -minval 0' - 'd maskout(qobso,masko)' + 'd qobso' else 'set clevs 'cvals 'set ccols 'ccols - 'd maskout(qobso,masko)' + 'd qobso' endif if( mname != "OMEGA" & mname != "RH2" & mname != "O3" & mname != "QLTOT" & mname != "QITOT" ) @@ -557,7 +605,7 @@ if( mname != "OMEGA" & mname != "RH2" & mname != "O3" & mname != "QLTOT" & mname 'set ccolor 1' 'set cint 'cint if( blak = 1 ) ; 'black' ;endif - 'd maskout(qobso,masko)' + 'd qobso' else 'cbarn -vert -snum 0.8 -ymid 6.4 -scaley 0.9 ' endif @@ -573,13 +621,29 @@ endif 'set t 1' 'q dims' say 'DIMS before Final Regridding: 'result + 'define obsg = regrid2( qobs,1,1,bs_p1,'lon',-90)' 'define modg = regrid2( qmod,1,1,bs_p1,'lon',-90)' 'define mask = regrid2( maskm,1,1,bs_p1,'lon',-90)' 'define obsg = maskout( obsg,mask )' 'set gxout shaded' -'define delg = (modg-obsg)' + + 'define delg = modg-obsg' + 'set gxout stat' + 'd delg' + qdifminmax = sublin(result,8) + qdifmin = subwrd(qdifminmax,4) + qdifmax = subwrd(qdifminmax,5) + say 'QDIF_Max Value: 'qdifmax + say 'QDIF_Min Value: 'qdifmin + 'set gxout shaded' + 'd abs('qdifmin')' + aqdifmin = subwrd(result,4) + 'd abs('qdifmax')' + aqdifmax = subwrd(result,4) + if( aqdifmin > aqdifmax ) ; aqdifmax = aqdifmin ; endif + say 'Absolute QDIF_MAX: ' aqdifmax 'run getenv "CINTDIFF"' CINTDIFF = result @@ -592,9 +656,30 @@ else 'stats delg' avgdif = subwrd(result,1) stddif = subwrd(result,2) - qmax = stddif/3 - if( qmax > 0 ) - 'd log10('qmax')' + +say 'avgdif = 'avgdif +say 'stddif = 'stddif + dqmax = stddif/3 + + dqrel = dqmax / aqmodmax * 100 + +say 'dqrel = 'dqrel + 'getint 'dqrel*100 + dqrel = result/100 +say 'dqrel = 'dqrel + + say 'Absolute DQMAX: 'dqmax' QMOD_MAX: 'aqmodmax + say 'Relative Percent Difference: 'dqrel' (100*DQMAX/QMOD_MAX)' + say ' Default Percent Difference for Plots: 'dpct + + if( dqrel < dpct ) + dqrel = dpct + endif + dqmax = dqrel * aqmodmax / 100 + say 'Setting Diff CINT using Relative Percent Difference: 'dqrel'%' + + if( dqmax > 0 ) + 'd log10('dqmax')' n = subwrd(result,4) else n = 0 @@ -610,7 +695,7 @@ else n = n+2 endif endif - 'd 'qmax'/1e'n + 'd 'dqmax'/1e'n cint = subwrd(result,4) 'shades 'cint 'define delg = delg/1e'n @@ -623,6 +708,15 @@ endif 'd delg' 'cbarn -snum 'cbscale' -xmid 4.25 -ymid 0.4' + 'set gxout stat' + 'd maskout(delg,abs(obsg))' + dqminmax = sublin(result,8) + dqmin = subwrd(dqminmax,4) + dqmax = subwrd(dqminmax,5) + say 'DQMin Value: 'dqmin + say 'DQMax Value: 'dqmax + 'set gxout shaded' + 'stats maskout(modg,abs(obsg))' avgmod = subwrd(result,1) stdmod = subwrd(result,2) @@ -656,15 +750,6 @@ else 'draw string 4.25 3.80 'level'-mb Difference (Top-Middle) (x 'dfact')' endif -'set string 1 l 4' -'set strsiz .08' -'draw string 0.050 9.85 Mean: 'avgmod -'draw string 0.050 9.70 Std: 'stdmod -'draw string 0.050 6.45 Mean: 'avgobs -'draw string 0.050 6.30 Std: 'stdobs -'draw string 0.050 3.05 Mean: 'avgdif -'draw string 0.050 2.90 Std: 'stddif - date = getdate (begdate) bmnthm = subwrd(date,1) byearm = subwrd(date,2) @@ -678,27 +763,37 @@ byearo = subwrd(date,2) emntho = subwrd(date,1) eyearo = subwrd(date,2) -if( ccols = "84 0 85" ) 'set string 1 l 4' 'set strsiz .08' - 'draw string 7.10 10 Beg: 'bmnthm' 'byearm - 'draw string 7.10 9.8 End: 'emnthm' 'eyearm - 'draw string 7.10 6.6 Beg: 'bmntho' 'byearo - 'draw string 7.10 6.4 End: 'emntho' 'eyearo -else -'set string 1 r 4' -'set strsiz .08' - 'draw string 1.05 9.5 Beg: 'bmnthm' 'byearm - 'draw string 1.05 9.3 End: 'emnthm' 'eyearm - 'draw string 1.05 6.1 Beg: 'bmntho' 'byearo - 'draw string 1.05 5.9 End: 'emntho' 'eyearo -endif -*if( std_dev != 'true' ) -*'myprint -name 'output'/horiz_'oname'_'name'_'level'.'season -*else -*'myprint -name 'output'/horiz_'oname'_'name'_'level'_STD.'season -*endif +'draw string 0.050 10.25 Beg: 'bmnthm' 'byearm +'draw string 0.050 10.10 End: 'emnthm' 'eyearm +'draw string 0.050 9.85 Max: 'qmodmax +'draw string 0.050 9.70 Min: 'qmodmin +'draw string 0.050 9.40 Mean: 'avgmod +'draw string 0.050 9.25 Std: 'stdmod + +'draw string 0.050 6.85 Beg: 'bmntho' 'byearo +'draw string 0.050 6.70 End: 'emntho' 'eyearo +'draw string 0.050 6.45 Max: 'qobsmax +'draw string 0.050 6.30 Min: 'qobsmin +'draw string 0.050 6.00 Mean: 'avgobs +'draw string 0.050 5.85 Std: 'stdobs + +'draw string 0.050 3.45 Beg: 'bmntho' 'byearo +'draw string 0.050 3.30 End: 'emntho' 'eyearo +'draw string 0.050 3.05 Max: 'qdifmax +'draw string 0.050 2.90 Min: 'qdifmin +'draw string 0.050 2.60 Mean: 'avgdif +'draw string 0.050 2.45 Std: 'stddif + +if( CINTDIFF != 'NULL' ) + 'set strsiz .07' + 'draw string 0.050 1.77 Plot represents' + 'draw string 0.050 1.62 values > 'dqrel' %' + 'draw string 0.050 1.47 Relative Difference' + 'draw string 0.050 1.32 ( DQ/QMax )' +endif 'set clab on' diff --git a/GEOS_Util/plots/hcmp/zz b/GEOS_Util/plots/hcmp/zz new file mode 100644 index 00000000..3924aea3 --- /dev/null +++ b/GEOS_Util/plots/hcmp/zz @@ -0,0 +1,23 @@ +vpage 1 1 2 2 +shades 0.1 +d slp1-slp2 +cbarn +draw title dm5-ctl + +vpage 2 1 2 2 +shades 0.1 +d slp1-slp3 +cbarn +draw title dm5-M2 + +vpage 2 2 2 2 +shades 0.1 +d slp2-slp3 +cbarn +draw title ctl-M2 + +vpage 1 2 2 2 +shades 0.1 +d abs(slp1-slp3) - abs(slp2-slp3) +cbarn +draw title Closeness dm5-M2 vs ctl-M2 diff --git a/GEOS_Util/plots/landscape.script b/GEOS_Util/plots/landscape.script index 643927fb..79d70fcc 100755 --- a/GEOS_Util/plots/landscape.script +++ b/GEOS_Util/plots/landscape.script @@ -398,6 +398,7 @@ end if( $plot == $plotname.$n ) $grads $batch -l -c "run template -EXPID $expid -EXPORT RADLW:RADIATION -LEVELS $levels -SEASON $seasons -OUTPUT $output -ZLOG OFF -DEBUG $debug " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -l -c "run template -EXPID $expid -EXPORT RADSW:RADIATION -LEVELS $levels -SEASON $seasons -OUTPUT $output -ZLOG OFF -DEBUG $debug " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -l -c "run template -EXPID $expid -EXPORT DMDTANA:DYN -SEASON $seasons -OUTPUT $output -DEBUG $debug " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -l -c "run template -EXPID $expid -EXPORT DPSDT_CON:AGCM -SEASON $seasons -OUTPUT $output -DEBUG $debug " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -l -c "run template -EXPID $expid -EXPORT DQVDTANAINT:DYN -SEASON $seasons -OUTPUT $output -DEBUG $debug " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -l -c "run template -EXPID $expid -EXPORT DUDT:AGCM -LEVELS $levels -SEASON $seasons -OUTPUT $output -ZLOG OFF -DEBUG $debug " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -l -c "run template -EXPID $expid -EXPORT DVDT:AGCM -LEVELS $levels -SEASON $seasons -OUTPUT $output -ZLOG OFF -DEBUG $debug " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 @@ -407,6 +408,7 @@ end if( $plot == $plotname.$n ) $grads $batch -l -c "run template -EXPID $expid -EXPORT DVDT_ANA:AGCM -LEVELS $levels -SEASON $seasons -OUTPUT $output -ZLOG OFF -DEBUG $debug " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -l -c "run template -EXPID $expid -EXPORT DTDT_ANA:AGCM -LEVELS $levels -SEASON $seasons -OUTPUT $output -ZLOG OFF -DEBUG $debug " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -l -c "run template -EXPID $expid -EXPORT DQVDT_ANA:AGCM -LEVELS $levels -SEASON $seasons -OUTPUT $output -ZLOG OFF -DEBUG $debug " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -l -c "run template -EXPID $expid -EXPORT DQVDT_CON:AGCM -LEVELS $levels -SEASON $seasons -OUTPUT $output -ZLOG OFF -DEBUG $debug " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -l -c "run template -EXPID $expid -EXPORT DUDT:MOIST UIT:PHYSICS DUDT:GWD -NAME DUDTPHY -LEVELS $levels -SEASON $seasons -OUTPUT $output -ZLOG OFF -DEBUG $debug " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -l -c "run template -EXPID $expid -EXPORT DVDT:MOIST VIT:PHYSICS DVDT:GWD -NAME DVDTPHY -LEVELS $levels -SEASON $seasons -OUTPUT $output -ZLOG OFF -DEBUG $debug " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 diff --git a/GEOS_Util/plots/moveplot b/GEOS_Util/plots/moveplot index 41753f23..17fbaa77 100755 --- a/GEOS_Util/plots/moveplot +++ b/GEOS_Util/plots/moveplot @@ -151,9 +151,11 @@ endif endif set rcfiles = `/bin/ls -1 $homdir | grep .rc` -if( $#rcfiles != 0 ) rsync -avx $homdir/*.rc $webid@${server}:${www}/$expid/RC -if(-e $homdir/RC ) rsync -avx $homdir/RC/ $webid@${server}:${www}/$expid/RC/RC/ -if(-e $homdir/gcm_run.j ) rsync -avx $homdir/gcm_run.j $webid@${server}:${www}/$expid/RC +if( $#rcfiles != 0 ) rsync -avx $homdir/*.rc $webid@${server}:${www}/${expid}/RC +if(-e $homdir/RC ) rsync -avx $homdir/RC/ $webid@${server}:${www}/${expid}/RC/RC/ +if(-e $homdir/gcm_run.j ) rsync -avx $homdir/gcm_run.j $webid@${server}:${www}/${expid}/RC + ssh $webid@${server} "cd ${www}/${expid}/RC ; find . -type d -exec chmod 755 {} \; " + ssh $webid@${server} "cd ${www}/${expid}/RC ; find . -type f -exec chmod 644 {} \; " if( -e $source/src ) then set srcfiles = `/bin/ls -1 $source/src` @@ -165,6 +167,8 @@ if( -e $source/src ) then if( $#TAGNAME != 0 ) then if( -e $source/src/$TAGNAME ) scp $source/src/$TAGNAME $webid@${server}:${www}/$expid/TAG endif + ssh $webid@${server} "cd ${www}/${expid}/SRC ; find . -type d -exec chmod 755 {} \; " + ssh $webid@${server} "cd ${www}/${expid}/SRC ; find . -type f -exec chmod 644 {} \; " endif endif diff --git a/GEOS_Util/plots/movestat b/GEOS_Util/plots/movestat index 14b58183..28da0ffe 100755 --- a/GEOS_Util/plots/movestat +++ b/GEOS_Util/plots/movestat @@ -155,11 +155,12 @@ if( $pltdir == 'NULL' ) set pltdir = `pwd` end echo " " -echo EXPID: $expid -echo SOURCE: $source -echo PLTDIR: $pltdir -echo WEBDIR: $webdir -echo DSCS: $DSCS +echo " EXPID: $expid" +echo " YEAR: $year" +echo "SOURCE: $source" +echo "PLTDIR: $pltdir" +echo "WEBDIR: $webdir" +echo " DSCS: $DSCS" echo " " # Copy Plots to Web Directory @@ -170,8 +171,11 @@ echo " " if( -e $pltdir/corcmp & ( $plots == NULL | $plots == corcmp ) ) then cd $pltdir/corcmp if( $season == 'NULL' ) then - set files = `/bin/ls -1 stats*gif` - set season = `echo $files[1] | cut -d. -f1 | cut -d_ -f6` + set files = `/bin/ls -1 *stats*gif` + set fname = `echo $files[1] | cut -d. -f1` + set fsize = `echo $fname | awk '{print length($0)}'` + @ fsize = $fsize - 2 + set season = `echo $fname | cut -b${fsize}-` endif ssh $webid@${server} mkdir -p ${www}/${webdir}/${season}/corcmp echo Syncing ${season} Files from $pltdir/corcmp to $webid@${server}:${www}/${webdir}/${season}/corcmp @@ -184,8 +188,11 @@ echo " " if( -e $pltdir/$DSC & ( $plots == NULL | $plots == sys ) ) then cd $pltdir/$DSC if( $season == 'NULL' ) then - set files = `/bin/ls -1 stats*gif` - set season = `echo $files[1] | cut -d. -f1 | cut -d_ -f6` + set files = `/bin/ls -1 *stats*gif` + set fname = `echo $files[1] | cut -d. -f1` + set fsize = `echo $fname | awk '{print length($0)}'` + @ fsize = $fsize - 2 + set season = `echo $fname | cut -b${fsize}-` endif ssh $webid@${server} mkdir -p ${www}/${webdir}/${season}/$DSC echo Syncing ${season} Files from $pltdir/$DSC to $webid@${server}:${www}/${webdir}/${season}/$DSC @@ -201,8 +208,11 @@ echo " " if( -e $pltdir/$DSCS[1].$DSC & ( $plots == NULL | $plots == syscmp ) ) then cd $pltdir/$DSCS[1].$DSC if( $season == 'NULL' ) then - set files = `/bin/ls -1 stats*gif` - set season = `echo $files[1] | cut -d. -f1 | cut -d_ -f6` + set files = `/bin/ls -1 *stats*gif` + set fname = `echo $files[1] | cut -d. -f1` + set fsize = `echo $fname | awk '{print length($0)}'` + @ fsize = $fsize - 2 + set season = `echo $fname | cut -b${fsize}-` endif ssh $webid@${server} mkdir -p ${www}/${webdir}/${season}/$DSCS[1].$DSC diff --git a/GEOS_Util/plots/portrait.script b/GEOS_Util/plots/portrait.script index 8862cbc0..41aa8956 100755 --- a/GEOS_Util/plots/portrait.script +++ b/GEOS_Util/plots/portrait.script @@ -411,165 +411,243 @@ endif if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME TSO4 -EXPID $expid -EXPORT TSO4:SOLAR -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME TBC -EXPID $expid -EXPORT TBC:SOLAR -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME TOC -EXPID $expid -EXPORT TOC:SOLAR -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME TOTEXTTAU -EXPID $expid -EXPORT TOTEXTTAU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME TOTSCATAU -EXPID $expid -EXPORT TOTSCATAU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME TOTANGSTR -EXPID $expid -EXPORT TOTANGSTR:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUEM001 -EXPID $expid -EXPORT DUEM001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUEM002 -EXPID $expid -EXPORT DUEM002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUEM003 -EXPID $expid -EXPORT DUEM003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUEM004 -EXPID $expid -EXPORT DUEM004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUEM005 -EXPID $expid -EXPORT DUEM005:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSD001 -EXPID $expid -EXPORT DUSD001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSD002 -EXPID $expid -EXPORT DUSD002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSD003 -EXPID $expid -EXPORT DUSD003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSD004 -EXPID $expid -EXPORT DUSD004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSD005 -EXPID $expid -EXPORT DUSD005:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUPD001 -EXPID $expid -EXPORT DUPD001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUPD002 -EXPID $expid -EXPORT DUPD002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUPD003 -EXPID $expid -EXPORT DUPD003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUPD004 -EXPID $expid -EXPORT DUPD004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUPD005 -EXPID $expid -EXPORT DUPD005:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUWT001 -EXPID $expid -EXPORT DUWT001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUWT002 -EXPID $expid -EXPORT DUWT002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUWT003 -EXPID $expid -EXPORT DUWT003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUWT004 -EXPID $expid -EXPORT DUWT004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUWT005 -EXPID $expid -EXPORT DUWT005:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSV001 -EXPID $expid -EXPORT DUSV001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSV002 -EXPID $expid -EXPORT DUSV002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSV003 -EXPID $expid -EXPORT DUSV003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSV004 -EXPID $expid -EXPORT DUSV004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSV005 -EXPID $expid -EXPORT DUSV005:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUDP001 -EXPID $expid -EXPORT DUDP001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUDP002 -EXPID $expid -EXPORT DUDP002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUDP003 -EXPID $expid -EXPORT DUDP003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUDP004 -EXPID $expid -EXPORT DUDP004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUDP005 -EXPID $expid -EXPORT DUDP005:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSMASS -EXPID $expid -EXPORT DUSMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUCMASS -EXPID $expid -EXPORT DUCMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSMASS25 -EXPID $expid -EXPORT DUSMASS25:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUCMASS25 -EXPID $expid -EXPORT DUCMASS25:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUEXTT25 -EXPID $expid -EXPORT DUEXTT25:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSCAT25 -EXPID $expid -EXPORT DUSCAT25:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUEXTTAU -EXPID $expid -EXPORT DUEXTTAU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSCATAU -EXPID $expid -EXPORT DUSCATAU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUANGSTR -EXPID $expid -EXPORT DUANGSTR:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUEXTTFM -EXPID $expid -EXPORT DUEXTTFM:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUSCATFM -EXPID $expid -EXPORT DUSCATFM:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUFLUXU -EXPID $expid -EXPORT DUFLUXU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DUFLUXV -EXPID $expid -EXPORT DUFLUXV:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSEM001 -EXPID $expid -EXPORT SSEM001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSEM002 -EXPID $expid -EXPORT SSEM002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSEM003 -EXPID $expid -EXPORT SSEM003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSEM004 -EXPID $expid -EXPORT SSEM004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSEM005 -EXPID $expid -EXPORT SSEM005:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSD001 -EXPID $expid -EXPORT SSSD001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSD002 -EXPID $expid -EXPORT SSSD002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSD003 -EXPID $expid -EXPORT SSSD003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSD004 -EXPID $expid -EXPORT SSSD004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSD005 -EXPID $expid -EXPORT SSSD005:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSDP001 -EXPID $expid -EXPORT SSDP001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSDP002 -EXPID $expid -EXPORT SSDP002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSDP003 -EXPID $expid -EXPORT SSDP003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSDP004 -EXPID $expid -EXPORT SSDP004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSDP005 -EXPID $expid -EXPORT SSDP005:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSWT001 -EXPID $expid -EXPORT SSWT001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSWT002 -EXPID $expid -EXPORT SSWT002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSWT003 -EXPID $expid -EXPORT SSWT003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSWT004 -EXPID $expid -EXPORT SSWT004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSWT005 -EXPID $expid -EXPORT SSWT005:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSV001 -EXPID $expid -EXPORT SSSV001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSV002 -EXPID $expid -EXPORT SSSV002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSV003 -EXPID $expid -EXPORT SSSV003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSV004 -EXPID $expid -EXPORT SSSV004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSV005 -EXPID $expid -EXPORT SSSV005:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSMASS -EXPID $expid -EXPORT SSSMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSCMASS -EXPID $expid -EXPORT SSCMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSEXTTAU -EXPID $expid -EXPORT SSEXTTAU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSCATAU -EXPID $expid -EXPORT SSSCATAU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSANGSTR -EXPID $expid -EXPORT SSANGSTR:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSEXTTFM -EXPID $expid -EXPORT SSEXTTFM:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSCATFM -EXPID $expid -EXPORT SSSCATFM:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSMASS25 -EXPID $expid -EXPORT SSSMASS25:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSCMASS25 -EXPID $expid -EXPORT SSCMASS25:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSEXTT25 -EXPID $expid -EXPORT SSEXTT25:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSSCAT25 -EXPID $expid -EXPORT SSSCAT25:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSFLUXU -EXPID $expid -EXPORT SSFLUXU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SSFLUXV -EXPID $expid -EXPORT SSFLUXV:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUEM001 -EXPID $expid -EXPORT SUEM001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUEM002 -EXPID $expid -EXPORT SUEM002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUEM003 -EXPID $expid -EXPORT SUEM003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUEM004 -EXPID $expid -EXPORT SUEM004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUDP001 -EXPID $expid -EXPORT SUDP001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUDP002 -EXPID $expid -EXPORT SUDP002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUDP003 -EXPID $expid -EXPORT SUDP003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUDP004 -EXPID $expid -EXPORT SUDP004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUWT001 -EXPID $expid -EXPORT SUWT001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUWT002 -EXPID $expid -EXPORT SUWT002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUWT003 -EXPID $expid -EXPORT SUWT003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUWT004 -EXPID $expid -EXPORT SUWT004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUSV001 -EXPID $expid -EXPORT SUSV001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUSV002 -EXPID $expid -EXPORT SUSV002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUSV003 -EXPID $expid -EXPORT SUSV003:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUSV004 -EXPID $expid -EXPORT SUSV004:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SO2SMASS -EXPID $expid -EXPORT SO2SMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SO2CMASS -EXPID $expid -EXPORT SO2CMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SO4SMASS -EXPID $expid -EXPORT SO4SMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SO4CMASS -EXPID $expid -EXPORT SO4CMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DMSSMASS -EXPID $expid -EXPORT DMSSMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME DMSCMASS -EXPID $expid -EXPORT DMSCMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUPMSA -EXPID $expid -EXPORT SUPMSA:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUPSO2 -EXPID $expid -EXPORT SUPSO2:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUPSO4G -EXPID $expid -EXPORT SUPSO4G:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUPSO4AQ -EXPID $expid -EXPORT SUPSO4AQ:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUPSO4WT -EXPID $expid -EXPORT SUPSO4WT:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUEXTTAU -EXPID $expid -EXPORT SUEXTTAU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUSCATAU -EXPID $expid -EXPORT SUSCATAU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUANGSTR -EXPID $expid -EXPORT SUANGSTR:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SO4EMAN -EXPID $expid -EXPORT SO4EMAN:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SO2EMAN -EXPID $expid -EXPORT SO2EMAN:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SO2EMBB -EXPID $expid -EXPORT SO2EMBB:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SO2EMVN -EXPID $expid -EXPORT SO2EMVN:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SO2EMVE -EXPID $expid -EXPORT SO2EMVE:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUFLUXU -EXPID $expid -EXPORT SUFLUXU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME SUFLUXV -EXPID $expid -EXPORT SUFLUXV:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCEM001 -EXPID $expid -EXPORT BCEM001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCEM002 -EXPID $expid -EXPORT BCEM002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCDP001 -EXPID $expid -EXPORT BCDP001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCDP002 -EXPID $expid -EXPORT BCDP002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCWT001 -EXPID $expid -EXPORT BCWT001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCWT002 -EXPID $expid -EXPORT BCWT002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCSV001 -EXPID $expid -EXPORT BCSV001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCSV002 -EXPID $expid -EXPORT BCSV002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCSMASS -EXPID $expid -EXPORT BCSMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCCMASS -EXPID $expid -EXPORT BCCMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCEXTTAU -EXPID $expid -EXPORT BCEXTTAU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCSCATAU -EXPID $expid -EXPORT BSCATTAU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCANGSTR -EXPID $expid -EXPORT BCANGSTR:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCHYPHIL -EXPID $expid -EXPORT BCHYPHIL:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCEMBB -EXPID $expid -EXPORT BCEMBB:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCEMBF -EXPID $expid -EXPORT BCEMBF:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCEMAN -EXPID $expid -EXPORT BCEMAN:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCFLUXU -EXPID $expid -EXPORT BCFLUXU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME BCFLUXV -EXPID $expid -EXPORT BCFLUXV:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCEM001 -EXPID $expid -EXPORT OCEM001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCEM002 -EXPID $expid -EXPORT OCEM002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCDP001 -EXPID $expid -EXPORT OCDP001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCDP002 -EXPID $expid -EXPORT OCDP002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCWT001 -EXPID $expid -EXPORT OCWT001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCWT002 -EXPID $expid -EXPORT OCWT002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCSV001 -EXPID $expid -EXPORT OCSV001:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCSV002 -EXPID $expid -EXPORT OCSV002:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCSMASS -EXPID $expid -EXPORT OCSMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCCMASS -EXPID $expid -EXPORT OCCMASS:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCEXTTAU -EXPID $expid -EXPORT OCEXTTAU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCSCATAU -EXPID $expid -EXPORT OSCATTAU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCANGSTR -EXPID $expid -EXPORT OCANGSTR:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCHYPHIL -EXPID $expid -EXPORT OCHYPHIL:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCEMBB -EXPID $expid -EXPORT OCEMBB:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCEMBF -EXPID $expid -EXPORT OCEMBF:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCEMAN -EXPID $expid -EXPORT OCEMAN:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCFLUXU -EXPID $expid -EXPORT OCFLUXU:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 - if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot -DIR aerosol -NAME OCFLUXV -EXPID $expid -EXPORT OCFLUXV:GOCART -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME TOTEXTTAU -EXPID $expid -EXPORT TOTEXTTAU:GOCART -ALT_EXPORT TOTEXTTAU:GOCART2G:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME TOTSCATAU -EXPID $expid -EXPORT TOTSCATAU:GOCART -ALT_EXPORT TOTSCATAU:GOCART2G:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME TOTANGSTR -EXPID $expid -EXPORT TOTANGSTR:GOCART -ALT_EXPORT TOTANGSTR:GOCART2G -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUEM001 -EXPID $expid -EXPORT DUEM001:GOCART -ALT_EXPORT DUEM:DU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUEM002 -EXPID $expid -EXPORT DUEM002:GOCART -ALT_EXPORT DUEM:DU:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUEM003 -EXPID $expid -EXPORT DUEM003:GOCART -ALT_EXPORT DUEM:DU:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUEM004 -EXPID $expid -EXPORT DUEM004:GOCART -ALT_EXPORT DUEM:DU:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUEM005 -EXPID $expid -EXPORT DUEM005:GOCART -ALT_EXPORT DUEM:DU:005 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSD001 -EXPID $expid -EXPORT DUSD001:GOCART -ALT_EXPORT DUSD:DU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSD002 -EXPID $expid -EXPORT DUSD002:GOCART -ALT_EXPORT DUSD:DU:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSD003 -EXPID $expid -EXPORT DUSD003:GOCART -ALT_EXPORT DUSD:DU:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSD004 -EXPID $expid -EXPORT DUSD004:GOCART -ALT_EXPORT DUSD:DU:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSD005 -EXPID $expid -EXPORT DUSD005:GOCART -ALT_EXPORT DUSD:DU:005 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUPD001 -EXPID $expid -EXPORT DUPD001:GOCART -ALT_EXPORT DUDP:DU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUPD002 -EXPID $expid -EXPORT DUPD002:GOCART -ALT_EXPORT DUDP:DU:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUPD003 -EXPID $expid -EXPORT DUPD003:GOCART -ALT_EXPORT DUDP:DU:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUPD004 -EXPID $expid -EXPORT DUPD004:GOCART -ALT_EXPORT DUDP:DU:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUPD005 -EXPID $expid -EXPORT DUPD005:GOCART -ALT_EXPORT DUDP:DU:005 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUWT001 -EXPID $expid -EXPORT DUWT001:GOCART -ALT_EXPORT DUWT:DU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUWT002 -EXPID $expid -EXPORT DUWT002:GOCART -ALT_EXPORT DUWT:DU:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUWT003 -EXPID $expid -EXPORT DUWT003:GOCART -ALT_EXPORT DUWT:DU:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUWT004 -EXPID $expid -EXPORT DUWT004:GOCART -ALT_EXPORT DUWT:DU:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUWT005 -EXPID $expid -EXPORT DUWT005:GOCART -ALT_EXPORT DUWT:DU:005 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSV001 -EXPID $expid -EXPORT DUSV001:GOCART -ALT_EXPORT DUSV:DU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSV002 -EXPID $expid -EXPORT DUSV002:GOCART -ALT_EXPORT DUSV:DU:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSV003 -EXPID $expid -EXPORT DUSV003:GOCART -ALT_EXPORT DUSV:DU:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSV004 -EXPID $expid -EXPORT DUSV004:GOCART -ALT_EXPORT DUSV:DU:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSV005 -EXPID $expid -EXPORT DUSV005:GOCART -ALT_EXPORT DUSV:DU:005 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUDP001 -EXPID $expid -EXPORT DUDP001:GOCART -ALT_EXPORT DUDP:DU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUDP002 -EXPID $expid -EXPORT DUDP002:GOCART -ALT_EXPORT DUDP:DU:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUDP003 -EXPID $expid -EXPORT DUDP003:GOCART -ALT_EXPORT DUDP:DU:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUDP004 -EXPID $expid -EXPORT DUDP004:GOCART -ALT_EXPORT DUDP:DU:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUDP005 -EXPID $expid -EXPORT DUDP005:GOCART -ALT_EXPORT DUDP:DU:005 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSMASS -EXPID $expid -EXPORT DUSMASS:GOCART -ALT_EXPORT DUSMASS:DU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUCMASS -EXPID $expid -EXPORT DUCMASS:GOCART -ALT_EXPORT DUCMASS:DU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSMASS25 -EXPID $expid -EXPORT DUSMASS25:GOCART -ALT_EXPORT DUSMASS25:DU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUCMASS25 -EXPID $expid -EXPORT DUCMASS25:GOCART -ALT_EXPORT DUCMASS25:DU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUEXTT25 -EXPID $expid -EXPORT DUEXTT25:GOCART -ALT_EXPORT DUEXTT25:DU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSCAT25 -EXPID $expid -EXPORT DUSCAT25:GOCART -ALT_EXPORT DUSCAT25:DU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUAERIDX -EXPID $expid -EXPORT DUAERIDX:GOCART -ALT_EXPORT DUAERIDX:DU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUEXTTAU -EXPID $expid -EXPORT DUEXTTAU:GOCART -ALT_EXPORT DUEXTTAU:DU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSCATAU -EXPID $expid -EXPORT DUSCATAU:GOCART -ALT_EXPORT DUSCATAU:DU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUANGSTR -EXPID $expid -EXPORT DUANGSTR:GOCART -ALT_EXPORT DUANGSTR:DU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUEXTTFM -EXPID $expid -EXPORT DUEXTTFM:GOCART -ALT_EXPORT DUEXTTFM:DU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUSCATFM -EXPID $expid -EXPORT DUSCATFM:GOCART -ALT_EXPORT DUSCATFM:DU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUFLUXU -EXPID $expid -EXPORT DUFLUXU:GOCART -ALT_EXPORT DUFLUXU:DU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DUFLUXV -EXPID $expid -EXPORT DUFLUXV:GOCART -ALT_EXPORT DUFLUXV:DU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSEM001 -EXPID $expid -EXPORT SSEM001:GOCART -ALT_EXPORT SSEM:SS:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSEM002 -EXPID $expid -EXPORT SSEM002:GOCART -ALT_EXPORT SSEM:SS:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSEM003 -EXPID $expid -EXPORT SSEM003:GOCART -ALT_EXPORT SSEM:SS:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSEM004 -EXPID $expid -EXPORT SSEM004:GOCART -ALT_EXPORT SSEM:SS:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSEM005 -EXPID $expid -EXPORT SSEM005:GOCART -ALT_EXPORT SSEM:SS:005 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSD001 -EXPID $expid -EXPORT SSSD001:GOCART -ALT_EXPORT SSSD:SS:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSD002 -EXPID $expid -EXPORT SSSD002:GOCART -ALT_EXPORT SSSD:SS:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSD003 -EXPID $expid -EXPORT SSSD003:GOCART -ALT_EXPORT SSSD:SS:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSD004 -EXPID $expid -EXPORT SSSD004:GOCART -ALT_EXPORT SSSD:SS:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSD005 -EXPID $expid -EXPORT SSSD005:GOCART -ALT_EXPORT SSSD:SS:005 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSPD001 -EXPID $expid -EXPORT SSPD001:GOCART -ALT_EXPORT SSDP:SS:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSPD002 -EXPID $expid -EXPORT SSPD002:GOCART -ALT_EXPORT SSDP:SS:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSPD003 -EXPID $expid -EXPORT SSPD003:GOCART -ALT_EXPORT SSDP:SS:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSPD004 -EXPID $expid -EXPORT SSPD004:GOCART -ALT_EXPORT SSDP:SS:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSPD005 -EXPID $expid -EXPORT SSPD005:GOCART -ALT_EXPORT SSDP:SS:005 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSWT001 -EXPID $expid -EXPORT SSWT001:GOCART -ALT_EXPORT SSWT:SS:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSWT002 -EXPID $expid -EXPORT SSWT002:GOCART -ALT_EXPORT SSWT:SS:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSWT003 -EXPID $expid -EXPORT SSWT003:GOCART -ALT_EXPORT SSWT:SS:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSWT004 -EXPID $expid -EXPORT SSWT004:GOCART -ALT_EXPORT SSWT:SS:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSWT005 -EXPID $expid -EXPORT SSWT005:GOCART -ALT_EXPORT SSWT:SS:005 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSV001 -EXPID $expid -EXPORT SSSV001:GOCART -ALT_EXPORT SSSV:SS:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSV002 -EXPID $expid -EXPORT SSSV002:GOCART -ALT_EXPORT SSSV:SS:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSV003 -EXPID $expid -EXPORT SSSV003:GOCART -ALT_EXPORT SSSV:SS:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSV004 -EXPID $expid -EXPORT SSSV004:GOCART -ALT_EXPORT SSSV:SS:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSV005 -EXPID $expid -EXPORT SSSV005:GOCART -ALT_EXPORT SSSV:SS:005 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSDP001 -EXPID $expid -EXPORT SSDP001:GOCART -ALT_EXPORT SSDP:SS:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSDP002 -EXPID $expid -EXPORT SSDP002:GOCART -ALT_EXPORT SSDP:SS:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSDP003 -EXPID $expid -EXPORT SSDP003:GOCART -ALT_EXPORT SSDP:SS:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSDP004 -EXPID $expid -EXPORT SSDP004:GOCART -ALT_EXPORT SSDP:SS:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSDP005 -EXPID $expid -EXPORT SSDP005:GOCART -ALT_EXPORT SSDP:SS:005 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSMASS -EXPID $expid -EXPORT SSSMASS:GOCART -ALT_EXPORT SSSMASS:SS -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSCMASS -EXPID $expid -EXPORT SSCMASS:GOCART -ALT_EXPORT SSCMASS:SS -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSMASS25 -EXPID $expid -EXPORT SSSMASS25:GOCART -ALT_EXPORT SSSMASS25:SS -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSCMASS25 -EXPID $expid -EXPORT SSCMASS25:GOCART -ALT_EXPORT SSCMASS25:SS -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSEXTT25 -EXPID $expid -EXPORT SSEXTT25:GOCART -ALT_EXPORT SSEXTT25:SS:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSCAT25 -EXPID $expid -EXPORT SSSCAT25:GOCART -ALT_EXPORT SSSCAT25:SS:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSAERIDX -EXPID $expid -EXPORT SSAERIDX:GOCART -ALT_EXPORT SSAERIDX:SS -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSEXTTAU -EXPID $expid -EXPORT SSEXTTAU:GOCART -ALT_EXPORT SSEXTTAU:SS:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSCATAU -EXPID $expid -EXPORT SSSCATAU:GOCART -ALT_EXPORT SSSCATAU:SS:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSANGSTR -EXPID $expid -EXPORT SSANGSTR:GOCART -ALT_EXPORT SSANGSTR:SS -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSEXTTFM -EXPID $expid -EXPORT SSEXTTFM:GOCART -ALT_EXPORT SSEXTTFM:SS:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSSCATFM -EXPID $expid -EXPORT SSSCATFM:GOCART -ALT_EXPORT SSSCATFM:SS:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSFLUXU -EXPID $expid -EXPORT SSFLUXU:GOCART -ALT_EXPORT SSFLUXU:SS -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SSFLUXV -EXPID $expid -EXPORT SSFLUXV:GOCART -ALT_EXPORT SSFLUXV:SS -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUEM001 -EXPID $expid -EXPORT SUEM001:GOCART -ALT_EXPORT SUEM:SU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUEM002 -EXPID $expid -EXPORT SUEM002:GOCART -ALT_EXPORT SUEM:SU:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUEM003 -EXPID $expid -EXPORT SUEM003:GOCART -ALT_EXPORT SUEM:SU:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUEM004 -EXPID $expid -EXPORT SUEM004:GOCART -ALT_EXPORT SUEM:SU:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUDP001 -EXPID $expid -EXPORT SUDP001:GOCART -ALT_EXPORT SUDP:SU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUDP002 -EXPID $expid -EXPORT SUDP002:GOCART -ALT_EXPORT SUDP:SU:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUDP003 -EXPID $expid -EXPORT SUDP003:GOCART -ALT_EXPORT SUDP:SU:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUDP004 -EXPID $expid -EXPORT SUDP004:GOCART -ALT_EXPORT SUDP:SU:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUWT001 -EXPID $expid -EXPORT SUWT001:GOCART -ALT_EXPORT SUWT:SU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUWT002 -EXPID $expid -EXPORT SUWT002:GOCART -ALT_EXPORT SUWT:SU:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUWT003 -EXPID $expid -EXPORT SUWT003:GOCART -ALT_EXPORT SUWT:SU:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUWT004 -EXPID $expid -EXPORT SUWT004:GOCART -ALT_EXPORT SUWT:SU:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUSV001 -EXPID $expid -EXPORT SUSV001:GOCART -ALT_EXPORT SUSV:SU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUSV002 -EXPID $expid -EXPORT SUSV002:GOCART -ALT_EXPORT SUSV:SU:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUSV003 -EXPID $expid -EXPORT SUSV003:GOCART -ALT_EXPORT SUSV:SU:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUSV004 -EXPID $expid -EXPORT SUSV004:GOCART -ALT_EXPORT SUSV:SU:004 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SO2SMASS -EXPID $expid -EXPORT SO2SMASS:GOCART -ALT_EXPORT SO2SMASS:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SO2CMASS -EXPID $expid -EXPORT SO2CMASS:GOCART -ALT_EXPORT SO2CMASS:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SO4SMASS -EXPID $expid -EXPORT SO4SMASS:GOCART -ALT_EXPORT SO4SMASS:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SO4CMASS -EXPID $expid -EXPORT SO4CMASS:GOCART -ALT_EXPORT SO4CMASS:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DMSSMASS -EXPID $expid -EXPORT DMSSMASS:GOCART -ALT_EXPORT DMSSMASS:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME DMSCMASS -EXPID $expid -EXPORT DMSCMASS:GOCART -ALT_EXPORT DMSCMASS:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUPMSA -EXPID $expid -EXPORT SUPMSA:GOCART -ALT_EXPORT SUPMSA:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUPSO2 -EXPID $expid -EXPORT SUPSO2:GOCART -ALT_EXPORT SUPSO2:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUPSO2 -EXPID $expid -EXPORT SUPSO2:GOCART -ALT_EXPORT SUPSO2:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUPSO4G -EXPID $expid -EXPORT SUPSO4G:GOCART -ALT_EXPORT SUPSO4G:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUPSO4AQ -EXPID $expid -EXPORT SUPSO4AQ:GOCART -ALT_EXPORT SUPSO4AQ:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUPSO4WT -EXPID $expid -EXPORT SUPSO4WT:GOCART -ALT_EXPORT SUPSO4WT:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUEXTTAU -EXPID $expid -EXPORT SUEXTTAU:GOCART -ALT_EXPORT SUEXTTAU:SU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUSCATAU -EXPID $expid -EXPORT SUSCATAU:GOCART -ALT_EXPORT SUSCATAU:SU:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUANGSTR -EXPID $expid -EXPORT SUANGSTR:GOCART -ALT_EXPORT SUANGSTR:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SO4EMAN -EXPID $expid -EXPORT SO4EMAN:GOCART -ALT_EXPORT SO4EMAN:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SO2EMAN -EXPID $expid -EXPORT SO2EMAN:GOCART -ALT_EXPORT SO2EMAN:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SO2EMBB -EXPID $expid -EXPORT SO2EMBB:GOCART -ALT_EXPORT SO2EMBB:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SO2EMVN -EXPID $expid -EXPORT SO2EMVN:GOCART -ALT_EXPORT SO2EMVN:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SO2EMVE -EXPID $expid -EXPORT SO2EMVE:GOCART -ALT_EXPORT SO2EMVE:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUFLUXU -EXPID $expid -EXPORT SUFLUXU:GOCART -ALT_EXPORT SUFLUXU:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME SUFLUXV -EXPID $expid -EXPORT SUFLUXV:GOCART -ALT_EXPORT SUFLUXV:SU -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME HNO3SMASS -EXPID $expid -EXPORT HNO3SMASS:GOCART -ALT_EXPORT HNO3SMASS:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NH3SMASS -EXPID $expid -EXPORT NH3SMASS:GOCART -ALT_EXPORT NH3SMASS:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NH4SMASS -EXPID $expid -EXPORT NH4SMASS:GOCART -ALT_EXPORT NH4SMASS:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NISMASS -EXPID $expid -EXPORT NISMASS:GOCART -ALT_EXPORT NISMASS:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NISMASS25 -EXPID $expid -EXPORT NISMASS25:GOCART -ALT_EXPORT NISMASS25:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME HNO3CMASS -EXPID $expid -EXPORT HNO3CMASS:GOCART -ALT_EXPORT HNO3CMASS:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NH3CMASS -EXPID $expid -EXPORT NH3CMASS:GOCART -ALT_EXPORT NH3CMASS:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NH4CMASS -EXPID $expid -EXPORT NH4CMASS:GOCART -ALT_EXPORT NH4CMASS:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NICMASS -EXPID $expid -EXPORT NICMASS:GOCART -ALT_EXPORT NICMASS:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NICMASS25 -EXPID $expid -EXPORT NICMASS25:GOCART -ALT_EXPORT NICMASS25:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIEXTTFM -EXPID $expid -EXPORT NIEXTTFM:GOCART -ALT_EXPORT NIEXTTFM:NI:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NISCATFM -EXPID $expid -EXPORT NISCATFM:GOCART -ALT_EXPORT NISCATFM:NI:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NISCATAU -EXPID $expid -EXPORT NISCATFM:GOCART -ALT_EXPORT NISCATAU:NI:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIEXTTAU -EXPID $expid -EXPORT NIEXTTAU:GOCART -ALT_EXPORT NIEXTTAU:NI:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIANGSTR -EXPID $expid -EXPORT NIANGSTR:GOCART -ALT_EXPORT NIANGSTR:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIPHNOAQ -EXPID $expid -EXPORT NIPHNOAQ:GOCART -ALT_EXPORT NIPHNOAQ:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIPNH4AQ -EXPID $expid -EXPORT NIPNH4AQ:GOCART -ALT_EXPORT NIPNH4AQ:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIPNH3AQ -EXPID $expid -EXPORT NIPNH3AQ:GOCART -ALT_EXPORT NIPNH3AQ:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIHT001 -EXPID $expid -EXPORT NIHT001:GOCART -ALT_EXPORT NIHT:NI:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIHT002 -EXPID $expid -EXPORT NIHT002:GOCART -ALT_EXPORT NIHT:NI:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIHT003 -EXPID $expid -EXPORT NIHT003:GOCART -ALT_EXPORT NIHT:NI:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NISD001 -EXPID $expid -EXPORT NISD001:GOCART -ALT_EXPORT NISD:NI:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NISD002 -EXPID $expid -EXPORT NISD002:GOCART -ALT_EXPORT NISD:NI:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NISD003 -EXPID $expid -EXPORT NISD003:GOCART -ALT_EXPORT NISD:NI:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIDP001 -EXPID $expid -EXPORT NIDP001:GOCART -ALT_EXPORT NIDP:NI:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIDP002 -EXPID $expid -EXPORT NIDP002:GOCART -ALT_EXPORT NIDP:NI:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIDP003 -EXPID $expid -EXPORT NIDP003:GOCART -ALT_EXPORT NIDP:NI:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIWT001 -EXPID $expid -EXPORT NIWT001:GOCART -ALT_EXPORT NIWT:NI:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIWT002 -EXPID $expid -EXPORT NIWT002:GOCART -ALT_EXPORT NIWT:NI:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIWT003 -EXPID $expid -EXPORT NIWT003:GOCART -ALT_EXPORT NIWT:NI:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NISV001 -EXPID $expid -EXPORT NISV001:GOCART -ALT_EXPORT NISV:NI:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NISV002 -EXPID $expid -EXPORT NISV002:GOCART -ALT_EXPORT NISV:NI:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NISV003 -EXPID $expid -EXPORT NISV003:GOCART -ALT_EXPORT NISV:NI:003 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NH3EM -EXPID $expid -EXPORT NH3EM:GOCART -ALT_EXPORT NH3EM:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NH3DP -EXPID $expid -EXPORT NH3DP:GOCART -ALT_EXPORT NH3DP:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NH3WT -EXPID $expid -EXPORT NH3WT:GOCART -ALT_EXPORT NH3WT:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NH3SV -EXPID $expid -EXPORT NH3SV:GOCART -ALT_EXPORT NH3SV:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NH4SD -EXPID $expid -EXPORT NH4SD:GOCART -ALT_EXPORT NH4SD:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NH4DP -EXPID $expid -EXPORT NH4DP:GOCART -ALT_EXPORT NH4DP:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NH4WT -EXPID $expid -EXPORT NH4WT:GOCART -ALT_EXPORT NH4WT:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NH4SV -EXPID $expid -EXPORT NH4SV:GOCART -ALT_EXPORT NH4SV:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIFLUXU -EXPID $expid -EXPORT NIFLUXU:GOCART -ALT_EXPORT NIFLUXU:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME NIFLUXV -EXPID $expid -EXPORT NIFLUXV:GOCART -ALT_EXPORT NIFLUXV:NI -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCEM001 -EXPID $expid -EXPORT BCEM001:GOCART -ALT_EXPORT CAEMCA.bc:CA.bc:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCEM002 -EXPID $expid -EXPORT BCEM002:GOCART -ALT_EXPORT CAEMCA.bc:CA.bc:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCDP001 -EXPID $expid -EXPORT BCDP001:GOCART -ALT_EXPORT CADPCA.bc:CA.bc:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCDP002 -EXPID $expid -EXPORT BCDP002:GOCART -ALT_EXPORT CADPCA.bc:CA.bc:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCWT001 -EXPID $expid -EXPORT BCWT001:GOCART -ALT_EXPORT CAWTCA.bc:CA.bc:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCWT002 -EXPID $expid -EXPORT BCWT002:GOCART -ALT_EXPORT CAWTCA.bc:CA.bc:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCSV001 -EXPID $expid -EXPORT BCSV001:GOCART -ALT_EXPORT CASVCA.bc:CA.bc:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCSV002 -EXPID $expid -EXPORT BCSV002:GOCART -ALT_EXPORT CASVCA.bc:CA.bc:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCSMASS -EXPID $expid -EXPORT BCSMASS:GOCART -ALT_EXPORT CASMASSCA.bc:CA.bc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCCMASS -EXPID $expid -EXPORT BCCMASS:GOCART -ALT_EXPORT CACMASSCA.bc:CA.bc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCEXTTAU -EXPID $expid -EXPORT BCEXTTAU:GOCART -ALT_EXPORT CAEXTTAUCA.bc:CA.bc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCSCATAU -EXPID $expid -EXPORT BCSCATAU:GOCART -ALT_EXPORT CASCATAUCA.bc:CA.bc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCANGSTR -EXPID $expid -EXPORT BCANGSTR:GOCART -ALT_EXPORT CAANGSTRCA.bc:CA.bc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCHYPHIL -EXPID $expid -EXPORT BCHYPHIL:GOCART -ALT_EXPORT CAHYPHILCA.bc:CA.bc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCEMBB -EXPID $expid -EXPORT BCEMBB:GOCART -ALT_EXPORT CAEMBBCA.bc:CA.bc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCEMBF -EXPID $expid -EXPORT BCEMBF:GOCART -ALT_EXPORT CAEMBFCA.bc:CA.bc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCEMAN -EXPID $expid -EXPORT BCEMAN:GOCART -ALT_EXPORT CAEMANCA.bc:CA.bc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCFLUXU -EXPID $expid -EXPORT BCFLUXU:GOCART -ALT_EXPORT CAFLUXUCA.bc:CA.bc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BCFLUXV -EXPID $expid -EXPORT BCFLUXV:GOCART -ALT_EXPORT CAFLUXVCA.bc:CA.bc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCEM001 -EXPID $expid -EXPORT OCEM001:GOCART -ALT_EXPORT CAEMCA.oc:CA.oc:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCEM002 -EXPID $expid -EXPORT OCEM002:GOCART -ALT_EXPORT CAEMCA.oc:CA.oc:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCDP001 -EXPID $expid -EXPORT OCDP001:GOCART -ALT_EXPORT CADPCA.oc:CA.oc:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCDP002 -EXPID $expid -EXPORT OCDP002:GOCART -ALT_EXPORT CADPCA.oc:CA.oc:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCWT001 -EXPID $expid -EXPORT OCWT001:GOCART -ALT_EXPORT CAWTCA.oc:CA.oc:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCWT002 -EXPID $expid -EXPORT OCWT002:GOCART -ALT_EXPORT CAWTCA.oc:CA.oc:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCSV001 -EXPID $expid -EXPORT OCSV001:GOCART -ALT_EXPORT CASVCA.oc:CA.oc:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCSV002 -EXPID $expid -EXPORT OCSV002:GOCART -ALT_EXPORT CASVCA.oc:CA.oc:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCSMASS -EXPID $expid -EXPORT OCSMASS:GOCART -ALT_EXPORT CASMASSCA.oc:CA.oc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCCMASS -EXPID $expid -EXPORT OCCMASS:GOCART -ALT_EXPORT CACMASSCA.oc:CA.oc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCEXTTAU -EXPID $expid -EXPORT OCEXTTAU:GOCART -ALT_EXPORT CAEXTTAUCA.oc:CA.oc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCSCATAU -EXPID $expid -EXPORT OCSCATAU:GOCART -ALT_EXPORT CASCATAUCA.oc:CA.oc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCANGSTR -EXPID $expid -EXPORT OCANGSTR:GOCART -ALT_EXPORT CAANGSTRCA.oc:CA.oc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCHYPHIL -EXPID $expid -EXPORT OCHYPHIL:GOCART -ALT_EXPORT CAHYPHILCA.oc:CA.oc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCEMBB -EXPID $expid -EXPORT OCEMBB:GOCART -ALT_EXPORT CAEMBBCA.oc:CA.oc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCEMBF -EXPID $expid -EXPORT OCEMBF:GOCART -ALT_EXPORT CAEMBFCA.oc:CA.oc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCEMAN -EXPID $expid -EXPORT OCEMAN:GOCART -ALT_EXPORT CAEMANCA.oc:CA.oc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCFLUXU -EXPID $expid -EXPORT OCFLUXU:GOCART -ALT_EXPORT CAFLUXUCA.oc:CA.oc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME OCFLUXV -EXPID $expid -EXPORT OCFLUXV:GOCART -ALT_EXPORT CAFLUXVCA.oc:CA.oc -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BREM001 -EXPID $expid -EXPORT BREM001:GOCART -ALT_EXPORT CAEMCA.br:CA.br:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BREM002 -EXPID $expid -EXPORT BREM002:GOCART -ALT_EXPORT CAEMCA.br:CA.br:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BRDP001 -EXPID $expid -EXPORT BRDP001:GOCART -ALT_EXPORT CADPCA.br:CA.br:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BRDP002 -EXPID $expid -EXPORT BRDP002:GOCART -ALT_EXPORT CADPCA.br:CA.br:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BRWT001 -EXPID $expid -EXPORT BRWT001:GOCART -ALT_EXPORT CAWTCA.br:CA.br:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BRWT002 -EXPID $expid -EXPORT BRWT002:GOCART -ALT_EXPORT CAWTCA.br:CA.br:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BRSV001 -EXPID $expid -EXPORT BRSV001:GOCART -ALT_EXPORT CASVCA.br:CA.br:001 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BRSV002 -EXPID $expid -EXPORT BRSV002:GOCART -ALT_EXPORT CASVCA.br:CA.br:002 -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BRSMASS -EXPID $expid -EXPORT BRSMASS:GOCART -ALT_EXPORT CASMASSCA.br:CA.br -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BRCMASS -EXPID $expid -EXPORT BRCMASS:GOCART -ALT_EXPORT CACMASSCA.br:CA.br -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BREXTTAU -EXPID $expid -EXPORT BREXTTAU:GOCART -ALT_EXPORT CAEXTTAUCA.br:CA.br -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BRSCATAU -EXPID $expid -EXPORT BRCATTAU:GOCART -ALT_EXPORT CASCATAUCA.br:CA.br -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BRANGSTR -EXPID $expid -EXPORT BRANGSTR:GOCART -ALT_EXPORT CAANGSTRCA.br:CA.br -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BRHYPHIL -EXPID $expid -EXPORT BRHYPHIL:GOCART -ALT_EXPORT CAHYPHILCA.br:CA.br -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BREMBB -EXPID $expid -EXPORT BREMBB:GOCART -ALT_EXPORT CAEMBBCA.br:CA.br -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BREMBF -EXPID $expid -EXPORT BREMBF:GOCART -ALT_EXPORT CAEMBFCA.br:CA.br -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BREMAN -EXPID $expid -EXPORT BREMAN:GOCART -ALT_EXPORT CAEMANCA.br:CA.br -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BRFLUXU -EXPID $expid -EXPORT BRFLUXU:GOCART -ALT_EXPORT CAFLUXUCA.br:CA.br -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run genplot_2G -DIR aerosol -NAME BRFLUXV -EXPID $expid -EXPORT BRFLUXV:GOCART -ALT_EXPORT CAFLUXVCA.br:CA.br -MATH LOG -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 setenv LONSENV "0 360" @@ -774,6 +852,7 @@ if( $MAKE_LIST == TRUE | "$CMPEXP" != "NULL" ) then if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmpz -EXPID $expid -EXPORT DTDT_ANA:AGCM -SEASON $seasons -OUTPUT $output -DEBUG $debug -PTOP 30:L 10 0.1:L" ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmpz -EXPID $expid -EXPORT DVDT_ANA:AGCM -SEASON $seasons -OUTPUT $output -DEBUG $debug -PTOP 30:L 10 0.1:L" ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmpz -EXPID $expid -EXPORT DQVDT_ANA:AGCM -SEASON $seasons -OUTPUT $output -DEBUG $debug -PTOP 10" ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmpz -EXPID $expid -EXPORT DQVDT_CON:AGCM -SEASON $seasons -OUTPUT $output -DEBUG $debug -PTOP 10" ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmpz -EXPID $expid -EXPORT DUDT:AGCM -SEASON $seasons -OUTPUT $output -DEBUG $debug -PTOP 30:L 10 0.1:L" ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmpz -EXPID $expid -EXPORT DVDT:AGCM -SEASON $seasons -OUTPUT $output -DEBUG $debug -PTOP 30:L 10 0.1:L" ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmpz -EXPID $expid -EXPORT DTDT:AGCM -SEASON $seasons -OUTPUT $output -DEBUG $debug -PTOP 30:L 10 0.1:L" ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 @@ -807,6 +886,7 @@ if( $MAKE_LIST == TRUE | "$CMPEXP" != "NULL" ) then if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmpz -EXPID $expid -EXPORT DQVDT:AGCM -STAT BIAS -NAME BIAS -SEASON $seasons -OUTPUT $output -DEBUG $debug -PTOP 10" ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmp -EXPID $expid -EXPORT DMDTANA:DYN -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmp -EXPID $expid -EXPORT DPSDT_CON:AGCM -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmp -EXPID $expid -EXPORT DQVDTANAINT:DYN -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmp -EXPID $expid -EXPORT DMDTANA:DYN -STAT STD -OUTPUT $output -DEBUG $debug -SEASON $seasons " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 @@ -823,6 +903,7 @@ if( $MAKE_LIST == TRUE | "$CMPEXP" != "NULL" ) then if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmp -EXPID $expid -SEASON $seasons -OUTPUT $output -DEBUG $debug -EXPORT DVDT_ANA:AGCM -LEVEL $LEV " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmp -EXPID $expid -SEASON $seasons -OUTPUT $output -DEBUG $debug -EXPORT DTDT_ANA:AGCM -LEVEL $LEV " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmp -EXPID $expid -SEASON $seasons -OUTPUT $output -DEBUG $debug -EXPORT DQVDT_ANA:AGCM -LEVEL $LEV " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 + if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmp -EXPID $expid -SEASON $seasons -OUTPUT $output -DEBUG $debug -EXPORT DQVDT_CON:AGCM -LEVEL $LEV " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmp -EXPID $expid -SEASON $seasons -OUTPUT $output -DEBUG $debug -EXPORT DUDT:AGCM -LEVEL $LEV " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmp -EXPID $expid -SEASON $seasons -OUTPUT $output -DEBUG $debug -EXPORT DVDT:AGCM -LEVEL $LEV " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 if( $plot == $plotname.$n ) $grads $batch -p -c "run gencmp -EXPID $expid -SEASON $seasons -OUTPUT $output -DEBUG $debug -EXPORT DTDT:AGCM -LEVEL $LEV " ; set plots = `echo $plots $plotname.$n` ; @ n = $n + 1 diff --git a/GEOS_Util/plots/quickplot b/GEOS_Util/plots/quickplot index 9a7717e8..3adf73a9 100755 --- a/GEOS_Util/plots/quickplot +++ b/GEOS_Util/plots/quickplot @@ -344,6 +344,7 @@ foreach plot ($plots) set datetime = `date +%Y%m%d_%H%M%S` if( ! -e $plots_dir/$plot.$datetime.$type ) mkdir -p $plots_dir/$plot.$datetime.$type cd $plots_dir/$plot.$datetime.$type + echo "quickplot $argv" > quickplot.command # Configure QUICKPLOT to Computing Platform # ----------------------------------------- @@ -354,8 +355,12 @@ source $plots_dir/$plot.$datetime.$type/.quickplotrc # -------------------------------------- set cmpops = "$VERIFICATION/MERRA2_MEANS:A \ $VERIFICATION/ERA5_Monthly:V " -# $VERIFICATION/MERRA_MEANS:A \ -set cmpops = `echo $cmpops` + +# $VERIFICATION/MERRA_MEANS:A \ +#set cmpops = "$VERIFICATION/ERA5_Monthly:V " +#set cmpops = " " + + set cmpops = `echo $cmpops` # Update CMPEXP # ------------- diff --git a/GEOS_Util/plots/quickstat b/GEOS_Util/plots/quickstat index 057290ec..9e95ca00 100755 --- a/GEOS_Util/plots/quickstat +++ b/GEOS_Util/plots/quickstat @@ -334,11 +334,15 @@ cat $GEOSAPP/gcm_quickstat.j >> $SOURCE/gcm_quickstat.tmpl # Create CORCMP Commands # ---------------------- if( $#quickstat_corcmp > 1 ) then + set rmstypes = `echo 0 1 2 3 4` foreach FIELD ($fields) - echo 'if( $ID == '$IDX' ) '$quickstat_corcmp -field $FIELD >> $SOURCE/gcm_quickstat.tmpl + foreach rmstype ($rmstypes) + echo 'if( $ID == '"`printf %3d $IDX` ) "$quickstat_corcmp -field $FIELD -rms $rmstype >> $SOURCE/gcm_quickstat.tmpl @ IDX = $IDX + 1 + end + echo " " >> $SOURCE/gcm_quickstat.tmpl end - echo " " >> $SOURCE/gcm_quickstat.tmpl + endif # Create PLTSYS Commands @@ -347,21 +351,21 @@ if( $#quickstat_pltsys > 1 ) then foreach EXP ($exps) foreach FIELD ($fields) if( $FIELD == 'p' ) then - echo 'if( $ID == '$IDX' ) '$quickstat_pltsys" -field $FIELD -exp $EXP" -level 1000 >> $SOURCE/gcm_quickstat.tmpl - @ IDX = $IDX + 1 + echo 'if( $ID == '"`printf %3d $IDX` ) "$quickstat_pltsys" -field $FIELD -exp $EXP" -level 1000 >> $SOURCE/gcm_quickstat.tmpl + @ IDX = $IDX + 1 else if( $level == 'ALL' ) then - echo 'if( $ID == '$IDX' ) '$quickstat_pltsys" -field $FIELD -exp $EXP" -level HORIZ >> $SOURCE/gcm_quickstat.tmpl + echo 'if( $ID == '"`printf %3d $IDX` ) "$quickstat_pltsys" -field $FIELD -exp $EXP" -level HORIZ >> $SOURCE/gcm_quickstat.tmpl @ IDX = $IDX + 1 - echo 'if( $ID == '$IDX' ) '$quickstat_pltsys" -field $FIELD -exp $EXP" -level ZONAL >> $SOURCE/gcm_quickstat.tmpl + echo 'if( $ID == '"`printf %3d $IDX` ) "$quickstat_pltsys" -field $FIELD -exp $EXP" -level ZONAL >> $SOURCE/gcm_quickstat.tmpl @ IDX = $IDX + 1 else - echo 'if( $ID == '$IDX' ) '$quickstat_pltsys" -field $FIELD -exp $EXP" -level $level >> $SOURCE/gcm_quickstat.tmpl + echo 'if( $ID == '"`printf %3d $IDX` ) "$quickstat_pltsys" -field $FIELD -exp $EXP" -level $level >> $SOURCE/gcm_quickstat.tmpl @ IDX = $IDX + 1 endif endif end - echo " " >> $SOURCE/gcm_quickstat.tmpl + echo " " >> $SOURCE/gcm_quickstat.tmpl end endif @@ -371,25 +375,27 @@ if( $#quickstat_syscmp > 1 ) then foreach EXP ($syscmpexps) foreach FIELD ($fields) if( $FIELD == 'p' ) then - echo 'if( $ID == '$IDX' ) '$quickstat_syscmp" -field $FIELD -exp $EXP" -level 1000 >> $SOURCE/gcm_quickstat.tmpl - @ IDX = $IDX + 1 + echo 'if( $ID == '"`printf %3d $IDX` ) "$quickstat_syscmp" -field $FIELD -exp $EXP" -level 1000 >> $SOURCE/gcm_quickstat.tmpl + @ IDX = $IDX + 1 else if( $level == 'ALL' ) then - echo 'if( $ID == '$IDX' ) '$quickstat_syscmp" -field $FIELD -exp $EXP" -level HORIZ >> $SOURCE/gcm_quickstat.tmpl + echo 'if( $ID == '"`printf %3d $IDX` ) "$quickstat_syscmp" -field $FIELD -exp $EXP" -level HORIZ >> $SOURCE/gcm_quickstat.tmpl @ IDX = $IDX + 1 - echo 'if( $ID == '$IDX' ) '$quickstat_syscmp" -field $FIELD -exp $EXP" -level ZONAL >> $SOURCE/gcm_quickstat.tmpl + echo 'if( $ID == '"`printf %3d $IDX` ) "$quickstat_syscmp" -field $FIELD -exp $EXP" -level ZONAL >> $SOURCE/gcm_quickstat.tmpl @ IDX = $IDX + 1 else - echo 'if( $ID == '$IDX' ) '$quickstat_syscmp" -field $FIELD -exp $EXP" -level $level >> $SOURCE/gcm_quickstat.tmpl + echo 'if( $ID == '"`printf %3d $IDX` ) "$quickstat_syscmp" -field $FIELD -exp $EXP" -level $level >> $SOURCE/gcm_quickstat.tmpl @ IDX = $IDX + 1 endif endif end end - echo " " >> $SOURCE/gcm_quickstat.tmpl + echo " " >> $SOURCE/gcm_quickstat.tmpl endif -@ NTASKS = $IDX - 1 +@ NTASKS = $IDX - 1 # length of job list +@ NODES = 1 # number of nodes per job +@ MAXTASKS = 15 # max concurrent jobs to run /bin/rm -f $SOURCE/gcm_quickstat.j /bin/rm -f $SOURCE/sedfile @@ -398,6 +404,8 @@ cat > $SOURCE/sedfile << EOF s?@GEOSBIN?$GEOSBIN?g s?@GEOSSRC?$GEOSSRC?g s?@NTASKS?$NTASKS?g +s?@MAXTASKS?$MAXTASKS?g +s?@NODES?$NODES?g s?@PARTITION?$PARTITION?g s?@MODEL?$MODEL?g s?@QUEUE?$QUEUE?g @@ -531,7 +539,7 @@ if( "$plots" =~ *pltsys* ) then endif else set levels = $level - if( "$level" == "HORIZ" ) set levels = `echo 1000 975 950 925 900 850 800 750 700 600 500 400 300 250 200 150 100 70 30 10 7 5 3 1` + if( "$level" == "HORIZ" ) set levels = `echo 1000 975 950 925 900 850 800 750 700 600 500 400 300 250 200 150 100 70 50 30 10 7 5 3 1` if( "$level" == "ZONAL" ) set levels = `echo ZONAL` foreach level ( $levels ) @@ -591,7 +599,7 @@ if( "$plots" =~ *syscmp* ) then endif else set levels = $level - if( "$level" == "HORIZ" ) set levels = `echo 1000 975 950 925 900 850 800 750 700 600 500 400 300 250 200 150 100 70 30 10 7 5 3 1` + if( "$level" == "HORIZ" ) set levels = `echo 1000 975 950 925 900 850 800 750 700 600 500 400 300 250 200 150 100 70 50 30 10 7 5 3 1` if( "$level" == "ZONAL" ) set levels = `echo ZONAL` foreach level ( $levels ) diff --git a/GEOS_Util/plots/res/res_2.gs b/GEOS_Util/plots/res/res_2.gs index 2f4276d9..5d917fae 100644 --- a/GEOS_Util/plots/res/res_2.gs +++ b/GEOS_Util/plots/res/res_2.gs @@ -28,6 +28,15 @@ if(begdate = begdateo & enddate = enddateo ) endif +* Get Fixed Plotting Values from Resource File +* -------------------------------------------- +'run getenv "GEOSUTIL"' + geosutil = result + PLOTRC = geosutil'/plots/grads_util/plot.rc' +'getresource 'PLOTRC' STR_DYN_FIXED_PLOT_FACTOR' ; fixpltfact = result +'getresource 'PLOTRC' STR_DYN_FIXED_PLOT_CINT' ; fixpltcint = result + + 'rgbset' 'set rgb 84 204 204 204' 'set rgb 85 137 137 137' @@ -182,6 +191,12 @@ endif 'set t 1' 'd str'season'obs' +'set dfile ' zdifile +'set x 1' +'set t 1' +'sety' +'setz' + if( CINTDIFF != NULL ) * -------------------- @@ -210,6 +225,12 @@ if( CINTDIFF != NULL ) dn = dn+2 endif endif + + if( fixpltfact != NULL ) + 'd 'fixpltfact + dn =subwrd(result,4) + endif + if( dn<0 ) dm = -dn else @@ -221,12 +242,22 @@ if( CINTDIFF != NULL ) if( dn>0 ) 'd 0.1*'dqmax'/1e'dm cint = subwrd(result,4) + if( fixpltcint != NULL ) + 'd 'fixpltcint + fixpltcint =subwrd(result,4) + cint = fixpltcint + endif say 'dn> 0, CINT: 'cint 'shades 'cint 'd maskout( strdifz/1e'dm',abs(strdifz/1e'dm')-'cint' )' else 'd 0.1*'dqmax'*1e'dm cint = subwrd(result,4) + if( fixpltcint != NULL ) + 'd 'fixpltcint + fixpltcint =subwrd(result,4) + cint = fixpltcint + endif say 'dn< 0, CINT: 'cint 'shades 'cint 'd maskout( strdifz*1e'dm',abs(strdifz*1e'dm')-'cint' )' @@ -240,6 +271,12 @@ else endif +'set dfile 'dfile +'set x 'x1' 'x2 +'set y 'y1' 'y2 +'set z 'z1' 'z2 +'set t 1' + 'cbarn -scale 0.9 -snum 0.5' 'set gxout contour' 'set clopts 1 3 0.06' diff --git a/GEOS_Util/plots/res/res_3.gs b/GEOS_Util/plots/res/res_3.gs index 8ac0da7c..cbbe220f 100644 --- a/GEOS_Util/plots/res/res_3.gs +++ b/GEOS_Util/plots/res/res_3.gs @@ -28,6 +28,15 @@ if(begdate = begdateo & enddate = enddateo ) endif +* Get Fixed Plotting Values from Resource File +* -------------------------------------------- +'run getenv "GEOSUTIL"' + geosutil = result + PLOTRC = geosutil'/plots/grads_util/plot.rc' +'getresource 'PLOTRC' RES_DYN_FIXED_PLOT_FACTOR' ; fixpltfact = result +'getresource 'PLOTRC' RES_DYN_FIXED_PLOT_CINT' ; fixpltcint = result + + 'rgbset' 'set rgb 84 204 204 204' 'set rgb 85 137 137 137' @@ -107,6 +116,7 @@ say 'ZDIFILE: 'result 'sety' 'setz' +'set lev 900 1' 'minmax resdifz' dqmax = subwrd(result,1) dqmin = subwrd(result,2) @@ -182,6 +192,12 @@ endif 'set t 1' 'd res'season'obs' +'set dfile ' zdifile +'set x 1' +'set t 1' +'sety' +'setz' + if( CINTDIFF != NULL ) * -------------------- @@ -210,6 +226,12 @@ if( CINTDIFF != NULL ) dn = dn+2 endif endif + + if( fixpltfact != NULL ) + 'd 'fixpltfact + dn =subwrd(result,4) + endif + if( dn<0 ) dm = -dn else @@ -221,12 +243,22 @@ if( CINTDIFF != NULL ) if( dn>0 ) 'd 0.1*'dqmax'/1e'dm cint = subwrd(result,4) + if( fixpltcint != NULL ) + 'd 'fixpltcint + fixpltcint =subwrd(result,4) + cint = fixpltcint + endif say 'dn> 0, CINT: 'cint 'shades 'cint 'd maskout( resdifz/1e'dm',abs(resdifz/1e'dm')-'cint' )' else 'd 0.1*'dqmax'*1e'dm cint = subwrd(result,4) + if( fixpltcint != NULL ) + 'd 'fixpltcint + fixpltcint =subwrd(result,4) + cint = fixpltcint + endif say 'dn< 0, CINT: 'cint 'shades 'cint 'd maskout( resdifz*1e'dm',abs(resdifz*1e'dm')-'cint' )' @@ -240,6 +272,12 @@ else endif +'set dfile 'dfile +'set x 'x1' 'x2 +'set y 'y1' 'y2 +'set z 'z1' 'z2 +'set t 1' + 'cbarn -scale 0.9 -snum 0.5' 'set gxout contour' 'set clopts 1 3 0.06' diff --git a/GEOS_Util/plots/res/zonal.gs b/GEOS_Util/plots/res/zonal.gs index 580fb16e..174f3508 100644 --- a/GEOS_Util/plots/res/zonal.gs +++ b/GEOS_Util/plots/res/zonal.gs @@ -13,6 +13,9 @@ function zonal (args) 'run getvar T DYN' tname = subwrd(result,1) tfile = subwrd(result,2) +'run getvar U DYN' + uname = subwrd(result,1) + ufile = subwrd(result,2) say ' EXPID: 'expid say 'EXPDSC: 'expdsc @@ -34,22 +37,9 @@ say 'EXPDSC: 'expdsc * Initialize Environment using V-Wind File * ---------------------------------------- 'set dfile 'vfile -'setdates' 'set y 1' 'getinfo lat' lat0 = result -'setx' -'sety' -'setz' - -* Create Environment Variables for Seasonal Utility -* ------------------------------------------------- -'setdates' -'run getenv "BEGDATE"' - begdate = result -'run getenv "ENDDATE"' - enddate = result -'sett' 'getinfo xdim' xdim = result @@ -60,6 +50,10 @@ say 'EXPDSC: 'expdsc 'getinfo tdim' tdim = result +'set t '1 +'getinfo date' + begdate = result + 'run setenv "LAT0.'expid'" 'lat0 'run setenv "XDIM.'expid'" 'xdim 'run setenv "YDIM.'expid'" 'ydim @@ -67,28 +61,70 @@ say 'EXPDSC: 'expdsc 'run setenv "TDIM.'expid'" 'tdim 'run setenv "BEGDATE.'expid'" 'begdate +'setx' +'sety' +'setz' +'set t '1' 'tdim + 'makezf lev-lev zeros z' * Create Zonal Means * ------------------ -if( vfile != "NULL" ) ; 'set dfile 'vfile ; else ; 'chckname 'vname ; endif -'makezf 'vname' 'vname' z' + 'set dfile 'vfile + 'makezf 'vname' 'vname' z0' -if( tfile != "NULL" ) ; 'set dfile 'tfile ; else ; 'chckname 'tname ; endif -'makezf 'tname' 'tname' z' + 'set dfile 'tfile + 'makezf 'tname' 'tname' z0' + + 'set dfile 'ufile + 'makezf 'uname' 'uname' z0' * Assume VSTS Quadratic is in TFILE * --------------------------------- -if( tfile != "NULL" ) 'set dfile ' tfile - 'chckname vsts' - 'makezf vsts vsts z' -else - 'chckname vsts' - 'makezf vsts vsts z' -endif + rc=checkname(vsts) + if( rc=0 ) + 'makezf vsts vsts z0' + else + say '[Vstar Tstar] not found, setting to zero' + 'set x 1' + 'sety' + 'setz' + 'set t '1' 'tdim + 'define vstsz0 = zerosz' + endif + +* Assume USVS Quadratic is in UFILE +* --------------------------------- + 'set dfile ' ufile + rc=checkname(usvs) + if( rc=0 ) + 'makezf usvs usvs z0' + else + say '[Ustar Vstar] not found, setting to zero' + 'set x 1' + 'sety' + 'setz' + 'set t '1' 'tdim + 'define usvsz0 = zerosz' + endif + +* Assume USWS Quadratic is in UFILE +* --------------------------------- + 'set dfile ' ufile + rc=checkname(usws) + if( rc=0 ) + 'makezf usws usws z0' + else + say '[Ustar Wstar] not found, setting to zero' + 'set x 1' + 'sety' + 'setz' + 'set t '1' 'tdim + 'define uswsz0 = zerosz' + endif * Define Pressure Variables @@ -99,40 +135,45 @@ endif 'setz' 'set t '1 -'define pl = lev' +'define pl = lat-lat + lev' 'define pk = pow(pl,2/7)' -'set gxout fwrite' -'set fwrite grads.'expid'.fwrite' * Write data * ---------- +'set gxout fwrite' +'set fwrite grads.'expid'.fwrite' + t=1 while(t<=tdim) 'set t 't - say 'Writing Data T = 't' zdim = 'zdim + say 'Writing Data Time = 't' zdim = 'zdim' EXPID = 'expid + say ' Writing VZ' z=1 while(z<=zdim) 'set z 'z - if( vfile != "NULL" ) ; 'd ' vname'z' ; else ; 'd zerosz' ; endif + if( vfile != "NULL" ) ; 'd ' vname'z0' ; else ; 'd zerosz' ; endif z=z+1 endwhile + say ' Writing TZ' z=1 while(z<=zdim) 'set z 'z - if( tfile != "NULL" ) ; 'd ' tname'z' ; else ; 'd zerosz' ; endif + if( tfile != "NULL" ) ; 'd ' tname'z0' ; else ; 'd zerosz' ; endif z=z+1 endwhile + say ' Writing VSTSZ' z=1 while(z<=zdim) 'set z 'z - if( tfile != "NULL" ) ; 'd vstsz' ; else ; 'd zerosz' ; endif + if( tfile != "NULL" ) ; 'd vstsz0' ; else ; 'd zerosz' ; endif z=z+1 endwhile + say ' Writing PL' z=1 while(z<=zdim) 'set z 'z @@ -140,6 +181,7 @@ while(t<=tdim) z=z+1 endwhile + say ' Writing PK' z=1 while(z<=zdim) 'set z 'z @@ -147,14 +189,39 @@ while(t<=tdim) z=z+1 endwhile + say ' Writing UZ' + z=1 + while(z<=zdim) + 'set z 'z + if( ufile != "NULL" ) ; 'd ' uname'z0' ; else ; 'd zerosz' ; endif + z=z+1 + endwhile + + say ' Writing USVSZ' + z=1 + while(z<=zdim) + 'set z 'z + if( ufile != "NULL" ) ; 'd usvsz0' ; else ; 'd zerosz' ; endif + z=z+1 + endwhile + + say ' Writing USWSZ' + z=1 + while(z<=zdim) + 'set z 'z + if( ufile != "NULL" ) ; 'd uswsz0' ; else ; 'd zerosz' ; endif + z=z+1 + endwhile + say ' ' + t=t+1 endwhile 'disable fwrite' * Run Fortran Code to Produce StreamFunction and Residual Circulation * ------------------------------------------------------------------- -say ' 'geosutil'/plots/zonal_'arch'.x -tag 'expid' -desc 'descm -'! 'geosutil'/plots/zonal_'arch'.x -tag 'expid' -desc 'descm +say ' 'geosutil'/bin/zonal_'arch'.x -tag 'expid' -desc 'descm +'! 'geosutil'/bin/zonal_'arch'.x -tag 'expid' -desc 'descm '!remove sedfile' '!touch sedfile' @@ -176,6 +243,10 @@ say ' 'geosutil'/plots/zonal_'arch'.x -tag 'expid' -desc 'descm *'!remove ZDIM.txt' *'!remove TDIM.txt' +* ----------------------------------------------------- + +'run setdates' + * Loop over Possible Experiment Datasets for Comparison * ----------------------------------------------------- '!/bin/mv HISTORY.T HISTORY.Tmp' @@ -214,6 +285,9 @@ say 'GETVAR output: 'result 'run getvar T DYN 'exp tname = subwrd(result,1) tfile = subwrd(result,2) +'run getvar U DYN 'exp + uname = subwrd(result,1) + ufile = subwrd(result,2) say 'Comparison ID: 'obsid say 'Comparison Desc: 'obsdsc @@ -233,7 +307,7 @@ say 'Comparison Desc: 'obsdsc 'sety' 'setz' -'getdates' +'run getdates' begdateo = subwrd(result,1) enddateo = subwrd(result,2) @@ -270,22 +344,55 @@ say 'Comparison Desc: 'obsdsc * Create Zonal Means * ------------------ -if( vfile != "NULL" ) ; 'set dfile 'vfile ; else ; 'chckname 'vname ; endif -'makezf 'vname' 'vname' z' + 'set dfile 'vfile + 'makezf 'vname' 'vname' z'num -if( tfile != "NULL" ) ; 'set dfile 'tfile ; else ; 'chckname 'tname ; endif -'makezf 'tname' 'tname' z' + 'set dfile 'tfile + 'makezf 'tname' 'tname' z'num + 'set dfile 'ufile + 'makezf 'uname' 'uname' z'num * Assume VSTS Quadratic is in TFILE * --------------------------------- -if( tfile != "NULL" ) 'set dfile ' tfile - 'chckname vsts' - 'makezf vsts vsts z' + rc=checkname(vsts) + if( rc=0 ) + 'makezf vsts vsts z'num else - 'chckname vsts' - 'makezf vsts vsts z' + 'set x 1' + 'sety' + 'setz' + 'set t 'tmin' 'tmax + 'define vstsz'num' = zerosz' +endif + +* Assume USVS Quadratic is in UFILE +* --------------------------------- + 'set dfile ' ufile + rc=checkname(usvs) + if( rc=0 ) + 'makezf usvs usvs z'num +else + 'set x 1' + 'sety' + 'setz' + 'set t 'tmin' 'tmax + 'define usvsz'num' = zerosz' +endif + +* Assume USWS Quadratic is in UFILE +* --------------------------------- + 'set dfile ' ufile + rc=checkname(usws) + if( rc=0 ) + 'makezf usws usws z'num +else + 'set x 1' + 'sety' + 'setz' + 'set t 'tmin' 'tmax + 'define uswsz'num' = zerosz' endif @@ -300,37 +407,42 @@ endif 'define pl = lev' 'define pk = pow(pl,2/7)' -'set gxout fwrite' -'set fwrite grads.'obsid'.fwrite' * Write data * ---------- +'set gxout fwrite' +'set fwrite grads.'obsid'.fwrite' + t=tmin while(t<=tmax) 'set t 't - say 'Writing Data T = 't' zdim = 'zdim + say 'Writing Data Time = 't' zdim = 'zdim' CMPID = 'obsid + say ' Writing VZ' z=1 while(z<=zdim) 'set z 'z - if( vfile != "NULL" ) ; 'd ' vname'z' ; else ; 'd zerosz' ; endif + if( vfile != "NULL" ) ; 'd ' vname'z'num ; else ; 'd zerosz' ; endif z=z+1 endwhile + say ' Writing TZ' z=1 while(z<=zdim) 'set z 'z - if( tfile != "NULL" ) ; 'd ' tname'z' ; else ; 'd zerosz' ; endif + if( tfile != "NULL" ) ; 'd ' tname'z'num ; else ; 'd zerosz' ; endif z=z+1 endwhile + say ' Writing VSTSZ' z=1 while(z<=zdim) 'set z 'z - if( tfile != "NULL" ) ; 'd vstsz' ; else ; 'd zerosz' ; endif + if( tfile != "NULL" ) ; 'd vstsz'num ; else ; 'd zerosz' ; endif z=z+1 endwhile + say ' Writing PL' z=1 while(z<=zdim) 'set z 'z @@ -338,6 +450,7 @@ while(t<=tmax) z=z+1 endwhile + say ' Writing PK' z=1 while(z<=zdim) 'set z 'z @@ -345,14 +458,40 @@ while(t<=tmax) z=z+1 endwhile + say ' Writing UZ' + z=1 + while(z<=zdim) + 'set z 'z + if( ufile != "NULL" ) ; 'd ' uname'z'num ; else ; 'd zerosz' ; endif + z=z+1 + endwhile + + say ' Writing USVSZ' + z=1 + while(z<=zdim) + 'set z 'z + if( ufile != "NULL" ) ; 'd usvsz'num ; else ; 'd zerosz' ; endif + z=z+1 + endwhile + + say ' Writing USWSZ' + z=1 + while(z<=zdim) + 'set z 'z + if( ufile != "NULL" ) ; 'd uswsz'num ; else ; 'd zerosz' ; endif + z=z+1 + endwhile + say ' ' + + t=t+1 endwhile 'disable fwrite' * Run Fortran Code to Produce StreamFunction and Residual Circulation * ------------------------------------------------------------------- -say ' 'geosutil'/plots/zonal_'arch'.x -tag 'obsid' -desc 'desco -'! 'geosutil'/plots/zonal_'arch'.x -tag 'obsid' -desc 'desco +say ' 'geosutil'/bin/zonal_'arch'.x -tag 'obsid' -desc 'desco +'! 'geosutil'/bin/zonal_'arch'.x -tag 'obsid' -desc 'desco '!remove sedfile' '!touch sedfile' @@ -411,3 +550,28 @@ endif endwhile return length + function checkname (args) + name = subwrd(args,1) + 'lowercase 'name + name = result + + say 'Inside checkname, name = 'name + + 'query file' + numvar = sublin(result,6) + numvar = subwrd(numvar,5) + + rc = -1 + n = 1 + while ( n= ywet ) ; ywet = ydry - 0.2 ; endif + if( ydry < ywet ) ; ywet = ydry + 0.2 ; endif +endif +'set string 2 l 6' +'draw string 0.78 'ywet ' 'qwetave + -* Plot Time-Average Values -* ------------------------ - 'set strsiz .08' - 'set string 4 l 6' - 'draw string 0.78 'ytot ' 'qdryave - ytot = ytot-0.2 - 'set string 2 l 6' - 'draw string 0.78 'ytot ' 'qwetave - ytot = ytot-0.4 +* Plot Titles and Labels +* ---------------------- 'set string 1 c 6' 'set strsiz .12' if( delqdry < 0 ) @@ -255,8 +275,9 @@ wetmin = wetave - 0.6* ddif 'set vpage off' 'set string 1 c 6' -'set strsiz .14' +'set strsiz .12' 'draw string 6.15 8.25 'expid': 'expdsc +'set strsiz .14' 'draw string 6.15 7.95 Globally Integrated Total (Dry + QV+QL+QI) Surface Pressure (mb)' wetname = "QV" diff --git a/GEOS_Util/plots/zcmp/progz b/GEOS_Util/plots/zcmp/progz index 9a8f9270..0b49c601 100644 --- a/GEOS_Util/plots/zcmp/progz +++ b/GEOS_Util/plots/zcmp/progz @@ -609,6 +609,11 @@ say 'Processing Season: 'season n = 1 while( n <= numexp ) +say 'Checking plot between exp: 'qtag +say ' cexp: 'ctag.n +say ' obs: 'obsnam +say '' + if( ctag.n != "merra" & ctag.n != "MERRA-2" & ctag.n != "NULL" & type.n != V & ofile.n != "NULL" ) say 'Closeness plot between exp: 'qtag diff --git a/GEOS_Util/plots/zcmp/zcloseplt b/GEOS_Util/plots/zcmp/zcloseplt index d165a848..ae9c38ff 100644 --- a/GEOS_Util/plots/zcmp/zcloseplt +++ b/GEOS_Util/plots/zcmp/zcloseplt @@ -113,6 +113,10 @@ if( EXPORT = "U" ) 'getresource 'PLOTRC' U_DYN_Z'scale'_DCOLS' ; dcols = result 'getresource 'PLOTRC' U_DYN_Z_'LEVTYPE'LEVS' ; dlevs = result 'getresource 'PLOTRC' U_DYN_Z'scale'_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' U_DYN_CLOSE_PLOT_FACTOR' ; clspltfact = result + 'getresource 'PLOTRC' U_DYN_CLOSE_PLOT_CINT' ; clspltcint = result + 'getresource 'PLOTRC' U_DYN_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' U_DYN_FIXED_PLOT_CINT' ; fixpltcint = result endif if( EXPORT = "V" ) oname = "/horiz_"cmpnam"_vwnd_"zid"_closeness_"obsnam @@ -121,6 +125,10 @@ if( EXPORT = "V" ) 'getresource 'PLOTRC' V_DYN_Z_CCOLS' ; ccols = result 'getresource 'PLOTRC' V_DYN_Z_DCOLS' ; dcols = result 'getresource 'PLOTRC' V_DYN_Z_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' V_DYN_CLOSE_PLOT_FACTOR' ; clspltfact = result + 'getresource 'PLOTRC' V_DYN_CLOSE_PLOT_CINT' ; clspltcint = result + 'getresource 'PLOTRC' V_DYN_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' V_DYN_FIXED_PLOT_CINT' ; fixpltcint = result endif if( EXPORT = "T" ) oname = "/horiz_"cmpnam"_tmpu_"zid"_closeness_"obsnam @@ -129,6 +137,10 @@ if( EXPORT = "T" ) 'getresource 'PLOTRC' T_DYN_Z_CCOLS' ; ccols = result 'getresource 'PLOTRC' T_DYN_Z_'LEVTYPE'COLS' ; dcols = result 'getresource 'PLOTRC' T_DYN_Z_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' T_DYN_CLOSE_PLOT_FACTOR' ; clspltfact = result + 'getresource 'PLOTRC' T_DYN_CLOSE_PLOT_CINT' ; clspltcint = result + 'getresource 'PLOTRC' T_DYN_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' T_DYN_FIXED_PLOT_CINT' ; fixpltcint = result endif if( EXPORT = "Q" ) oname = "/horiz_"cmpnam"_sphu_"zid"_closeness_"obsnam @@ -137,6 +149,10 @@ if( EXPORT = "Q" ) 'getresource 'PLOTRC' Q_MOIST_Z_CCOLS' ; ccols = result 'getresource 'PLOTRC' Q_MOIST_Z_DCOLS' ; dcols = result 'getresource 'PLOTRC' Q_MOIST_Z_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' Q_MOIST_CLOSE_PLOT_FACTOR' ; clspltfact = result + 'getresource 'PLOTRC' Q_MOIST_CLOSE_PLOT_CINT' ; clspltcint = result + 'getresource 'PLOTRC' Q_MOIST_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' Q_MOIST_FIXED_PLOT_CINT' ; fixpltcint = result endif if( EXPORT = "QLTOT" ) oname = "/horiz_"cmpnam"_ql_"zid"_closeness_"obsnam @@ -145,6 +161,10 @@ if( EXPORT = "QLTOT" ) 'getresource 'PLOTRC' QLTOT_AGCM_Z_CCOLS' ; ccols = result 'getresource 'PLOTRC' QLTOT_AGCM_Z_DCOLS' ; dcols = result 'getresource 'PLOTRC' QLTOT_AGCM_Z_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' QLTOT_AGCM_CLOSE_PLOT_FACTOR' ; clspltfact = result + 'getresource 'PLOTRC' QLTOT_AGCM_CLOSE_PLOT_CINT' ; clspltcint = result + 'getresource 'PLOTRC' QLTOT_AGCM_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' QLTOT_AGCM_FIXED_PLOT_CINT' ; fixpltcint = result endif if( EXPORT = "QITOT" ) oname = "/horiz_"cmpnam"_qi_"zid"_closeness_"obsnam @@ -153,6 +173,10 @@ if( EXPORT = "QITOT" ) 'getresource 'PLOTRC' QITOT_AGCM_Z_CCOLS' ; ccols = result 'getresource 'PLOTRC' QITOT_AGCM_Z_DCOLS' ; dcols = result 'getresource 'PLOTRC' QITOT_AGCM_Z_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' QITOT_AGCM_CLOSE_PLOT_FACTOR' ; clspltfact = result + 'getresource 'PLOTRC' QITOT_AGCM_CLOSE_PLOT_CINT' ; clspltcint = result + 'getresource 'PLOTRC' QITOT_AGCM_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' QITOT_AGCM_FIXED_PLOT_CINT' ; fixpltcint = result endif if( EXPORT = "RH2" ) oname = "/horiz_"cmpnam"_rh_"zid"_closeness_"obsnam @@ -161,6 +185,10 @@ if( EXPORT = "RH2" ) 'getresource 'PLOTRC' RH2_MOIST_Z_CCOLS' ; ccols = result 'getresource 'PLOTRC' RH2_MOIST_Z_DCOLS' ; dcols = result 'getresource 'PLOTRC' RH2_MOIST_Z_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' RH2_MOIST_CLOSE_PLOT_FACTOR' ; clspltfact = result + 'getresource 'PLOTRC' RH2_MOIST_CLOSE_PLOT_CINT' ; clspltcint = result + 'getresource 'PLOTRC' RH2_MOIST_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' RH2_MOIST_FIXED_PLOT_CINT' ; fixpltcint = result endif if( EXPORT = "ZLE" ) oname = "/horiz_"cmpnam"_hght_"zid"_closeness_"obsnam @@ -169,6 +197,10 @@ if( EXPORT = "ZLE" ) 'getresource 'PLOTRC' ZLE_DYN_Z_CCOLS' ; ccols = result 'getresource 'PLOTRC' ZLE_DYN_Z'scale'_'LEVTYPE'COLS' ; dcols = result 'getresource 'PLOTRC' ZLE_DYN_Z'scale'_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' ZLE_DYN_CLOSE_PLOT_FACTOR' ; clspltfact = result + 'getresource 'PLOTRC' ZLE_DYN_CLOSE_PLOT_CINT' ; clspltcint = result + 'getresource 'PLOTRC' ZLE_DYN_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' ZLE_DYN_FIXED_PLOT_CINT' ; fixpltcint = result endif if( EXPORT = "OMEGA" ) oname = "/horiz_"cmpnam"_omega_"zid"_closeness_"obsnam @@ -177,6 +209,10 @@ if( EXPORT = "OMEGA" ) 'getresource 'PLOTRC' OMEGA_DYN_CCOLS' ; ccols = result 'getresource 'PLOTRC' OMEGA_DYN_'LEVTYPE'COLS' ; dcols = result 'getresource 'PLOTRC' OMEGA_DYN_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' OMEGA_DYN_CLOSE_PLOT_FACTOR' ; clspltfact = result + 'getresource 'PLOTRC' OMEGA_DYN_CLOSE_PLOT_CINT' ; clspltcint = result + 'getresource 'PLOTRC' OMEGA_DYN_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' OMEGA_DYN_FIXED_PLOT_CINT' ; fixpltcint = result endif if( EXPORT = "O3" ) oname = "/horiz_"cmpnam"_o3_"zid"_closeness_"obsnam @@ -185,6 +221,10 @@ if( EXPORT = "O3" ) 'getresource 'PLOTRC' O3_CHEMISTRY_Z_DCOLS' ; dcols = result 'getresource 'PLOTRC' O3_CHEMISTRY_Z'scale'_CLEVS' ; clevs = result 'getresource 'PLOTRC' O3_CHEMISTRY_Z'scale'_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' O3_CHEMISTRY_CLOSE_PLOT_FACTOR' ; clspltfact = result + 'getresource 'PLOTRC' O3_CHEMISTRY_CLOSE_PLOT_CINT' ; clspltcint = result + 'getresource 'PLOTRC' O3_CHEMISTRY_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' O3_CHEMISTRY_FIXED_PLOT_CINT' ; fixpltcint = result endif say ' TITLE: 'title say ' CLEVS: 'clevs @@ -303,6 +343,20 @@ else source_cint = comparison_cint endif +* Set Hardwired Values for Consistent Plots +* ----------------------------------------- + if( fixpltfact != NULL ) + 'd 'fixpltfact + source_n = subwrd(result,4) + endif + say 'Diff Scaling Factor: 'source_n + + if( fixpltcint != NULL ) + 'd 'fixpltcint + fixpltcint = subwrd(result,4) + source_cint = fixpltcint + endif + * ----------------------------------------------------------------- 'shades 'source_cint @@ -314,7 +368,24 @@ else 'set ccolor 1' 'd qzplt' + + 'set gxout stat' + 'd qzplt' + mdifminmax = sublin(result,8) + mdifmin = subwrd(mdifminmax,4) + mdifmax = subwrd(mdifminmax,5) + say 'MDIF_Max Value: 'mdifmax + say 'MDIF_Min Value: 'mdifmin + 'set gxout shaded' + 'd abs('mdifmin')' + amdifmin = subwrd(result,4) + 'd abs('mdifmax')' + amdifmax = subwrd(result,4) + if( amdifmin > amdifmax ) ; amdifmax = amdifmin ; endif + say 'Absolute MDIF_MAX: ' amdifmax + endif +'draw ylab Pressure (mb)' 'set parea 0 8.5 7.0 11' 'cbarn -vert' @@ -344,16 +415,15 @@ if( CINTDIFF = 'NULL' & dlevs != 'NULL' & dcols != 'NULL' ) 'set clevs 'dlevs 'd dif2z' else - - 'shades 'source_cint - 'define qzplt = dif2z/1e'source_n - 'd qzplt' - 'set gxout contour' - 'set clevs -'source_cint' 'source_cint - 'set ccolor 1' - 'd qzplt' - + 'shades 'source_cint + 'define qzplt = dif2z/1e'source_n + 'd qzplt' + 'set gxout contour' + 'set clevs -'source_cint' 'source_cint + 'set ccolor 1' + 'd qzplt' endif +'draw ylab Pressure (mb)' * Bottom Plot: Closeness to Verfification * ---------------------------------------- @@ -372,10 +442,33 @@ if( scale = LOG ) ; 'setlevs' ; endif dfact = 1 'run getenv "CINTDIFF"' CINTDIFF = result + 'stats absdifz' avgdif = subwrd(result,1) stddif = subwrd(result,2) qmax = stddif/3 + + + + dqrel = qmax / amdifmax * 100 + say 'raw dqrel = 'dqrel + 'getint 'dqrel*100 + dqrel = result/100 + say 'int dqrel = 'dqrel + + dpct = 0.1 + say 'DQMAX: 'qmax' QMOD_MAX: 'amdifmax + say 'Relative Percent Difference: 'dqrel' (100*DQMAX/QMOD_MAX)' + say ' Default Percent Difference for Plots: 'dpct + + if( dqrel < dpct ) + dqrel = dpct + endif + qmax = dqrel * amdifmax / 100 + say 'Setting Diff CINT using Relative Percent Difference: 'dqrel'% dqmax = 'qmax + + + if( qmax > 0 ) 'd log10('qmax')' n = subwrd(result,4) @@ -393,14 +486,23 @@ if( scale = LOG ) ; 'setlevs' ; endif n = n+2 endif endif - say 'Diff Scaling Factor: 'n - 'd 'qmax'/1e'n - cint = subwrd(result,4) * Set Hardwired Values for Consistent Plots * ----------------------------------------- -* n = -2 -* cint = 1 + if( clspltfact != NULL ) + 'd 'clspltfact + n = subwrd(result,4) + endif + say 'Diff Scaling Factor: 'n + + if( clspltcint != NULL ) + 'd 'clspltcint + clspltcint = subwrd(result,4) + cint = clspltcint + else + 'd 'qmax'/1e'n + cint = subwrd(result,4) + endif 'shades 'cint 'define qzplt = absdifz/1e'n @@ -418,8 +520,6 @@ if( scale = LOG ) ; 'setlevs' ; endif 'set lev 1000 'ptop 'set t 1' -'draw ylab Pressure (mb)' - 'set vpage off' 'set string 1 l 4' 'set strsiz .065' @@ -460,12 +560,28 @@ byearo = subwrd(date,2) emntho = subwrd(date,1) eyearo = subwrd(date,2) -'set string 1 l 4' + +'set string 1 l 6 90' +'set strsiz .17' +'draw string 0.75 1.8 Pressure (mb)' + +'set string 1 l 4 0' 'set strsiz .08' -'draw string 0.10 10.37 Beg: 'bmnthm' 'byearm -'draw string 0.10 10.24 End: 'emnthm' 'eyearm -'draw string 0.10 6.97 Beg: 'bmntho' 'byearo -'draw string 0.10 6.84 End: 'emntho' 'eyearo + + 'draw string 0.10 10.37 Beg: 'bmnthm' 'byearm + 'draw string 0.10 10.24 End: 'emnthm' 'eyearm + 'draw string 0.10 6.97 Beg: 'bmntho' 'byearo + 'draw string 0.10 6.84 End: 'emntho' 'eyearo + +'set strsiz .07' +'draw string 0.050 1.67 Plot represents' +'draw string 0.050 1.52 values > 'dqrel' %' +'draw string 0.050 1.36 Relative Difference' +'draw string 0.050 1.22 ( DQ/QMax )' + + + + 'set string 1 c 6' 'myprint -name 'output'/'oname'.'season diff --git a/GEOS_Util/plots/zcmp/zplt b/GEOS_Util/plots/zcmp/zplt index 4a6e0e88..37c36a41 100644 --- a/GEOS_Util/plots/zcmp/zplt +++ b/GEOS_Util/plots/zcmp/zplt @@ -106,8 +106,12 @@ if( EXPORT = "U" ) 'getresource 'PLOTRC' U_DYN_Z'scale'_CLEVS' ; clevs = result 'getresource 'PLOTRC' U_DYN_Z'scale'_CCOLS' ; ccols = result 'getresource 'PLOTRC' U_DYN_Z'scale'_DCOLS' ; dcols = result + 'getresource 'PLOTRC' U_DYN_Z'scale'_DPCT' ; dpct = result 'getresource 'PLOTRC' U_DYN_Z_'LEVTYPE'LEVS' ; dlevs = result 'getresource 'PLOTRC' U_DYN_Z'scale'_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' U_DYN_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' U_DYN_FIXED_PLOT_CINT' ; fixpltcint = result + if( dpct = 'NULL' ) ; dpct = 0.5 ; endif endif if( EXPORT = "V" ) oname = "/horiz_"obsnam"_vwnd_z" @@ -115,15 +119,23 @@ if( EXPORT = "V" ) 'getresource 'PLOTRC' V_DYN_Z_CLEVS' ; clevs = result 'getresource 'PLOTRC' V_DYN_Z_CCOLS' ; ccols = result 'getresource 'PLOTRC' V_DYN_Z_DCOLS' ; dcols = result + 'getresource 'PLOTRC' V_DYN_Z'scale'_DPCT' ; dpct = result 'getresource 'PLOTRC' V_DYN_Z_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' V_DYN_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' V_DYN_FIXED_PLOT_CINT' ; fixpltcint = result + if( dpct = 'NULL' ) ; dpct = 0.5 ; endif endif if( EXPORT = "T" ) oname = "/horiz_"obsnam"_tmpu_z" 'getresource 'PLOTRC' T_DYN_TITLE' ; title = result 'getresource 'PLOTRC' T_DYN_Z_CLEVS' ; clevs = result 'getresource 'PLOTRC' T_DYN_Z_CCOLS' ; ccols = result + 'getresource 'PLOTRC' T_DYN_Z_DPCT' ; dpct = result 'getresource 'PLOTRC' T_DYN_Z_'LEVTYPE'COLS' ; dcols = result 'getresource 'PLOTRC' T_DYN_Z_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' T_DYN_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' T_DYN_FIXED_PLOT_CINT' ; fixpltcint = result + if( dpct = 'NULL' ) ; dpct = 0.1 ; endif endif if( EXPORT = "Q" ) oname = "/horiz_"obsnam"_sphu_z" @@ -131,7 +143,11 @@ if( EXPORT = "Q" ) 'getresource 'PLOTRC' Q_MOIST_Z_CLEVS' ; clevs = result 'getresource 'PLOTRC' Q_MOIST_Z_CCOLS' ; ccols = result 'getresource 'PLOTRC' Q_MOIST_Z_DCOLS' ; dcols = result + 'getresource 'PLOTRC' Q_MOIST_Z_DPCT' ; dpct = result 'getresource 'PLOTRC' Q_MOIST_Z_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' Q_MOIST_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' Q_MOIST_FIXED_PLOT_CINT' ; fixpltcint = result + if( dpct = 'NULL' ) ; dpct = 0.3 ; endif endif if( EXPORT = "QLTOT" ) oname = "/horiz_"obsnam"_ql_z" @@ -139,7 +155,11 @@ if( EXPORT = "QLTOT" ) 'getresource 'PLOTRC' QLTOT_AGCM_Z_CLEVS' ; clevs = result 'getresource 'PLOTRC' QLTOT_AGCM_Z_CCOLS' ; ccols = result 'getresource 'PLOTRC' QLTOT_AGCM_Z_DCOLS' ; dcols = result + 'getresource 'PLOTRC' QLTOT_AGCM_Z_DPCT' ; dpct = result 'getresource 'PLOTRC' QLTOT_AGCM_Z_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' QLTOT_AGCM_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' QLTOT_AGCM_FIXED_PLOT_CINT' ; fixpltcint = result + if( dpct = 'NULL' ) ; dpct = 0.3 ; endif endif if( EXPORT = "QITOT" ) oname = "/horiz_"obsnam"_qi_z" @@ -147,7 +167,11 @@ if( EXPORT = "QITOT" ) 'getresource 'PLOTRC' QITOT_AGCM_Z_CLEVS' ; clevs = result 'getresource 'PLOTRC' QITOT_AGCM_Z_CCOLS' ; ccols = result 'getresource 'PLOTRC' QITOT_AGCM_Z_DCOLS' ; dcols = result + 'getresource 'PLOTRC' QITOT_AGCM_Z_DPCT' ; dpct = result 'getresource 'PLOTRC' QITOT_AGCM_Z_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' QITOT_AGCM_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' QITOT_AGCM_FIXED_PLOT_CINT' ; fixpltcint = result + if( dpct = 'NULL' ) ; dpct = 0.3 ; endif endif if( EXPORT = "RH2" ) oname = "/horiz_"obsnam"_rh_z" @@ -155,35 +179,54 @@ if( EXPORT = "RH2" ) 'getresource 'PLOTRC' RH2_MOIST_Z_CLEVS' ; clevs = result 'getresource 'PLOTRC' RH2_MOIST_Z_CCOLS' ; ccols = result 'getresource 'PLOTRC' RH2_MOIST_Z_DCOLS' ; dcols = result + 'getresource 'PLOTRC' RH2_MOIST_Z_DPCT' ; dpct = result 'getresource 'PLOTRC' RH2_MOIST_Z_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' RH2_MOIST_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' RH2_MOIST_FIXED_PLOT_CINT' ; fixpltcint = result + if( dpct = 'NULL' ) ; dpct = 0.3 ; endif endif if( EXPORT = "ZLE" ) oname = "/horiz_"obsnam"_hght_z" 'getresource 'PLOTRC' ZLE_DYN_TITLE' ; title = result 'getresource 'PLOTRC' ZLE_DYN_Z'scale'_CLEVS' ; clevs = result 'getresource 'PLOTRC' ZLE_DYN_Z_CCOLS' ; ccols = result + 'getresource 'PLOTRC' ZLE_DYN_Z_DPCT' ; dpct = result 'getresource 'PLOTRC' ZLE_DYN_Z'scale'_'LEVTYPE'COLS' ; dcols = result 'getresource 'PLOTRC' ZLE_DYN_Z'scale'_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' ZLE_DYN_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' ZLE_DYN_FIXED_PLOT_CINT' ; fixpltcint = result + if( dpct = 'NULL' ) ; dpct = 0.1 ; endif endif if( EXPORT = "OMEGA" ) oname = "/horiz_"obsnam"_omega_z" 'getresource 'PLOTRC' OMEGA_DYN_TITLE' ; title = result 'getresource 'PLOTRC' OMEGA_DYN_CLEVS' ; clevs = result 'getresource 'PLOTRC' OMEGA_DYN_CCOLS' ; ccols = result + 'getresource 'PLOTRC' OMEGA_DYN_DPCT' ; dpct = result 'getresource 'PLOTRC' OMEGA_DYN_'LEVTYPE'COLS' ; dcols = result 'getresource 'PLOTRC' OMEGA_DYN_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' OMEGA_DYN_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' OMEGA_DYN_FIXED_PLOT_CINT' ; fixpltcint = result + if( dpct = 'NULL' ) ; dpct = 0.2 ; endif endif if( EXPORT = "O3" ) oname = "/horiz_"obsnam"_o3_z" 'getresource 'PLOTRC' O3_CHEMISTRY_TITLE' ; title = result 'getresource 'PLOTRC' O3_CHEMISTRY_Z_CCOLS' ; ccols = result 'getresource 'PLOTRC' O3_CHEMISTRY_Z_DCOLS' ; dcols = result + 'getresource 'PLOTRC' O3_CHEMISTRY_Z_DPCT' ; dpct = result 'getresource 'PLOTRC' O3_CHEMISTRY_Z'scale'_CLEVS' ; clevs = result 'getresource 'PLOTRC' O3_CHEMISTRY_Z'scale'_'LEVTYPE'LEVS' ; dlevs = result + 'getresource 'PLOTRC' O3_CHEMISTRY_FIXED_PLOT_FACTOR' ; fixpltfact = result + 'getresource 'PLOTRC' O3_CHEMISTRY_FIXED_PLOT_CINT' ; fixpltcint = result + if( dpct = 'NULL' ) ; dpct = 0.2 ; endif endif + + say ' TITLE: 'title say ' CLEVS: 'clevs say ' DLEVS: 'dlevs +say ' DPCT: 'dpct * Make Mean Plot * -------------- @@ -205,6 +248,59 @@ say ' DLEVS: 'dlevs 'set lev 1000 'ptop 'set t 1' +'getinfo zfreq' + zfreq = result + if( zfreq = 'varying' ) + 'getinfo zmin' + zmin = result + 'getinfo zmax' + zmax = result + endif + if( zfreq = 'fixed' ) + 'getinfo zpos' + zmin = result + zmax = result + endif + + z = zmin +'set z 'z +'minmax.simple modz' + qmax = subwrd(result,1) + qmin = subwrd(result,2) + z = z + 1 + while( z <= zmax ) +'set z 'z +'minmax.simple modz' + dmax = subwrd(result,1) + dmin = subwrd(result,2) + if( dmax > qmax ) ; qmax = dmax ; endif + if( dmin < qmin ) ; qmin = dmin ; endif + z = z + 1 + endwhile + +'d abs('qmin')' + qmin = subwrd(result,4) +'d abs('qmax')' + qmax = subwrd(result,4) +if( qmin > qmax ) + qmax = qmin +endif +say 'QMAX = 'qmax + +'setlats' +'setlons' +'getinfo lonmin' + lonmin = result + +'set lon 'lonmin +'set lev 1000 'ptop +'set t 1' + + +************************************************************ +* Top Plot +************************************************************ + 'set vpage 0 8.5 0.0 11' 'set parea 1.5 7.0 7.70 10.50' 'set zlog off' @@ -223,14 +319,19 @@ if( Lbit = L ) ; 'setlevs' ; endif 'cbarn -vert' 'set parea off' + +************************************************************ +* Middle Plot +************************************************************ + +'set vpage 0 8.5 0.0 11' +'set parea 1.5 7.0 4.30 7.10' +'set zlog off' 'set dfile 'ofile 'setlats' 'set lon 'lonmin 'set lev 1000 'ptop 'set t 1' -'set vpage 0 8.5 0.0 11' -'set parea 1.5 7.0 4.30 7.10' -'set zlog off' if( Lbit = L ) ; 'setlevs' ; endif 'set grads off' 'set gxout shaded' @@ -244,6 +345,11 @@ if( Lbit = L ) ; 'setlevs' ; endif 'd obsz' 'set parea off' + +************************************************************ +* Bottom Plot +************************************************************ + 'run getenv "ZDIFILE"' zdifile = result 'set dfile 'zdifile @@ -276,13 +382,30 @@ else 'stats qz' avgdif = subwrd(result,1) stddif = subwrd(result,2) - qmax = stddif/3 - if( qmax > 0 ) - 'd log10('qmax')' + dqmax = stddif/3 + + dqrel = dqmax / qmax * 100 * 100 + 'getint 'dqrel + dqrel = result/100 + dqact = dqrel + 'd 'dpct + dpct = subwrd(result,4) + say 'QMAX: 'qmax' DQMAX: 'dqmax + say 'Relative PCT Difference: 'dqrel' (100*DQMAX/QMAX)' + say ' Minimum PCT for Plots: 'dpct + + if( dqrel < dpct ) + dqrel = dpct + endif + dqmax = dqrel * qmax / 100 + say 'Setting CINT using DQREL: 'dqrel'%, DQMAX: 'dqmax + + if( dqmax > 0 ) + 'd log10('dqmax')' n = subwrd(result,4) - else + else n = 0 - endif + endif say ' Log Factor: 'n if( n<0 ) ; n = n-2 ; endif 'getint 'n @@ -294,9 +417,22 @@ else n = n+2 endif endif + + if( fixpltfact != NULL ) + 'd 'fixpltfact + n =subwrd(result,4) + endif + say 'Diff Scaling Factor: 'n - 'd 'qmax'/1e'n + 'd 'dqmax'/1e'n cint = subwrd(result,4) + + if( fixpltcint != NULL ) + 'd 'fixpltcint + fixpltcint =subwrd(result,4) + cint = fixpltcint + endif + 'shades 'cint 'define qzplt = qz/1e'n dfact = "10**"n @@ -315,10 +451,19 @@ endif 'set lev 1000 'ptop 'set t 1' -'draw ylab Pressure (mb)' +if( CINTDIFF = 'NULL' ) + 'draw ylab Pressure (mb)' +endif 'set vpage off' -'set string 1 l 4' + +if( CINTDIFF != 'NULL' ) + 'set string 1 l 6 90' + 'set strsiz .17' + 'draw string 0.75 1.8 Pressure (mb)' +endif + +'set string 1 l 4 0' 'set strsiz .065' 'draw string 0.05 0.08 ( EXPID: 'expid' )' @@ -330,10 +475,11 @@ endif 'draw string 4.25 10.635 'qdesc' 'season' ('nmod')' 'draw string 4.25 7.235 'odesc' 'season' ('nobs') ('climate')' + if( dfact = 1 ) -'draw string 4.25 3.850 Difference (Top-Middle)' + 'draw string 4.25 3.850 Difference (Top-Middle)' else -'draw string 4.25 3.850 Difference (Top-Middle) (x 'dfact')' + 'draw string 4.25 3.850 Difference (Top-Middle) (x 'dfact')' endif @@ -356,6 +502,15 @@ eyearo = subwrd(date,2) 'draw string 0.10 10.24 End: 'emnthm' 'eyearm 'draw string 0.10 6.97 Beg: 'bmntho' 'byearo 'draw string 0.10 6.84 End: 'emntho' 'eyearo + +if( CINTDIFF != 'NULL' ) + 'set strsiz .07' + 'draw string 0.050 1.67 Plot represents' + 'draw string 0.050 1.52 values > 'dqrel' %' + 'draw string 0.050 1.36 Relative Difference' + 'draw string 0.050 1.22 ( DQ/QMax )' +endif + 'set string 1 c 6' if( Lbit = L ) diff --git a/GEOS_Util/plots/zcmp1/progz1 b/GEOS_Util/plots/zcmp1/progz1 index 19beb1ae..0635813b 100644 --- a/GEOS_Util/plots/zcmp1/progz1 +++ b/GEOS_Util/plots/zcmp1/progz1 @@ -177,14 +177,25 @@ endif else m = m+1 +*say 'Processing Season: 'season + +*'set dfile 'mfile +*'count "'season'" 'begdate' 'enddate +* nmod = result + +*'set dfile 'ofile +*'count "'season'"' +* nobs = result + + say 'Processing Season: 'season 'set dfile 'mfile 'count "'season'" 'begdate' 'enddate nmod = result -'set dfile 'ofile -'count "'season'"' +'set dfile 'cfile.numexp +'count "'season'" 'begdateo' 'enddateo nobs = result diff --git a/GEOS_Util/plots/zcmp1/zplt1 b/GEOS_Util/plots/zcmp1/zplt1 index e02b189b..ecaf4846 100644 --- a/GEOS_Util/plots/zcmp1/zplt1 +++ b/GEOS_Util/plots/zcmp1/zplt1 @@ -223,12 +223,16 @@ endwhile 'set vpage off' +'set string 1 l 4' +'set strsiz .065' +'draw string 0.08 0.07 ( EXPID: 'expid' )' + 'set string 1 c 6' 'set strsiz .13' 'draw string 5.5 8.3 'title' ('season')' 'set strsiz .10' -'draw string 2.95 7.700 EXPID: 'expid' 'qdesc' ('nmod')' +'draw string 2.95 7.700 'qdesc' ('nmod')' 'draw string 7.95 7.700 'odesc' ('nobs')' 'draw string 5.45 3.900 Difference (Left-Right)' diff --git a/GEOS_Util/plots/zonal.f b/GEOS_Util/plots/zonal.f index e1601d14..6611d0f2 100644 --- a/GEOS_Util/plots/zonal.f +++ b/GEOS_Util/plots/zonal.f @@ -3,10 +3,13 @@ PROGRAM main character*120 title character*120 begdate + real, allocatable :: uz(:,:) real, allocatable :: vz(:,:) real, allocatable :: tz(:,:) real, allocatable :: wz(:,:) real, allocatable :: thz(:,:) + real, allocatable :: upvpz(:,:) + real, allocatable :: upwpz(:,:) real, allocatable :: vptpz(:,:) real, allocatable :: vpthpz(:,:) real, allocatable :: pl(:,:) @@ -15,8 +18,27 @@ PROGRAM main real, allocatable :: res(:,:) real, allocatable :: vstar(:,:) real, allocatable :: wstar(:,:) + real, allocatable :: wmean(:,:) + real, allocatable :: weddy(:,:) + real, allocatable :: psi1(:,:) ! Residual Mass StreamFunction (Method 1) + real, allocatable :: psi2(:,:) ! Residual Mass StreamFunction (Method 2) + real, allocatable :: psim(:,:) ! Mean Mass StreamFunction + real, allocatable :: epfy(:,:) ! Eliassen-Palm Flux in Northward Direction + real, allocatable :: epfz(:,:) ! Eliassen-Palm Flux in Upward Direction + real, allocatable :: epfdiv(:,:) ! Eliassen-Palm Flux Divergence + real, allocatable :: vstr(:,:) real*4, allocatable :: dum(:) + real,allocatable :: upvp (:,:) + real,allocatable :: upwp (:,:) + real,allocatable :: dudp (:,:) + real,allocatable :: dudphi(:,:) + real,allocatable :: psie (:,:) + real,allocatable :: dfdphi(:,:) + real,allocatable :: dfdp (:,:) + real,allocatable :: plz (:,:) + real,allocatable :: delp (:,:) + character*120, allocatable :: arg(:) character*120 tag, output real undef, lat0 @@ -65,10 +87,13 @@ PROGRAM main read (10,*) begdate close(10) + allocate( uz(jm,lm) ) allocate( vz(jm,lm) ) allocate( tz(jm,lm) ) allocate( wz(jm,lm) ) allocate( thz(jm,lm) ) + allocate( upvpz(jm,lm) ) + allocate( upwpz(jm,lm) ) allocate( vptpz(jm,lm) ) allocate( vpthpz(jm,lm) ) allocate( pl(jm,lm) ) @@ -77,8 +102,27 @@ PROGRAM main allocate( res(jm,lm) ) allocate( vstar(jm,lm) ) allocate( wstar(jm,lm) ) + allocate( wmean(jm,lm) ) + allocate( weddy(jm,lm) ) + allocate( psi1(jm,lm) ) + allocate( psi2(jm,lm) ) + allocate( psim(jm,lm) ) + allocate( epfy(jm,lm) ) + allocate( epfz(jm,lm) ) + allocate( epfdiv(jm,lm) ) + allocate( vstr(jm,lm) ) allocate( dum(jm) ) + allocate (upvp (jm,LM) ) + allocate (upwp (jm,LM) ) + allocate (dudp (jm,LM) ) + allocate (dudphi(jm,LM) ) + allocate (psie (jm,LM) ) + allocate (dfdphi(jm,LM) ) + allocate (dfdp (jm,LM) ) + allocate (plz (jm,LM) ) + allocate (delp (jm,LM) ) + c GRADS Datasets c -------------- open (10,file= 'grads' // trim(tag) // '.fwrite',form='unformatted',access='direct',recl=jm*4) @@ -91,32 +135,108 @@ PROGRAM main rc = 0 lrec = 1 do n=1,tm + if(n.eq.1) print *, 'Reading VZ' + do L=1,lm + read(10,rec=lrec,iostat=rc) dum + if( rc.eq.0 ) then + vz(:,L) = dum(:) + else + vz(:,L) = undef + if( L.eq.1 ) print *, 'Error Reading VZ, setting to UNDEF' + endif + lrec = lrec+1 + enddo + if(n.eq.1) print *, 'Reading TZ' + do L=1,lm + read(10,rec=lrec,iostat=rc) dum + if( rc.eq.0 ) then + tz(:,L) = dum(:) + else + tz(:,L) = undef + if( L.eq.1 ) print *, 'Error Reading TZ, setting to UNDEF' + endif + lrec = lrec+1 + enddo + if(n.eq.1) print *, 'Reading VPTPZ' do L=1,lm - read(10,rec=lrec,iostat=rc) dum ; vz(:,L) = dum(:) ; lrec = lrec+1 + read(10,rec=lrec,iostat=rc) dum + if( rc.eq.0 ) then + vptpz(:,L) = dum(:) + else + vptpz(:,L) = undef + if( L.eq.1 ) print *, 'Error Reading VPTPZ, setting to UNDEF' + endif + lrec = lrec+1 enddo + if(n.eq.1) print *, 'Reading PL' do L=1,lm - read(10,rec=lrec,iostat=rc) dum ; tz(:,L) = dum(:) ; lrec = lrec+1 + read(10,rec=lrec,iostat=rc) dum + if( rc.eq.0 ) then + pl(:,L) = dum(:) + else + pl(:,L) = undef + if( L.eq.1 ) print *, 'Error Reading PL, setting to UNDEF' + endif + lrec = lrec+1 enddo + if(n.eq.1) print *, 'Reading PK' do L=1,lm - read(10,rec=lrec,iostat=rc) dum ; vptpz(:,L) = dum(:) ; lrec = lrec+1 + read(10,rec=lrec,iostat=rc) dum + if( rc.eq.0 ) then + pk(:,L) = dum(:) + else + pk(:,L) = undef + if( L.eq.1 ) print *, 'Error Reading PK, setting to UNDEF' + endif + lrec = lrec+1 enddo + if(n.eq.1) print *, 'Reading UZ' do L=1,lm - read(10,rec=lrec,iostat=rc) dum ; pl(:,L) = dum(:) ; lrec = lrec+1 + read(10,rec=lrec,iostat=rc) dum + if( rc.eq.0 ) then + uz(:,L) = dum(:) + else + uz(:,L) = undef + if( L.eq.1 ) print *, 'Error Reading UZ, setting to UNDEF' + endif + lrec = lrec+1 enddo + if(n.eq.1) print *, 'Reading UPVPZ' do L=1,lm - read(10,rec=lrec,iostat=rc) dum ; pk(:,L) = dum(:) ; lrec = lrec+1 + read(10,rec=lrec,iostat=rc) dum + if( rc.eq.0 ) then + upvpz(:,L) = dum(:) + else + upvpz(:,L) = undef + if( L.eq.1 ) print *, 'Error Reading UPVPZ, setting to UNDEF' + endif + lrec = lrec+1 + enddo + if(n.eq.1) print *, 'Reading UPWPZ' + do L=1,lm + read(10,rec=lrec,iostat=rc) dum + if( rc.eq.0 ) then + upwpz(:,L) = dum(:) + else + upwpz(:,L) = undef + if( L.eq.1 ) print *, 'Error Reading UPWPZ, setting to UNDEF' + endif + lrec = lrec+1 enddo nt = nt+1 do L=1,lm do j=1,jm - if( abs(tz(j,L)-undef).gt.0.1 ) then - thz(j,L) = tz(j,L)/pk(j,L) - vpthpz(j,L) = vptpz(j,L)/pk(j,L) - else - thz(j,L) = undef - vpthpz(j,L) = undef - endif + if( abs(tz(j,L)-undef).gt.0.1 ) then + thz(j,L) = tz(j,L)/pk(j,L) ! K/mb**kappa + else + thz(j,L) = undef + endif + if( abs(vptpz(j,L)-undef).gt.0.1 ) then + vpthpz(j,L) = vptpz(j,L)/pk(j,L) ! m/sec K/mb**kappa + else + vpthpz(j,L) = undef + endif enddo enddo @@ -124,18 +244,39 @@ PROGRAM main c --------------------------------- call stream ( vz,pl,jm,lm,strm,undef ) + call make_psi ( uz,vz,thz,upvpz,upwpz,vpthpz,pl,jm,lm,psi1,psi2,psim,epfy,epfz,epfdiv,undef, + . upvp,upwp,dudp,dudphi,psie,dfdphi,dfdp,plz,delp) + c Compute Mean Vertical Velocity from Continuity c ---------------------------------------------- call make_w ( vz,pl,jm,lm,wz,undef ) c Compute Residual Circulation c ---------------------------- - call residual ( vz,vpthpz,thz,wz,pl,jm,lm,res,vstar,wstar,undef ) + call residual ( vz,vpthpz,thz,wz,pl,jm,lm,res,vstar,wstar,wmean,weddy,undef ) call GLAWRT (strm ,jm,LM,20) call GLAWRT (res ,jm,LM,20) call GLAWRT (vstar ,jm,LM,20) call GLAWRT (wstar ,jm,LM,20) + call GLAWRT (wmean ,jm,LM,20) + call GLAWRT (weddy ,jm,LM,20) + call GLAWRT (psi1 ,jm,LM,20) + call GLAWRT (psi2 ,jm,LM,20) + call GLAWRT (psim ,jm,LM,20) + call GLAWRT (epfy ,jm,LM,20) + call GLAWRT (epfz ,jm,LM,20) + call GLAWRT (epfdiv,jm,LM,20) + + call GLAWRT (upvp ,jm,LM,20) + call GLAWRT (upwp ,jm,LM,20) + call GLAWRT (dudp ,jm,LM,20) + call GLAWRT (dudphi,jm,LM,20) + call GLAWRT (psie ,jm,LM,20) + call GLAWRT (dfdphi,jm,LM,20) + call GLAWRT (dfdp ,jm,LM,20) + call GLAWRT (plz ,jm,LM,20) + call GLAWRT (delp ,jm,LM,20) enddo close(10) @@ -151,7 +292,8 @@ PROGRAM main write(30,102) pl(1,L) enddo print *, 'Finished , nt = ',nt - write(30,103) nt,trim(begdate),lm,lm,lm,lm + write(30,103) nt,trim(begdate),lm,lm,lm,lm,lm,lm,lm,lm,lm,lm,lm,lm, + . lm,lm,lm,lm,lm,lm,lm,lm,lm 101 format('dset ',a,/, . 'title ',a,/, . 'options sequential ',/, @@ -161,11 +303,28 @@ PROGRAM main . 'zdef ',i3,' levels ') 102 format(10x,f8.3) 103 format('tdef ',i3,' linear ',a,' 1mo',/, - . 'vars 4 ',/, + . 'vars 21',/, . 'str ',i3,' 0 Streamfunction',/, . 'res ',i3,' 0 Residual Circulation',/, . 'vstar ',i3,' 0 Vstar',/, . 'wstar ',i3,' 0 wstar',/, + . 'wmean ',i3,' 0 wmean ',/, + . 'weddy ',i3,' 0 weddy ',/, + . 'psi1 ',i3,' 0 Res1 streamfunction ',/, + . 'psi2 ',i3,' 0 Res2 streamfunction ',/, + . 'psim ',i3,' 0 Mass streamfunction ',/, + . 'epfy ',i3,' 0 Eliassen-Palm flux y',/, + . 'epfz ',i3,' 0 Eliassen-Palm flux z',/, + . 'epfdiv ',i3,' 0 Eliassen-Palm flux Divergence',/, + . 'upvp ',i3,' 0 Uprime Vprim',/, + . 'upwp ',i3,' 0 Uprime Omegaprime',/, + . 'dudp ',i3,' 0 DuDp',/, + . 'dudphi ',i3,' 0 DuDphi',/, + . 'psie ',i3,' 0 Eddy Streamfunction',/, + . 'dfdphi ',i3,' 0 DfDphi',/, + . 'dfdp ',i3,' 0 DfDp',/, + . 'plz ',i3,' 0 Pressure',/, + . 'delp ',i3,' 0 Pressure Thickness',/, . 'endvars') stop @@ -205,68 +364,362 @@ SUBROUTINE GLAWRT (A, IM,LM, KTP) RETURN END - SUBROUTINE GLAWRT2 (A, IM, JM,LM, KTP, undef) - real A (JM,LM) - real TEM (JM) - real DPHI (JM), qout(181) - real lon,lat,lons(181),lats(181) - real*4 dum(181) - real :: dlam(IM) + subroutine make_psi( u0,v0,th0,upvp0,upwp0,vpthp0,p0,jm,lm,psi1,psi2,psim,epfy,epfz,epfdiv,undef, + . upvp,upwp,dudp,dudphi,psie,dfdphi,dfdp,p,delp) + use MAPL_ConstantsMod + implicit none + integer j,k,L,jm,lm + real undef,dphi,a,g,pi,phi,pk0 + logical defined + + real th0(jm,lm), th(jm,lm) + real upvp0(jm,lm), upvp(jm,lm) + real upwp0(jm,lm), upwp(jm,lm) + real vpthp0(jm,lm), vpthp(jm,lm) + real u0(jm,lm), u(jm,lm) + real v0(jm,lm), v(jm,lm) + real p0(jm,lm), p(jm,lm) + + real psi1(jm,lm) + real psi2(jm,lm) + real psim(jm,lm) + real epfy(jm,lm) + real epfz(jm,lm) + real epfdiv(jm,lm) + + real dudp(jm,lm) + real dfdp(jm,lm) + real dthdp(jm,lm) + real dudphi(jm,lm) + real dfdphi(jm,lm) + real psie(jm,lm) + real delp(jm,lm) + real veddy(jm,lm) + real vstar(jm,lm) + real stuff(jm,lm) + real the(jm,0:lm) ! theta_edge + real ple(jm,0:lm) ! p_edge + real ue(jm,0:lm) ! u_edge + real epfze(jm,0:lm) ! epfz_edge + real f(jm) + real dum(jm) + integer method + +c Define Constants +c ---------------- + pi = 4.*atan(1.) + dphi = pi/(jm-1) + a = MAPL_RADIUS + g = MAPL_GRAV + + Method = 0 + +c Invert level index (in order to be top=>bottom) +c ----------------------------------------------- + do L=1,lm + u(:,L) = u0(:,lm-L+1) ! m/sec + v(:,L) = v0(:,lm-L+1) ! m/sec + p(:,L) = p0(:,lm-L+1) ! mb + th(:,L) = th0(:,lm-L+1) ! K/mb**kappa + upvp(:,L) = upvp0(:,lm-L+1) ! m/sec m/sec + upwp(:,L) = upwp0(:,lm-L+1) ! m/sec Pa/sec + vpthp(:,L) = vpthp0(:,lm-L+1) ! m/sec K/mb**kappa + enddo - pi = 4.0*atan(1.0) - dlam = 1 - dphi(:) = pi/(jm-1) + pk0 = (1000.0)**(2.0/7.0) ! mb**kappa - iout = 1 - jout = 181 - dlout = 2*pi/iout - dpout = pi/(jout-1) + where( abs(p -undef).gt.0.1 ) ; p = p*100 ; endwhere + where( abs(th -undef).gt.0.1 ) ; th = th*pk0 ; endwhere + where( abs(vpthp-undef).gt.0.1 ) ; vpthp = vpthp*pk0 ; endwhere - loc = 0 - do j=1,jout - do i=1,iout - loc = loc + 1 - lon = -pi + (i-1)*dlout - lons(loc) = lon +c Compute PLE Edge Values +c ----------------------- + ple(:,0) = max( 0.0, p(:,1) - 0.5*( p(:,2)-p(:,1) ) ) + do L=1,lm-1 + do j=1,jm + ple(j,L) = ( p(j,L+1)+ p(j,L) )*0.5 enddo enddo + ple(:,lm) = p(:,lm) + 0.5*( p(:,lm)-p(:,lm-1) ) - loc = 0 - do j=1,jout - lat = -pi/2.0 + (j-1)*dpout - do i=1,iout - loc = loc + 1 - lats(loc) = lat + do L=1,lm + delp(:,L) = ple(:,L)-ple(:,L-1) enddo + +c Compute Mass Streamfunction +c --------------------------- + pi = 4.*atan(1.) + dphi = pi/(jm-1) + a = MAPL_RADIUS + g = MAPL_GRAV + + do L=1,LM + dum(:) = 0.0 + do k=1,L + where( abs(v(:,k)-undef).gt.0.1 ) + dum(:) = dum(:) + v(:,k)*delp(:,k) + endwhere + enddo + do j=1,jm + phi = -pi/2 + (j-1)*dphi + psim(j,L) = 2*pi*a*cos(phi)/g * dum(j) + enddo enddo - DO L=1,LM - DO J=1,JM - if( abs(a(J,L)).gt.1.e-20 ) then - TEM (J) = A(J,L) +c Define Eddy Streamfunction = vpthp/dthdp +c ---------------------------------------- + + ! call compute_edge( th,p,ple,jm,lm,undef,the ) + call map1_cubic( lm,p,th, lm+1,ple,the, jm, Method, undef) + call compute_dqdp( the,delp,jm,lm,undef,dthdp ) + + do L=1,lm + do j=1,jm + if( defined(dthdp(j,L),undef) .and. + . defined(vpthp(j,L),undef) ) then + dthdp(j,L) = min( -0.003*pk0/100, dthdp(j,L) ) + psie(j,L) = vpthp(j,L) / dthdp(j,L) + else + psie(j,L) = undef + endif + enddo + enddo + +c Compute Veddy = D/Dp[ psie ] +c ---------------------------- + do L=2,lm-1 + do j=1,jm + if( defined(psie(j,L+1),undef) .and. + . defined(psie(j,L-1),undef) ) then + veddy(j,L) = ( psie(j,L+1)-psie(j,L-1) )/ ( 2*(ple(j,L)-ple(j,L-1)) ) else - TEM (J) = 0. + veddy(j,L) = undef endif - ENDDO - call interp_h ( tem,1,JM,1, - . dlam,dphi,0.0,90.0,0.0, - . qout,iout*jout,lons,lats, - . undef ) - dum = qout - WRITE(KTP) dum - ENDDO - RETURN - END + enddo + enddo + do j=1,jm + veddy(j,1) = veddy(j,2) + veddy(j,lm) = veddy(j,lm-1) + enddo + +c Compute Vstar = v - veddy +c ------------------------- + do L=1,lm + do j=1,jm + if( defined( veddy(j,L),undef) .and. + . defined( v(j,L),undef) ) then + vstar(j,L) = v(j,L) - veddy(j,L) + else + vstar(j,L) = undef + endif + enddo + enddo + + +c Construct Residual Streamfunction from Vstar (Method 1) +c ------------------------------------------------------- + do L=1,LM + dum(:) = 0.0 + do k=1,L + where( abs(vstar(:,k)-undef).gt.0.1 ) + dum(:) = dum(:) + vstar(:,k)*delp(:,k) + endwhere + enddo + do j=1,jm + phi = -pi/2 + (j-1)*dphi + psi1(j,L) = 2*pi*a*cos(phi)/g * dum(j) + enddo + enddo + + +c Compute Residual Streamfunction (Method 2) +c ------------------------------------------ + do L=1,lm + do j=1,jm + phi = -pi/2 + (j-1)*dphi + if( defined(psie(j,L),undef) ) then + psi2(j,L) = 2*pi*a*cos(phi)/g * psie(j,L) + else + psi2(j,L) = undef + endif + enddo + enddo + + do L=1,lm + where( abs(psim(:,L)-undef).gt.0.1 .and. + . abs(psi2(:,L)-undef).gt.0.1 ) + psi2(:,L) = psim(:,L) - psi2(:,L) + elsewhere + psi2(:,L) = undef + endwhere + enddo + + +c Compute Eliassen-Palm Flux +c -------------------------- + do j=1,jm + phi = -pi/2 + (j-1)*dphi + f(j) = 2*MAPL_OMEGA*sin(phi) + enddo + + !------------------------- Compute du/dp -------------------------------- + + ! call compute_edge( u,p,ple,jm,lm,undef,ue ) + call map1_cubic( lm,p,u, lm+1,ple,ue, jm, Method, undef) + call compute_dqdp( ue,delp,jm,lm,undef,dudp ) + + !--------------------- Compute d(u*cos)/(a*cos*dphi) --------------------- + + do L=1,lm + do j=1,jm + phi = -pi/2 + (j-1)*dphi + if( defined(u(j,L),undef) ) then + stuff(j,L) = u(j,L)*cos(phi) + else + stuff(j,L) = undef + endif + enddo + enddo + + do L=1,lm + dudphi(1 ,L) = undef + dudphi(jm,L) = undef + do j=2,jm-1 + phi = -pi/2 + (j-1)*dphi + if( defined(stuff(j+1,L),undef) .and. + . defined(stuff(j-1,L),undef) ) then + dudphi(j,L) = ( stuff(j+1,L)-stuff(j-1,L) )/(a*cos(phi)*2*dphi) + else + dudphi(j,L) = undef + endif + enddo + enddo + + !----------------------- Compute epfy & epfz ---------------------------- + + do L=1,lm + do j=1,jm + phi = -pi/2 + (j-1)*dphi + if( defined( dudp(j,L),undef) .and. + . defined( psie(j,L),undef) .and. + . defined( upvp(j,L),undef) ) then + epfy(j,L) = a*cos(phi)*( dudp(j,L)*psie(j,L) - upvp(j,L) ) + else + epfy(j,L) = undef + endif + if( defined( dudphi(j,L),undef) .and. + . defined( psie(j,L),undef) .and. + . defined( upwp(j,L),undef) ) then + epfz(j,L) = a*cos(phi)*( (f(j)-dudphi(j,L))*psie(j,L) - upwp(j,L) ) + else + epfz(j,L) = undef + endif + enddo + enddo + + !----------------------- Compute d(epfy*cos)/(a*cos*dphi) ----------------------- + + do L=1,lm + do j=1,jm + phi = -pi/2 + (j-1)*dphi + if( defined(epfy(j,L),undef) ) then + stuff(j,L) = epfy(j,L)*cos(phi) + else + stuff(j,L) = undef + endif + enddo + enddo + + do L=1,lm + dfdphi(1 ,L) = undef + dfdphi(jm,L) = undef + do j=2,jm-1 + phi = -pi/2 + (j-1)*dphi + if( defined(stuff(j+1,L),undef) .and. + . defined(stuff(j-1,L),undef) ) then + dfdphi(j,L) = ( stuff(j+1,L)-stuff(j-1,L) )/(a*cos(phi)*2*dphi) + else + dfdphi(j,L) = undef + endif + enddo + enddo + + !------------------------- Compute d(epfz)/dp --------------------------- + + ! call compute_edge( epfz,p,ple,jm,lm,undef,epfze ) + call map1_cubic( lm,p,epfz, lm+1,ple,epfze, jm, Method, undef) + call compute_dqdp( epfze,delp,jm,lm,undef,dfdp ) + + !----------------------- Compute EPFlux Divergence ---------------------- + + do L=1,lm + do j=1,jm + if( defined( dfdp(j,L),undef) .and. + . defined( dfdphi(j,L),undef) ) then + epfdiv(j,L) = dfdphi(j,L) + dfdp(j,L) + else + epfdiv(j,L) = undef + endif + enddo + enddo + +c Invert Streamfunction for grads output (in order to be bottom=>top) +c ------------------------------------------------------------------- + + call flipz( psim ,jm,lm,1.0e-10 ,undef ) + call flipz( psi1 ,jm,lm,1.0e-10*2.4892,undef ) + call flipz( psi2 ,jm,lm,1.0e-10*2.4892,undef ) + call flipz( epfy ,jm,lm,1.0 ,undef ) + call flipz( epfz ,jm,lm,1.0 ,undef ) + call flipz( epfdiv,jm,lm,1.0 ,undef ) + + call flipz( upvp ,jm,lm,1.0 ,undef ) + call flipz( upwp ,jm,lm,1.0 ,undef ) + call flipz( dudp ,jm,lm,1.0 ,undef ) + call flipz( dudphi,jm,lm,1.0 ,undef ) + call flipz( psie ,jm,lm,1.0 ,undef ) + call flipz( dfdphi,jm,lm,1.0 ,undef ) + call flipz( dfdp ,jm,lm,1.0 ,undef ) + call flipz( p ,jm,lm,1.0 ,undef ) + call flipz( delp ,jm,lm,1.0 ,undef ) + + return + end + + subroutine flipz( q,jm,lm,scale,undef ) + implicit none + integer j,L,jm,lm + real undef,scale + logical defined + real q(jm,lm) + real z(jm,lm) + do L=1,lm + where( abs(q(:,LM-L+1)-undef).gt.0.1 ) + z(:,L) = q(:,LM-L+1)*scale + elsewhere + z(:,L) = undef + endwhere + enddo + do L=1,lm + q(:,L) = z(:,L) + enddo + + return + end subroutine stream ( v0,p0,jm,lm,s,undef ) use MAPL_ConstantsMod implicit none integer j,k,L,jm,lm - real pi,dp,a,g,const,delp,phi,undef + real pi,dp,a,g,const,phi,undef real v(jm,lm), v0(jm,lm) real s(jm,lm) real p0(jm,lm), p(jm,lm) + real dum(jm) + + real ple(jm,0:lm) + real delp(jm, lm) c Invert VWND and P level index (in order to be top=>bottom) c ---------------------------------------------------------- @@ -275,29 +728,35 @@ subroutine stream ( v0,p0,jm,lm,s,undef ) v(:,L) = v0(:,lm-L+1) enddo +c Compute Edge Pressures and Thickness +c ------------------------------------ + ple(:,0) = max( 0.0, p(:,1) - 0.5*( p(:,2)-p(:,1) ) ) + do L=1,lm-1 + ple(:,L) = ( p(:,L)+ p(:,L+1) )*0.5 + enddo + ple(:,lm) = p(:,lm) + 0.5*( p(:,lm)-p(:,lm-1) ) + do L=1,lm + delp(:,L) = ple(:,L)-ple(:,L-1) + enddo + pi = 4.*atan(1.) dp = pi/(jm-1) a = MAPL_RADIUS g = MAPL_GRAV - const = 2*pi*a/g*100 / 1.e10 + const = 2*pi*a/g * 1.0e-8 do k=1,lm - do j=1,jm - s(j,k) = 0.0 - enddo - + dum(:) = 0.0 do L=1,k do j=1,jm - delp = (p(j,L+1)-p(j,L-1))/2 - if(L.eq.1) delp = (p(j,L+1)-p(j,L) )/2 - if(L.eq.lm) delp = (p(j,L) -p(j,L-1))/2 phi = -pi/2+(j-1)*dp if( abs(v(j,L)-undef).gt.0.1 ) then - s(j,k) = s(j,k) + v(j,l)*delp*cos(phi)*const + dum(j) = dum(j) + v(j,L)*cos(phi)*delp(j,L) endif enddo enddo + s(:,k) = dum(:)*const enddo c Invert Streamfunction for grads output (in order to be bottom=>top) @@ -316,11 +775,11 @@ subroutine stream ( v0,p0,jm,lm,s,undef ) return end - subroutine residual ( v0,vpthp0,th0,w0,p0,jm,lm,res,vstar,wstar,undef ) + subroutine residual ( v0,vpthp0,th0,w0,p0,jm,lm,res,vstar,wstar,wmean,weddy,undef ) use MAPL_ConstantsMod implicit none integer j,k,L,jm,lm - real pi,dp,a,g,H,ps,ts,rhos,z,phi,undef,delp + real pi,dp,a,g,H,ps,ts,rhos,z,phi,undef real airmw,runiv,cpd,rgas,akap real v0(jm,lm), v(jm,lm) @@ -329,12 +788,16 @@ subroutine residual ( v0,vpthp0,th0,w0,p0,jm,lm,res,vstar,wstar,undef ) real vpthp (jm,lm), th (jm,lm), dthdp(jm,lm) real stuff (jm,lm) real res (jm,lm) + real vtlda(jm,lm) real vstar(jm,lm) - real wstar(jm,lm) + real wstar(jm,lm), wmean(jm,lm), weddy(jm,lm) real s (jm,lm) real p0(jm,lm), p(jm,lm), rho0(jm,lm) - real cosp(jm) + real cosp(jm), dum(jm,lm) real ddcosp(jm,lm) + real the(jm,0:lm) + real ple(jm,0:lm) + real delp(jm, lm) logical defined PARAMETER ( AIRMW = MAPL_AIRMW ) @@ -362,6 +825,8 @@ subroutine residual ( v0,vpthp0,th0,w0,p0,jm,lm,res,vstar,wstar,undef ) ts = 240.0 rhos = ps/(rgas*ts) + print *, ' rhos = ', rhos + print *, '1/rhos = ',1.0/rhos c Compute Mean Air Density c ------------------------ @@ -372,71 +837,51 @@ subroutine residual ( v0,vpthp0,th0,w0,p0,jm,lm,res,vstar,wstar,undef ) enddo enddo - -c Compute D(Theta)/DZ (with a forced minimum to prevent dthdz => 0) -c ----------------------------------------------------------------- - do L=2,lm-1 - do j=1,jm - delp = p(j,L+1)-p(j,L-1) - if( defined(th(j,L+1),undef ) .and. - . defined(th(j,L-1),undef ) ) then - dthdp(j,L) = min( -0.003, ( th(j,L+1)-th(j,L-1) )/ delp ) - else - dthdp(j,L) = undef - endif - enddo - enddo do j=1,jm - dthdp(j,1) = dthdp(j,2) - dthdp(j,lm) = dthdp(j,lm-1) + phi = -pi/2 + (j-1)*dp + cosp(j) = cos(phi) enddo - -c Compute D(cos*vpthp/dthdz)/Dphi -c ------------------------------- - do L=1,lm +c Compute Edge Pressures and Thickness +c ------------------------------------ + the(:,0) = th(:,1) + ple(:,0) = max( 0.0, p(:,1) - 0.5*( p(:,2)-p(:,1) ) ) + do L=1,lm-1 do j=1,jm - phi = -pi/2 + (j-1)*dp - cosp(j) = cos(phi) - if( defined(vpthp(j,L),undef) .and. - . defined(dthdp(j,L),undef) .and. - . dthdp(j,L).ne.0.0 ) then - stuff(j,L) = -H*cosp(j)*vpthp(j,L)/(p(j,L)*dthdp(j,L)) - else - stuff(j,L) = undef - endif + ple(j,L) = ( p(j,L)+ p(j,L+1) )*0.5 + the(j,L) = undef + if( defined(th(j,L ),undef) ) the(j,L) = th(j,L) + if( defined(th(j,L+1),undef) ) the(j,L) = th(j,L+1) + if( defined(th(j,L+1),undef) .and. defined(th(j,L),undef) ) the(j,L) = ( th(j,L+1)+th(j,L) )*0.5 enddo enddo + ple(:,lm) = p(:,lm) + 0.5*( p(:,lm)-p(:,lm-1) ) + + the(:,lm) = undef + where( abs(th(:,lm)-undef).gt.0.1 .and. abs(the(:,lm-1)-undef).gt.0.1 ) + the(:,lm) = the(:,lm-1) + ( th(:,lm)-the(:,lm-1) ) * ( ple(:,lm)-ple(:,lm-1) )/( p(:,lm)-ple(:,lm-1) ) + endwhere do L=1,lm - do j=1,jm - if( j.gt.1 .and. j.lt.jm ) then - if( defined(stuff(j+1,L),undef) .and. - . defined(stuff(j-1,L),undef) ) then - ddcosp(j,L) = ( stuff(j+1,L)-stuff(j-1,L) )/(2*dp) - else - ddcosp(j,L) = undef - endif - else - ddcosp(j,L) = undef - endif - enddo + delp(:,L) = ple(:,L)-ple(:,L-1) enddo -c Compute Wstar -c ------------- + +c Compute D(Theta)/DZ (with a forced minimum to prevent dthdz => 0) +c ----------------------------------------------------------------- do L=1,lm do j=1,jm - if( defined(ddcosp(j,L),undef) ) then - wstar(j,Lm-L+1) = w(j,L) + ddcosp(j,L)/(a*cosp(j)) - else - wstar(j,Lm-L+1) = undef - endif + if( defined(the(j,L ),undef ) .and. + . defined(the(j,L-1),undef ) ) then + dthdp(j,L) = min( -0.003, ( the(j,L)-the(j,L-1) )/ delp(j,L) ) + else + dthdp(j,L) = undef + endif enddo enddo -c Compute D(rho*vpthp/dthdz)/DZ -c ----------------------------- +c Compute Vtlda based on D(rho*vpthp/dthdz)/DZ +c -------------------------------------------- do L=1,lm do j=1,jm if( defined(dthdp(j,L),undef) .and. @@ -451,61 +896,116 @@ subroutine residual ( v0,vpthp0,th0,w0,p0,jm,lm,res,vstar,wstar,undef ) do L=2,lm-1 do j=1,jm - delp = p(j,L+1)-p(j,L-1) if( defined(stuff(j,L+1),undef) .and. . defined(stuff(j,L-1),undef) ) then - res(j,L) = ( stuff(j,L+1)-stuff(j,L-1) )/ delp + vtlda(j,L) = p(j,L)/rho0(j,L) * ( stuff(j,L+1)-stuff(j,L-1) )/ ( 2*(ple(j,L)-ple(j,L-1)) ) else - res(j,L) = undef + vtlda(j,L) = undef endif enddo enddo do j=1,jm - res(j,1) = res(j,2) - res(j,lm) = res(j,lm-1) + vtlda(j,1) = vtlda(j,2) + vtlda(j,lm) = vtlda(j,lm-1) enddo c Compute Vstar c ------------- do L=1,lm do j=1,jm - if( defined( res(j,L),undef) .and. - . defined( v(j,L),undef) ) then - res(j,L) = v(j,L) - p(j,L)*res(j,L)/rho0(j,L) + if( defined( vtlda(j,L),undef) .and. + . defined( v(j,L),undef) ) then + vstar(j,L) = v(j,L) - vtlda(j,L) else - res(j,L) = undef + vstar(j,L) = undef endif - vstar(j,LM-L+1) = res(j,L) enddo enddo -c Construct Streamfunction for Vstar -c ---------------------------------- +c Construct Residual Streamfunction from Vstar +c -------------------------------------------- do k=1,lm - do j=1,jm - s(j,k) = 0.0 - enddo - + dum(:,1) = 0.0 do L=1,k do j=1,jm - delp = (p(j,L+1)-p(j,L-1))/2 - if(L.eq.1) delp = (p(j,L+1)-p(j,L) )/2 - if(L.eq.lm) delp = (p(j,L) -p(j,L-1))/2 - if( defined(res(j,L),undef) ) then - s(j,k) = s(j,k) + res(j,L)*delp*cosp(j)*rho0(j,L)*H/p(j,L) + if( defined(vstar(j,L),undef) ) then + dum(j,1) = dum(j,1) + vstar(j,L)*delp(j,L)*cosp(j)*rho0(j,L)*H/p(j,L) endif enddo enddo + res(:,k) = dum(:,1) enddo -c Invert Streamfunction for grads output (in order to be bottom=>top) -c ------------------------------------------------------------------- +c Invert Streamfunction and Vstar for grads output (in order to be bottom=>top) +c ----------------------------------------------------------------------------- do L=1,lm do j=1,jm - res(j,L) = s(j,LM-L+1) + dum(j,L) = res(j,LM-L+1) + enddo + enddo + do L=1,lm + do j=1,jm + res(j,L) = dum(j,L) enddo enddo + do L=1,lm + do j=1,jm + dum(j,L) = vstar(j,LM-L+1) + enddo + enddo + do L=1,lm + do j=1,jm + vstar(j,L) = dum(j,L) + enddo + enddo + +c Compute D(cos*vpthp/dthdz)/Dphi +c ------------------------------- + do L=1,lm + do j=1,jm + if( defined(vpthp(j,L),undef) .and. + . defined(dthdp(j,L),undef) .and. + . dthdp(j,L).ne.0.0 ) then + stuff(j,L) = -H*cosp(j)*vpthp(j,L)/(p(j,L)*dthdp(j,L)) + else + stuff(j,L) = undef + endif + enddo + enddo + + do L=1,lm + do j=1,jm + if( j.gt.1 .and. j.lt.jm ) then + if( defined(stuff(j+1,L),undef) .and. + . defined(stuff(j-1,L),undef) ) then + ddcosp(j,L) = ( stuff(j+1,L)-stuff(j-1,L) )/(2*dp) + else + ddcosp(j,L) = undef + endif + else + ddcosp(j,L) = undef + endif + enddo + enddo + +c Compute Wstar +c ------------- + do L=1,lm + do j=1,jm + if( defined(ddcosp(j,L),undef) ) then + wmean(j,Lm-L+1) = w(j,L) + weddy(j,Lm-L+1) = ddcosp(j,L)/(a*cosp(j)) + wstar(j,Lm-L+1) = w(j,L) + ddcosp(j,L)/(a*cosp(j)) + else + wstar(j,Lm-L+1) = undef + wmean(j,Lm-L+1) = undef + weddy(j,Lm-L+1) = undef + endif + enddo + enddo + + return end @@ -518,10 +1018,13 @@ subroutine make_w ( v0,p0,jm,lm,w,undef ) real p0(jm,lm), p(jm,lm) real w(jm,lm), rho0(jm,lm) real s(jm,lm), cosp(jm) + real dum(jm) real dvcos_dphi(jm,lm) + real ple(jm,0:lm) + real delp(jm, lm) logical defined real airmw,runiv,cpd,rgas,akap - real pi,dp,a,g,H,ps,ts,rhos,phi,z,delp,undef + real pi,dp,a,g,H,ps,ts,rhos,phi,z,undef PARAMETER ( AIRMW = MAPL_AIRMW ) PARAMETER ( RUNIV = MAPL_RUNIV ) @@ -569,29 +1072,31 @@ subroutine make_w ( v0,p0,jm,lm,w,undef ) enddo enddo +c Compute Edge Pressures and Thickness +c ------------------------------------ + ple(:,0) = max( 0.0, p(:,1) - 0.5*( p(:,2)-p(:,1) ) ) + do L=1,lm-1 + ple(:,L) = ( p(:,L)+ p(:,L+1) )*0.5 + enddo + ple(:,lm) = p(:,lm) + 0.5*( p(:,lm)-p(:,lm-1) ) + + do L=1,lm + delp(:,L) = ple(:,L)-ple(:,L-1) + enddo c Construct W from Continuity c --------------------------- do k=1,lm - do j=1,jm - s(j,k) = undef - enddo - + dum(:) = 0.0 do L=1,k do j=1,jm - delp = (p(j,L+1)-p(j,L-1))/2 - if(L.eq.1) delp = (p(j,L+1)-p(j,L) )/2 - if(L.eq.lm) delp = (p(j,L) -p(j,L-1))/2 phi = -pi/2+(j-1)*dp if( dvcos_dphi(j,L).ne.undef ) then - if( s(j,k).eq.undef ) s(j,k) = 0.0 - s(j,k) = s(j,k) + dvcos_dphi(j,L)*delp*rho0(j,L)*H/(p(j,L)*a*cosp(j)) + dum(j) = dum(j) + dvcos_dphi(j,L)*delp(j,L)*rho0(j,L)*H/(p(j,L)*a*cosp(j)) endif enddo enddo - do j=1,jm - if( s(j,k).ne.undef ) s(j,k) = s(j,k)/rho0(j,k) - enddo + s(:,k) = dum(:)/rho0(:,k) enddo c Invert Streamfunction for grads output (in order to be bottom=>top) @@ -605,340 +1110,260 @@ subroutine make_w ( v0,p0,jm,lm,w,undef ) return end - subroutine interp_h ( q_cmp,im,jm,lm, - . dlam,dphi,rotation,tilt,precession, - . q_geo,irun,lon_geo,lat_geo, - . undef ) -C*********************************************************************** -C -C PURPOSE: -C ======== -C Performs a horizontal interpolation from a field on a computational grid -C to arbitrary locations. -C -C INPUT: -C ====== -C q_cmp ...... Field q_cmp(im,jm,lm) on the computational grid -C im ......... Longitudinal dimension of q_cmp -C jm ......... Latitudinal dimension of q_cmp -C lm ......... Vertical dimension of q_cmp -C dlam ....... Computational Grid Delta Lambda -C dphi ....... Computational Grid Delta Phi -C rotation ... Rotation parameter lam_np (Degrees) -C tilt ....... Rotation parameter phi_np (Degrees) -C precession . Rotation parameter lam_0 (Degrees) -C irun ....... Number of Output Locations -C lon_geo .... Longitude Location of Output -C lat_geo .... Latitude Location of Output -C -C OUTPUT: -C ======= -C q_geo ...... Field q_geo(irun,lm) at arbitrary locations -C -C -C*********************************************************************** -C* GODDARD LABORATORY FOR ATMOSPHERES * -C*********************************************************************** + ! ************************************************************************************************************ + function defined ( q,undef ) implicit none + logical defined + real q,undef + defined = abs(q-undef).gt.0.1*undef + return + end function defined -c Input Variables -c --------------- - integer im,jm,lm,irun - - real q_geo(irun,lm) - real lon_geo(irun) - real lat_geo(irun) - - real q_cmp(im,jm,lm) - real dlam(im) - real dphi(jm) - -c Local Variables -c --------------- - integer i,j,l,m - integer, allocatable :: ip0(:), im1(:) - integer, allocatable :: jp0(:), jm1(:) - -c Bi-Linear Weights -c ----------------- - real, allocatable :: wl_ip0jp0 (:) - real, allocatable :: wl_im1jp0 (:) - real, allocatable :: wl_ip0jm1 (:) - real, allocatable :: wl_im1jm1 (:) - - real, allocatable :: old_lon (:) - real, allocatable :: old_lat (:) - real, allocatable :: old_dlam(:) - real, allocatable :: old_dphi(:) - - real lon_cmp(im) - real lat_cmp(jm) - real q_tmp(irun) - - real pi,cosnp,sinnp,p1,p2,p3,eps,d - real lam,lam_ip0,lam_im1 - real phi,phi_jp0,phi_jm1 - real dl,dp,lam_np,phi_np,lam_0,eps_np - real rotation , tilt , precession - real lam_geo, lam_cmp - real phi_geo, phi_cmp - real undef - integer im1_cmp,icmp - integer jm1_cmp,jcmp - - logical compute_weights - real old_rotation - real old_tilt - real old_precession - data old_rotation /-999.9/ - data old_tilt /-999.9/ - data old_precession /-999.9/ - - parameter ( eps = 1.e-10 ) - -c Initialization -c -------------- - pi = 4.*atan(1.) - dl = 2*pi/ im ! Uniform Grid Delta Lambda - dp = pi/(jm-1) ! Uniform Grid Delta Phi + ! ************************************************************************************************************ -c Allocate Memory for Weights and Index Locations -c ----------------------------------------------- - if(.not.allocated(old_lon)) then + subroutine compute_edge( q,p,pe,jm,lm,undef,qe ) + implicit none + integer j,L,jm,lm + real undef + logical defined + real q(jm, lm), p(jm, lm) + real qe(jm,0:lm), pe(jm,0:lm) - allocate ( old_dlam(im) , old_dphi(jm) ) - allocate ( old_lon(irun) , old_lat(irun) ) - allocate ( wl_ip0jp0(irun) , wl_im1jp0(irun) ) - allocate ( wl_ip0jm1(irun) , wl_im1jm1(irun) ) - allocate ( ip0(irun) , im1(irun) ) - allocate ( jp0(irun) , jm1(irun) ) - do i=1,irun - old_lon(i) = -999.9 - old_lat(i) = -999.9 - enddo - do i=1,im - old_dlam(i) = 0.0 - enddo + qe(:,0) = q(:,1) + do L=1,lm-1 do j=1,jm - old_dphi(j) = 0.0 - enddo - - else - i = size (old_dlam) - j = size (old_dphi) - m = size (old_lon) - if(i.ne.im .or. j.ne.jm .or. m.ne.irun) then - deallocate ( old_dlam , old_dphi ) - deallocate ( old_lon , old_lat ) - deallocate ( wl_ip0jp0 , wl_im1jp0 ) - deallocate ( wl_ip0jm1 , wl_im1jm1 ) - deallocate ( ip0 , im1 ) - deallocate ( jp0 , jm1 ) - allocate ( old_dlam(im) , old_dphi(jm) ) - allocate ( old_lon(irun) , old_lat(irun) ) - allocate ( wl_ip0jp0(irun) , wl_im1jp0(irun) ) - allocate ( wl_ip0jm1(irun) , wl_im1jm1(irun) ) - allocate ( ip0(irun) , im1(irun) ) - allocate ( jp0(irun) , jm1(irun) ) - do i=1,irun - old_lon(i) = -999.9 - old_lat(i) = -999.9 - enddo - do i=1,im - old_dlam(i) = 0.0 - enddo - do j=1,jm - old_dphi(j) = 0.0 - enddo - endif - endif + qe(j,L) = undef + if( defined( q(j,L ),undef) ) qe(j,L) = q(j,L) + if( defined( q(j,L+1),undef) ) qe(j,L) = q(j,L+1) + ! if( defined( q(j,L+1),undef) .and. defined( q(j,L),undef) ) qe(j,L) = ( q(j,L+1)+ q(j,L) )*0.5 + + ! Linear Interpolation to Pressure Edge + ! ------------------------------------- + if( defined( q(j,L+1),undef) .and. defined( q(j,L),undef) ) then + qe(j,L) = q(j,L) + ( q(j,L+1)-q(j,L) )*( log(pe(j,L)/p(j,L)) )/( log(p(j,L+1)/p(j,L)) ) + ! qe(j,L) = q(j,L) + ( q(j,L+1)-q(j,L) )*( pe(j,L) - p(j,L) )/( p(j,L+1)-p(j,L) ) + ! or qe(j,L) = q(j,L+1) - ( q(j,L+1)-q(j,L) )*( p(j,L+1)-pe(j,L) )/( p(j,L+1)-p(j,L) ) + endif -c Compute Input Computational-Grid Latitude and Longitude Locations -c ----------------------------------------------------------------- - lon_cmp(1) = -pi - do i=2,im - lon_cmp(i) = lon_cmp(i-1) + dlam(i-1) - enddo - lat_cmp(1) = -pi*0.5 - do j=2,jm-1 - lat_cmp(j) = lat_cmp(j-1) + dphi(j-1) enddo - lat_cmp(jm) = pi*0.5 - -c Check for Co-incident Grid-Point Latitude and Pole Locations -c ------------------------------------------------------------ - eps_np = 0.0 - do j=1,jm - phi_cmp = lat_cmp(j)*180./pi - if( abs( phi_cmp-tilt ).lt.1.e-3 ) eps_np = 1.e-3 - if( tilt+eps_np .gt. 90. ) eps_np = -1.e-3 enddo + qe(:,lm) = undef + where( abs( q(:,lm)-undef).gt.0.1 .and. abs( qe(:,lm-1)-undef).gt.0.1 ) + qe(:,lm) = qe(:,lm-1) + ( q(:,lm)- qe(:,lm-1) ) * ( log(pe(:,lm)/pe(:,lm-1)) )/( log(p(:,lm)/pe(:,lm-1)) ) + ! qe(:,lm) = qe(:,lm-1) + ( q(:,lm)- qe(:,lm-1) ) * ( pe(:,lm)-pe(:,lm-1) )/( p(:,lm)-pe(:,lm-1) ) + endwhere - lam_np = pi/180.*rotation - phi_np = pi/180.*(tilt+eps_np) - lam_0 = pi/180.*precession - - if( tilt.eq.90. ) then - cosnp = 0.0 - sinnp = 1.0 - else if(tilt.eq.-90.0) then - cosnp = 0.0 - sinnp =-1.0 - else - cosnp = cos(phi_np) - sinnp = sin(phi_np) - endif - -c Determine if Weights Need to be Updated -c --------------------------------------- - compute_weights = rotation.ne.old_rotation .or. - . tilt.ne.old_tilt .or. - . precession.ne.old_precession - - m = 1 - do while ( .not.compute_weights .and. m.le.irun ) - compute_weights = (lon_geo(m).ne.old_lon(m)) .or. - . (lat_geo(m).ne.old_lat(m)) - m = m+1 - enddo - i = 1 - do while ( .not.compute_weights .and. i.le.im ) - compute_weights = dlam(i).ne.old_dlam(i) - i = i+1 - enddo - j = 1 - do while ( .not.compute_weights .and. j.le.jm-1 ) - compute_weights = dphi(j).ne.old_dphi(j) - j = j+1 - enddo + return + end -c Compute Weights for Computational to Geophysical Grid Interpolation -c ------------------------------------------------------------------- - if( compute_weights ) then - - old_rotation = rotation - old_tilt = tilt - old_precession = precession - - do i=1,irun - old_lon(i) = lon_geo(i) - old_lat(i) = lat_geo(i) - lam_geo = lon_geo(i) - phi_geo = lat_geo(i) - - p1 = cosnp*cos(phi_geo)*cos(lam_geo+lam_0-pi) - . + sin(phi_geo)*sinnp - p1 = min(p1, 1.0) - p1 = max(p1,-1.0) - phi_cmp = asin( p1 ) - - if( tilt.eq.90.0 .or. tilt.eq.-90.0 ) then - p2 = sinnp*cos(lam_geo+lam_0-pi) - else - p2 = sinnp*cos(phi_geo)*cos(lam_geo+lam_0-pi) - . - sin(phi_geo)*cosnp - p2 = p2 / max( cos(phi_cmp),eps ) - p2 = min(p2, 1.0) - p2 = max(p2,-1.0) - endif - p2 = acos( p2 ) + ! ************************************************************************************************************ - p3 = cos(phi_geo)*sin(lam_geo+lam_0-pi) - if( p3.lt.0.0 ) p2 = -p2 - p2 = p2 + lam_np - pi - lam_cmp = mod( p2+3.0*pi,2.0*pi ) - pi + subroutine compute_dqdp( qe,dp,jm,lm,undef,dqdp ) + implicit none + integer j,L,jm,lm + real undef + logical defined + real dp(jm, lm) + real qe(jm,0:lm) + real dqdp(jm,lm) -c Determine Indexing Based on Computational Grid -c ---------------------------------------------- - im1_cmp = 1 - do icmp = 2,im - if( lon_cmp(icmp).lt.lam_cmp ) im1_cmp = icmp + do L=1,lm + do j=1,jm + if( defined(qe(j,L-1),undef) .and. defined(qe(j,L),undef) ) then + dqdp(j,L) = ( qe(j,L)-qe(j,L-1) )/ dp(j,L) + else + dqdp(j,L) = undef + endif enddo - jm1_cmp = 1 - do jcmp = 2,jm - if( lat_cmp(jcmp).lt.phi_cmp ) jm1_cmp = jcmp enddo - im1(i) = im1_cmp - ip0(i) = im1(i) + 1 - - jm1(i) = jm1_cmp - jp0(i) = jm1(i) + 1 - -c Fix Longitude Index Boundaries -c ------------------------------ - if(im1(i).eq.im) then - ip0(i) = 1 - endif - -c Compute Immediate Surrounding Coordinates -c ----------------------------------------- - lam = lam_cmp - phi = phi_cmp - -c Compute and Adjust Longitude Weights -c ------------------------------------ - lam_im1 = lon_cmp(im1(i)) - lam_ip0 = lon_cmp(ip0(i)) - - if( lam_im1.gt.lam_ip0 ) lam_ip0 = lam_ip0 + 2*pi - - -c Compute and Adjust Latitude Weights -c Note: Latitude Index Boundaries are Adjusted during Interpolation -c ------------------------------------------------------------------ - phi_jm1 = lat_cmp(jm1(i)) - phi_jp0 = lat_cmp(jp0(i)) - - if( jm1(i).eq.jm ) phi_jp0 = phi_jm1 + dphi(jm-1) - + return + end -c Linear Weights -c -------------- - d = (phi_jp0-phi_jm1) - wl_ip0jm1(i) = (phi_jp0-phi )/d - wl_ip0jp0(i) = (phi -phi_jm1)/d + ! ************************************************************************************************************ - enddo - endif + subroutine map1_cubic( km, pe1, q1, kn, pe2, q2, jm, Method, undef) + use MAPL_ConstantsMod + implicit none -c Interpolate Computational-Grid Quantities to Geophysical Grid Using Bi-Linear -c ----------------------------------------------------------------------------- - do L=1,lm - do i=1,irun + real, intent(in) :: undef + integer, intent(in) :: Method ! 0: Linear in P + ! 1: Linear in Log(P) + ! 2: Linear in P**kappa + integer, intent(in) :: jm ! Latitude dimension + integer, intent(in) :: km ! Original vertical dimension + integer, intent(in) :: kn ! Target vertical dimension + + real, intent(in) :: pe1(jm,km) ! pressure at mid-layers + ! in the original vertical coordinate + + real, intent(in) :: pe2(jm,kn) ! pressure at mid-layers + ! in the new vertical coordinate + + real, intent(in) :: q1(jm,km) ! Field input + real, intent(inout):: q2(jm,kn) ! Field output + +! !DESCRIPTION: +! +! Perform Cubic Interpolation in the vertical +! ------------------------------------------- +! pe1: pressure associated with q1 +! pe2: pressure associated with q2 +! +!----------------------------------------------------------------------- +! + real qx(jm,km) + real logpl1(jm,km) + real logpl2(jm,kn) + real dlogp1(jm,km) + real am2,am1,ap0,ap1,P,PLP1,PLP0,PLM1,PLM2,DLP0,DLM1,DLM2 + + integer j, k, LM2,LM1,LP0,LP1 + logical defined - if( q_cmp( ip0(i),jm1(i),L ).ne.undef .and. - . q_cmp( ip0(i),jp0(i),L ).ne.undef ) then + real airmw,runiv,cpd,rgas,akap + PARAMETER ( AIRMW = MAPL_AIRMW ) + PARAMETER ( RUNIV = MAPL_RUNIV ) + PARAMETER ( CPD = MAPL_CP ) + PARAMETER ( RGAS = RUNIV/AIRMW ) + PARAMETER ( AKAP = MAPL_KAPPA ) - q_tmp(i) = wl_ip0jm1(i) * q_cmp( ip0(i),jm1(i),L ) - . + wl_ip0jp0(i) * q_cmp( ip0(i),jp0(i),L ) +! Initialization +! -------------- + + select case (Method) + + ! Linear in P + ! ----------- + case(0) + do k=1,km + qx(:,k) = q1(:,k) + logpl1(:,k) = pe1(:,k) + enddo + do k=1,kn + logpl2(:,k) = pe2(:,k) + enddo + + do k=1,km-1 + dlogp1(:,k) = logpl1(:,k+1)-logpl1(:,k) + enddo + + ! Linear in Log(P) + ! ---------------- + case(1) + do k=1,km + qx(:,k) = q1(:,k) + logpl1(:,k) = log( pe1(:,k) ) + enddo + do k=1,kn + logpl2(:,k) = log( pe2(:,k) ) + enddo + + do k=1,km-1 + dlogp1(:,k) = logpl1(:,k+1)-logpl1(:,k) + enddo + + ! Linear in P**kappa + ! ------------------ + case(2) + do k=1,km + qx(:,k) = q1(:,k) + logpl1(:,k) = exp( akap*log( pe1(:,k) )) + enddo + do k=1,kn + logpl2(:,k) = exp( akap*log( pe2(:,k) )) + enddo + + do k=1,km-1 + dlogp1(:,k) = logpl1(:,k+1)-logpl1(:,k) + enddo + + end select + +! Interpolate Q1 onto target Pressures +! ------------------------------------ + do j=1,jm + do k=1,kn + LM1 = 1 + LP0 = 1 + do while( LP0.le.km ) + if (logpl1(j,LP0).lt.logpl2(j,k)) then + LP0 = LP0+1 + else + exit + endif + enddo + LM1 = max(LP0-1,1) + LP0 = min(LP0, km) + +! Extrapolate Linearly above first model level +! -------------------------------------------- + if( LM1.eq.1 .and. LP0.eq.1 ) then + q2(j,k) = qx(j,1) + if( defined(qx(j,2),undef) ) q2(j,k) = qx(j,2) + if( defined(qx(j,1),undef) .and. defined(qx(j,2),undef) ) then + q2(j,k) = qx(j,1) + ( qx(j,2)-qx(j,1) )*( logpl2(j,k)-logpl1(j,1) ) + . /( logpl1(j,2)-logpl1(j,1) ) + endif + +! Extrapolate Linearly below last model level +! ------------------------------------------- + else if( LM1.eq.km .and. LP0.eq.km ) then + q2(j,k) = qx(j,km) + if( defined(qx(j,km-1),undef) ) q2(j,k) = qx(j,km-1) + if( defined(qx(j,km-1),undef) .and. defined(qx(j,km),undef) ) then + q2(j,k) = qx(j,km) + ( qx(j,km)-qx(j,km-1) )*( logpl2(j,k )-logpl1(j,km ) ) + . /( logpl1(j,km)-logpl1(j,km-1) ) + endif + +! Interpolate Linearly between levels 1 => 2 and km-1 => km +! --------------------------------------------------------- + else if( LM1.eq.1 .or. LP0.eq.km ) then + q2(j,k) = qx(j,LP0) + if( defined(qx(j,LM1),undef) ) q2(j,k) = qx(j,LM1) + if( defined(qx(j,LP0),undef) .and. defined(qx(j,LM1),undef) ) then + q2(j,k) = qx(j,LP0) + ( qx(j,LM1)-qx(j,LP0) )*( logpl2(j,k )-logpl1(j,LP0) ) + . /( logpl1(j,LM1)-logpl1(j,LP0) ) + endif + +! Interpolate Cubicly between other model levels +! ---------------------------------------------- + else + LP1 = LP0+1 + LM2 = LM1-1 + P = logpl2(j,k) + PLP1 = logpl1(j,LP1) + PLP0 = logpl1(j,LP0) + PLM1 = logpl1(j,LM1) + PLM2 = logpl1(j,LM2) + DLP0 = dlogp1(j,LP0) + DLM1 = dlogp1(j,LM1) + DLM2 = dlogp1(j,LM2) + + ap1 = (P-PLP0)*(P-PLM1)*(P-PLM2)/( DLP0*(DLP0+DLM1)*(DLP0+DLM1+DLM2) ) + ap0 = (PLP1-P)*(P-PLM1)*(P-PLM2)/( DLP0* DLM1 *( DLM1+DLM2) ) + am1 = (PLP1-P)*(PLP0-P)*(P-PLM2)/( DLM1* DLM2 *(DLP0+DLM1 ) ) + am2 = (PLP1-P)*(PLP0-P)*(PLM1-P)/( DLM2*(DLM1+DLM2)*(DLP0+DLM1+DLM2) ) + + if( defined(qx(j,LP1),undef) .and. + . defined(qx(j,LP0),undef) .and. + . defined(qx(j,LM1),undef) .and. + . defined(qx(j,LM2),undef) ) then + q2(j,k) = ap1*qx(j,LP1) + ap0*qx(j,LP0) + am1*qx(j,LM1) + am2*qx(j,LM2) + + else if( defined(qx(j,LP0),undef) .and. defined(qx(j,LM1),undef) ) then + q2(j,k) = qx(j,LP0) + ( qx(j,LM1)-qx(j,LP0) )*( logpl2(j,k )-logpl1(j,LP0) ) + . /( logpl1(j,LM1)-logpl1(j,LP0) ) + + else + q2(j,k) = undef + endif - else - q_tmp(i) = undef - endif - enddo + endif -c Load Temp array into Output array -c --------------------------------- - do i=1,irun - q_geo(i,L) = q_tmp(i) enddo enddo - deallocate ( old_dlam , old_dphi ) - deallocate ( old_lon , old_lat ) - deallocate ( wl_ip0jp0 , wl_im1jp0 ) - deallocate ( wl_ip0jm1 , wl_im1jm1 ) - deallocate ( ip0 , im1 ) - deallocate ( jp0 , jm1 ) - return - end - function defined ( q,undef ) - implicit none - logical defined - real q,undef - defined = abs(q-undef).gt.0.1*undef - return - end function defined + end subroutine map1_cubic diff --git a/GEOS_Util/post/3CH.F90 b/GEOS_Util/post/3CH.F90 new file mode 100644 index 00000000..f16f66f1 --- /dev/null +++ b/GEOS_Util/post/3CH.F90 @@ -0,0 +1,2612 @@ + module ThreeCornerHat_mod + use dynamics_lattice_module + implicit none + + type triplet_member + character*256 :: expid + integer :: nfiles + integer :: ndates + character*256, allocatable :: fnames(:) + integer :: im,jm,lm + real :: undef + real :: dlon + real :: dlat + integer, allocatable :: dates(:,:) + real, allocatable :: levs(:) + real, allocatable :: q(:,:,:,:,:) ! LON x LAT x LEV x DATE x Field + endtype triplet_member + + end module ThreeCornerHat_mod + +! ------------------------------------------------------------------------------- + + program Main + use dynamics_lattice_module + use ThreeCornerHat_mod + use iso_fortran_env, only: REAL64 + implicit none + + type ( dynamics_lattice_type ) lattice + +#ifdef mpi + include 'mpif.h' +#endif + + integer comm,myid,npes,ierror + integer imglobal + integer jmglobal + integer npex,npey + logical root + + type(triplet_member), target, allocatable :: experiment(:) + type(triplet_member), allocatable :: dummyexp(:) + integer nargs, nexps, m,n,k + integer nfiles, nexp + integer nfield + integer nfields + integer nymdb, nhmsb + integer nymde, nhmse + integer ndate + integer ndates + integer ndt + + real(REAL64), allocatable :: mse12(:,:,:) ! Mean Square Error between Fixed Corners 1 & 2 + real(REAL64), allocatable :: var12(:,:,:) ! Variance between Fixed Corners 1 & 2 + real(REAL64), allocatable :: cov12(:,:,:) ! CoVariance between Fixed Corners 1 & 2 + real(REAL64), allocatable :: rho12(:,:,:) ! Corr. Coeff. between Fixed Corners 1 & 2 + + real(REAL64), allocatable :: msec1(:,:,:,:) ! Mean Square Error between Corner 1 and Corner 3 + real(REAL64), allocatable :: msec2(:,:,:,:) ! Mean Square Error between Corner 2 and Corner 3 + real(REAL64), allocatable :: varc1(:,:,:,:) ! Variance between Corner 1 and Corner 3 + real(REAL64), allocatable :: varc2(:,:,:,:) ! Variance between Corner 2 and Corner 3 + real(REAL64), allocatable :: covc1(:,:,:,:) ! CoVariance between Corner 1 and Corner 3 + real(REAL64), allocatable :: covc2(:,:,:,:) ! CoVariance between Corner 2 and Corner 3 + real(REAL64), allocatable :: rhoc1(:,:,:,:) ! Corr. Coeff. between Corner 1 and Corner 3 + real(REAL64), allocatable :: rhoc2(:,:,:,:) ! Corr. Coeff. between Corner 2 and Corner 3 + + real(REAL64), allocatable :: mse12A(:,:,:) ! Amplitude Mean Square Error between Fixed Corners 1 & 2 + real(REAL64), allocatable :: mse12B(:,:,:) ! Bias Mean Square Error between Fixed Corners 1 & 2 + real(REAL64), allocatable :: mse12P(:,:,:) ! Phase Mean Square Error between Fixed Corners 1 & 2 + + real(REAL64), allocatable :: msec1A(:,:,:,:) ! Amplitude Mean Square Error between Corner 1 and Corner 3 + real(REAL64), allocatable :: msec2A(:,:,:,:) ! Amplitude Mean Square Error between Corner 2 and Corner 3 + real(REAL64), allocatable :: msec1B(:,:,:,:) ! Bias Mean Square Error between Corner 1 and Corner 3 + real(REAL64), allocatable :: msec2B(:,:,:,:) ! Bias Mean Square Error between Corner 2 and Corner 3 + real(REAL64), allocatable :: msec1P(:,:,:,:) ! Phase Mean Square Error between Corner 1 and Corner 3 + real(REAL64), allocatable :: msec2P(:,:,:,:) ! Phase Mean Square Error between Corner 2 and Corner 3 + + real(REAL64), allocatable :: varec1(:,:,:,:) ! 3CH Corner-1 Variance Error Estimates + real(REAL64), allocatable :: varec2(:,:,:,:) ! 3CH Corner-2 Variance Error Estimates + real(REAL64), allocatable :: varec3(:,:,:,:) ! 3CH Corner-3 Variance Error Estimates + + real(REAL64), allocatable :: var(:,:,:,:) ! Variance Variables + real(REAL64), allocatable :: q(:,:,:,:) ! Time-Mean Variables + integer, allocatable :: cc(:,:,:,:) ! Time-Mean Counters + + character*256, allocatable :: arg(:) + character*256 :: dummy + character*256 :: tag + character*256, allocatable :: field(:) + character*1 :: carg(256) + character*4 :: darg + character*1 :: char1 + character*4 :: charim + character*4 :: charjm + character*3 :: charlm + character*8 :: charbegdate + character*2 :: charbeghour + character*8 :: charenddate + character*2 :: charendhour + equivalence ( dummy, carg ) + equivalence ( dummy, darg ) + + integer im,jm,nlev + integer nvars + integer imax, jmax + integer method + + real, pointer :: zlev (:) + + integer i,j,kk,L,nymd,nhms + + real undef + logical defined + logical valid + + integer year, month + + character*20 char + character*256 desc(5000) + character*20 name(5000) + character*3 months(12) + data months /'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC'/ + +! ********************************************************************** +! **** Interfaces **** +! ********************************************************************** + + interface + subroutine init_levs( experiment,num,nlev,lev ) + use ThreeCornerHat_mod + implicit none + integer num, nlev + type(triplet_member) :: experiment(num) + real, pointer :: lev(:) + end subroutine init_levs + end interface + +! ********************************************************************** +! **** Usage **** +! ********************************************************************** + + nargs = command_argument_count() + if( nargs.eq.0 ) call usage() + +! ********************************************************************** +! **** MPI Initialization **** +! ********************************************************************** + +#ifdef mpi + call mpi_init ( ierror ) ; comm = mpi_comm_world + call mpi_comm_rank ( comm,myid,ierror ) + call mpi_comm_size ( comm,npes,ierror ) + npex = nint ( sqrt( float(npes) ) ) + npey = npex + do while ( npex*npey .ne. npes ) + npex = npex-1 + npey = nint ( float(npes)/float(npex) ) + enddo +#else + comm = 0 + npes = 1 + npex = 1 + npey = 1 + myid = 0 + ierror = 0 +#endif + root = myid.eq.0 + call create_dynamics_lattice ( lattice,npex,npey ) + call init_dynamics_lattice ( lattice,comm,1,1,1 ) + +! ********************************************************************** +! **** Input 3CH Experiment Files and Parameters **** +! ********************************************************************** + + nlev = -999 + imax = -999 + jmax = -999 + ndt = 21600 + nymdb = -999 + nymde = -999 + nhmsb = -999 + nhmse = -999 + method = 1 + tag = 'NULL' + + nfields = 6 + allocate( field(nfields) ) + field(1) = 'u' + field(2) = 'v' + field(3) = 't' + field(4) = 'q' + field(5) = 'h' + field(6) = 'p' + + allocate ( arg(nargs) ) + do n=1,nargs + call get_command_argument(n,arg(n)) + enddo + + nexps = 0 + do n=1,nargs + dummy = trim( arg(n) ) + + if( darg.eq.'-exp' ) then + if( nexps .eq. 0 ) then + nexps = nexps + 1 + allocate( experiment(nexps) ) + else + allocate( dummyexp(nexps) ) + dummyexp = experiment + deallocate( experiment ) + nexps = nexps + 1 + allocate( experiment(nexps) ) + experiment(1:nexps-1) = dummyexp + deallocate( dummyexp ) + endif + read( carg(5:6),* ) nexp + if( nexp.ne.nexps ) then + print *, 'You must enter experiments in order!' + stop + endif + + k = n+1 + experiment(nexps)%expid = arg(k) + + nfiles = 1 + read(arg(k+nfiles),fmt='(a1)') char1 + do while (char1.ne.'-' .and. n+nfiles.ne.nargs ) + nfiles = nfiles+1 + read(arg(k+nfiles),fmt='(a1)') char1 + enddo + if( char1.eq.'-' ) nfiles = nfiles-1 + + experiment(nexps)%nfiles = nfiles + allocate ( experiment(nexps)%fnames(nfiles) ) + + if(root) print *, 'EXP: ',nexps + do m=1,nfiles + experiment(nexps)%fnames(m) = arg(k+m) + if(root) write(*,'(" FILES: ",a)' ) trim(experiment(nexps)%fnames(m)) + enddo + if(root) print * + endif + + if( trim(arg(n)).eq.'-levs' ) then + nlev = 1 + read(arg(n+nlev),fmt='(a1)') char1 + do while (char1.ne.'-' .and. n+nlev.ne.nargs ) + nlev = nlev+1 + read(arg(n+nlev),fmt='(a1)') char1 + enddo + if( char1.eq.'-' ) nlev = nlev-1 + allocate ( zlev(nlev) ) + do m=1,nlev + read(arg(n+m),*) zlev(m) + enddo + endif + + if( trim(arg(n)).eq.'-im' ) read(arg(n+1),*) imax + if( trim(arg(n)).eq.'-jm' ) read(arg(n+1),*) jmax + if( trim(arg(n)).eq.'-nymdb' ) read(arg(n+1),*) nymdb + if( trim(arg(n)).eq.'-nymde' ) read(arg(n+1),*) nymde + if( trim(arg(n)).eq.'-nhmsb' ) read(arg(n+1),*) nhmsb + if( trim(arg(n)).eq.'-nhmse' ) read(arg(n+1),*) nhmse + if( trim(arg(n)).eq.'-ndt' ) read(arg(n+1),*) ndt + if( trim(arg(n)).eq.'-tag' ) read(arg(n+1),*) tag + if( trim(arg(n)).eq.'-method' ) read(arg(n+1),*) method + + if( trim(arg(n)).eq.'-fields' ) then + nfields = 1 + read(arg(n+nfields),fmt='(a1)') char1 + do while (char1.ne.'-' .and. n+nfields.ne.nargs ) + nfields = nfields+1 + read(arg(n+nfields),fmt='(a1)') char1 + enddo + if( char1.eq.'-' ) nfields = nfields-1 + deallocate ( field ) + allocate ( field(nfields) ) + do m=1,nfields + read(arg(n+m),*) field(m) + enddo + endif + + enddo ! End NARGS Do-Loop + + if( nymdb.eq.-999 .or. nymde.eq.-999 .or. & + nhmsb.eq.-999 .or. nhmse.eq.-999 ) then + if(root) print *, 'You must supply the beginning and ending date and time' + call my_finalize + stop + endif + + if( ( method.ne.1 ) .and. & + ( method.ne.2 ) .and. & + ( method.ne.3 ) ) then + if(root) print *, 'You must supply the method for horizontal interpolation' + call my_finalize + stop + endif + +! ********************************************************************** +! **** Initialize Dates Associated with Each Experiment **** +! ********************************************************************** + + call timebeg('main ') + imglobal = 0 + jmglobal = 0 + if(root) then + print * + print *, '3CH Triplet Calculations' + print *, '------------------------' + endif + call timebeg('init_triplet') + do n=1,nexps + call init_triplet( experiment(n),lattice ) + if( (imglobal*jmglobal.eq.0 ) .or. (experiment(n)%im*experiment(n)%jm.lt.imglobal*jmglobal) ) then + imglobal = experiment(n)%im + jmglobal = experiment(n)%jm + endif + if(root) then + write(*, '(" Initializing Dates for Experiment #: ",i2,3x,"Native Resolution: (",i4,",",i4,",",i3,") EXPID: ",a)' & + ) n,experiment(n)%im,experiment(n)%jm,experiment(n)%lm,trim(experiment(n)%expid) + endif + enddo + call timeend('init_triplet') + if(root) print * + + if( imax.ne.-999 ) imglobal = imax + if( jmax.ne.-999 ) jmglobal = jmax + +! Levels Initialization +! --------------------- + if( nlev.eq.-999 ) then + call timebeg('init_levs ') + call init_levs( experiment,nexps,nlev,zlev ) + call timeend('init_levs ') + endif + if( root ) then + write(*,'(" Output RLSV: (",i4,",",i4,",",i3,")")') imglobal,jmglobal,nlev + print * + print *, 'Verifying Levels:' + print *, '----------------' + write(6,*) (zlev(n),n=1,nlev) + print * + write(charim,'(i4.4)') imglobal + write(charjm,'(i4.4)') jmglobal + write(charlm,'(i3.3)') nlev + write(charbegdate,'(i8.8)') nymdb + write(charbeghour,'(i2.2)') nhmsb/10000 + write(charenddate,'(i8.8)') nymde + write(charendhour,'(i2.2)') nhmse/10000 + endif + +! ********************************************************************** +! **** Create Lattice and Experiments **** +! ********************************************************************** + + if( root ) write(*,'(" Creating ",i4," x ",i4," lattice ...")' ) imglobal,jmglobal + call destroy_dynamics_lattice ( lattice ) + call create_dynamics_lattice ( lattice,npex,npey ) + call init_dynamics_lattice ( lattice,comm,imglobal,jmglobal,1 ) + if( root ) print * + + im = lattice%im( lattice%pei ) + jm = lattice%jm( lattice%pej ) + + nymd = nymdb + nhms = nhmsb + ndates = 0 + do while( (nymd.lt.nymde) .or. (nymd.eq.nymde .and. nhms.le.nhmse) ) + ndates = ndates + 1 + call tick( nymd,nhms,ndt ) + enddo + + do n=1,nexps + allocate( experiment(n)%q(im,jm,nlev,ndates,nfields) ) + enddo + +! ********************************************************************** +! **** Loop over Times **** +! ********************************************************************** + + undef = 1.0e15 + nymd = nymdb + nhms = nhmsb + ndate = 0 + + call timebeg('read triplet') + do while( (nymd.lt.nymde) .or. (nymd.eq.nymde .and. nhms.le.nhmse) ) + if( root ) write(*,'(" Reading Triplets for: ",i8.8,1x,i6.6)' ) nymd,nhms + ndate = ndate + 1 + + do k=1,nexps + call read_triplet( experiment(k),nymd,nhms,nlev,zlev,ndate,k,field,nfields,undef,lattice,method ) + enddo + call tick( nymd,nhms,ndt ) + + if( root ) print * + enddo + call timeend('read triplet') + if( root ) print * + +! ********************************************************************** +! **** We have everything we need **** +! ********************************************************************** + + allocate( var(im,jm,nlev,nexps) ) + allocate( q(im,jm,nlev,nexps) ) + allocate( cc(im,jm,nlev,nexps) ) + + allocate( mse12(im,jm,nlev) ) + allocate( var12(im,jm,nlev) ) + allocate( cov12(im,jm,nlev) ) + allocate( rho12(im,jm,nlev) ) + + allocate( msec1(im,jm,nlev,nexps-2) ) + allocate( msec2(im,jm,nlev,nexps-2) ) + allocate( varc1(im,jm,nlev,nexps-2) ) + allocate( varc2(im,jm,nlev,nexps-2) ) + allocate( covc1(im,jm,nlev,nexps-2) ) + allocate( covc2(im,jm,nlev,nexps-2) ) + allocate( rhoc1(im,jm,nlev,nexps-2) ) + allocate( rhoc2(im,jm,nlev,nexps-2) ) + + allocate( mse12A(im,jm,nlev) ) + allocate( mse12B(im,jm,nlev) ) + allocate( mse12P(im,jm,nlev) ) + + allocate( msec1A(im,jm,nlev,nexps-2) ) + allocate( msec2A(im,jm,nlev,nexps-2) ) + allocate( msec1B(im,jm,nlev,nexps-2) ) + allocate( msec2B(im,jm,nlev,nexps-2) ) + allocate( msec1P(im,jm,nlev,nexps-2) ) + allocate( msec2P(im,jm,nlev,nexps-2) ) + + allocate( varec1(im,jm,nlev,nexps-2) ) + allocate( varec2(im,jm,nlev,nexps-2) ) + allocate( varec3(im,jm,nlev,nexps-2) ) + +! ********************************************************************** +! **** Open Grads Dataset and Loop over Fields **** +! ********************************************************************** + +! Open Grads File +! --------------- + if( root ) then + write(*,'(" Writing Data")' ) + if( trim(tag).ne.'NULL' ) then + open (51,file=trim(tag) // '.data',form='unformatted',access='sequential') + else + if( method.eq.1 ) tag = 'BL.' // trim( experiment(1)%expid ) + if( method.eq.2 ) tag = 'BC.' // trim( experiment(1)%expid ) + if( method.eq.3 ) tag = 'BA.' // trim( experiment(1)%expid ) + do n=2,nexps + tag = trim(tag) // '.' // trim( experiment(n)%expid ) + enddo + tag = '3CH_' // charim // 'x' // charjm // '_L' // charlm // '_' // charbegdate // '_' // charbeghour // 'z_' & + // charenddate // '_' // charendhour // 'z_' // trim(tag) + open (51,file=trim(tag)//'.data',form='unformatted',access='sequential') + endif + endif + + ! Initialize Number of Grads Variables + ! ------------------------------------ + nvars = 0 + + do nfield = 1,nfields + + q = 0.0 + cc = 0 + +! ********************************************************************** +! **** Compute Time Averages for each Field in each Experiment **** +! ********************************************************************** + + ! Compute Time Averages + ! --------------------- + if( root ) write(*,'(/," Computing Time Averages for Variable: ",a)' ) trim(field(nfield)) + call timebeg('time mean variables') + nymd = nymdb + nhms = nhmsb + n = 0 + do while( (nymd.lt.nymde) .or. (nymd.eq.nymde .and. nhms.le.nhmse) ) + n = n + 1 + + do k=1,nexps + do L=1,nlev + do j=1,jm + do i=1,im + valid = .true. + do kk=1,nexps + valid = valid .and. defined( experiment(kk)%q(i,j,L,n,nfield),undef ) + enddo + if( valid ) then + q(i,j,L,k) = q(i,j,L,k) + experiment(k)%q(i,j,L,n,nfield) + cc(i,j,L,k) = cc(i,j,L,k) + 1 + endif + enddo + enddo + enddo + enddo + + call tick( nymd,nhms,ndt ) + enddo + + do k=1,nexps + do L=1,nlev + do j=1,jm + do i=1,im + if( cc(i,j,L,k).ne.0 ) then + q(i,j,L,k) = q(i,j,L,k) / cc(i,j,L,k) + else + q(i,j,L,k) = undef + endif + enddo + enddo + enddo + enddo + call timeend('time mean variables') + + ! Compute Variances + ! ----------------- + var = 0.0 + cc = 0 + + if( root ) write(*,'(" Computing Variance for Variable: ",a)' ) trim(field(nfield)) + call timebeg('variance variables') + nymd = nymdb + nhms = nhmsb + n = 0 + do while( (nymd.lt.nymde) .or. (nymd.eq.nymde .and. nhms.le.nhmse) ) + n = n + 1 + + do k=1,nexps + do L=1,nlev + do j=1,jm + do i=1,im + valid = .true. + do kk=1,nexps + valid = valid .and. defined( experiment(kk)%q(i,j,L,n,nfield),undef ) + enddo + if( valid ) then + var(i,j,L,k) = var(i,j,L,k) + ( experiment(k)%q(i,j,L,n,nfield) - q(i,j,L,k) )**2 + cc(i,j,L,k) = cc(i,j,L,k) + 1 + endif + enddo + enddo + enddo + enddo + + call tick( nymd,nhms,ndt ) + enddo + + do k=1,nexps + do L=1,nlev + do j=1,jm + do i=1,im + if( cc(i,j,L,k).ne.0 ) then + var(i,j,L,k) = var(i,j,L,k) / cc(i,j,L,k) + else + var(i,j,L,k) = undef + endif + enddo + enddo + enddo + enddo + call timeend('variance variables') + +! ******************************************************************************** +! **** Compute Mean Square Error and Variance between Fixed Corners **** +! ******************************************************************************** + + ! Compute Mean Square Error: MSE(X-Y) = 1/N SUM[ X-Y ]^2 + ! ------------------------------------------------------- + if( root ) write(*,'(" Computing Mean Square Error between Corners for: ",a)' ) trim(field(nfield)) + call timebeg('X-Y variances') + mse12 = 0.0 + cov12 = 0.0 + cc = 0.0 + + nymd = nymdb + nhms = nhmsb + n = 0 + do while( (nymd.lt.nymde) .or. (nymd.eq.nymde .and. nhms.le.nhmse) ) + n = n + 1 + do L=1,nlev + do j=1,jm + do i=1,im + valid = .true. + do kk=1,nexps + valid = valid .and. defined( experiment(kk)%q(i,j,L,n,nfield),undef ) + enddo + if( valid ) then + mse12(i,j,L) = mse12(i,j,L) + ( experiment(1)%q(i,j,L,n,nfield) - experiment(2)%q(i,j,L,n,nfield) )**2 + cov12(i,j,L) = cov12(i,j,L) + ( experiment(1)%q(i,j,L,n,nfield) - q(i,j,L,1) ) & + * ( experiment(2)%q(i,j,L,n,nfield) - q(i,j,L,2) ) + cc(i,j,L,3) = cc(i,j,L,3) + 1 + endif + enddo + enddo + enddo + call tick( nymd,nhms,ndt ) + enddo + + ! Compute Variance between Fixed Corners: SIG^2( X-Y ) = MSE( X-Y ) - (Xave-Yave)^2 + ! ---------------------------------------------------------------------------------- + do L=1,nlev + do j=1,jm + do i=1,im + if( cc(i,j,L,3).ne.0 ) then + mse12(i,j,L) = mse12(i,j,L) / cc(i,j,L,3) + cov12(i,j,L) = cov12(i,j,L) / cc(i,j,L,3) + var12(i,j,L) = mse12(i,j,L) - ( q(i,j,L,1)-q(i,j,L,2) )**2 + if( ( var(i,j,L,1).eq.0 .or. var(i,j,L,2).eq.0 ) .and. cov12(i,j,L).eq.0 ) then + rho12(i,j,L) = 1 + else + rho12(i,j,L) = cov12(i,j,L) / sqrt( var(i,j,L,1) ) / sqrt( var(i,j,L,2) ) + endif + + mse12B(i,j,L) = ( q(i,j,L,1)-q(i,j,L,2) )**2 + mse12A(i,j,L) = ( sqrt( var(i,j,L,1) ) - sqrt( var(i,j,L,2) ) )**2 + mse12P(i,j,L) = 2 * ( 1-rho12(i,j,L) )*( sqrt( var(i,j,L,1) ) * sqrt( var(i,j,L,2) ) ) + else + mse12(i,j,L) = undef + cov12(i,j,L) = undef + var12(i,j,L) = undef + rho12(i,j,L) = undef + + mse12B(i,j,L) = undef + mse12A(i,j,L) = undef + mse12P(i,j,L) = undef + endif + enddo + enddo + enddo + +! ------------------------------------------------------------------------------------------- + + do m=1,nexps-2 + k=m+2 + msec1(:,:,:,m) = 0.0 + msec2(:,:,:,m) = 0.0 + covc1(:,:,:,m) = 0.0 + covc2(:,:,:,m) = 0.0 + + cc = 0.0 + nymd = nymdb + nhms = nhmsb + n = 0 + do while( (nymd.lt.nymde) .or. (nymd.eq.nymde .and. nhms.le.nhmse) ) + n = n + 1 + do L=1,nlev + do j=1,jm + do i=1,im + valid = .true. + do kk=1,nexps + valid = valid .and. defined( experiment(kk)%q(i,j,L,n,nfield),undef ) + enddo + if( valid ) then + msec1(i,j,L,m) = msec1(i,j,L,m) + ( experiment(1)%q(i,j,L,n,nfield) - experiment(k)%q(i,j,L,n,nfield) )**2 + covc1(i,j,L,m) = covc1(i,j,L,m) + ( experiment(1)%q(i,j,L,n,nfield) - q(i,j,L,1) )*( experiment(k)%q(i,j,L,n,nfield) - q(i,j,L,k) ) + cc(i,j,L,2) = cc(i,j,L,2) + 1 + + msec2(i,j,L,m) = msec2(i,j,L,m) + ( experiment(2)%q(i,j,L,n,nfield) - experiment(k)%q(i,j,L,n,nfield) )**2 + covc2(i,j,L,m) = covc2(i,j,L,m) + ( experiment(2)%q(i,j,L,n,nfield) - q(i,j,L,2) )*( experiment(k)%q(i,j,L,n,nfield) - q(i,j,L,k) ) + cc(i,j,L,1) = cc(i,j,L,1) + 1 + endif + enddo + enddo + enddo + call tick( nymd,nhms,ndt ) + enddo + + do L=1,nlev + do j=1,jm + do i=1,im + if( cc(i,j,L,2).ne.0 ) then + msec1(i,j,L,m) = msec1(i,j,L,m) / cc(i,j,L,2) + covc1(i,j,L,m) = covc1(i,j,L,m) / cc(i,j,L,2) + varc1(i,j,L,m) = msec1(i,j,L,m) - ( q(i,j,L,1)-q(i,j,L,k) )**2 + if( ( var(i,j,L,1).eq.0 .or. var(i,j,L,k).eq.0 ) .and. covc1(i,j,L,m).eq.0 ) then + rhoc1(i,j,L,m) = 1 + else + rhoc1(i,j,L,m) = covc1(i,j,L,m) / sqrt( var(i,j,L,1) ) / sqrt( var(i,j,L,k) ) + endif + + msec1B(i,j,L,m) = ( q(i,j,L,1)-q(i,j,L,k) )**2 + msec1A(i,j,L,m) = ( sqrt( var(i,j,L,1) ) - sqrt( var(i,j,L,k) ) )**2 + msec1P(i,j,L,m) = 2 * ( 1-rhoc1(i,j,L,m) )*( sqrt( var(i,j,L,1) ) * sqrt( var(i,j,L,k) ) ) + else + msec1(i,j,L,m) = undef + covc1(i,j,L,m) = undef + varc1(i,j,L,m) = undef + rhoc1(i,j,L,m) = undef + + msec1B(i,j,L,m) = undef + msec1A(i,j,L,m) = undef + msec1P(i,j,L,m) = undef + endif + + if( cc(i,j,L,1).ne.0 ) then + msec2(i,j,L,m) = msec2(i,j,L,m) / cc(i,j,L,1) + covc2(i,j,L,m) = covc2(i,j,L,m) / cc(i,j,L,1) + varc2(i,j,L,m) = msec2(i,j,L,m) - ( q(i,j,L,2)-q(i,j,L,k) )**2 + if( ( var(i,j,L,2).eq.0 .or. var(i,j,L,k).eq.0 ) .and. covc2(i,j,L,m).eq.0 ) then + rhoc2(i,j,L,m) = 1 + else + rhoc2(i,j,L,m) = covc2(i,j,L,m) / sqrt( var(i,j,L,2) ) / sqrt( var(i,j,L,k) ) + endif + + msec2B(i,j,L,m) = ( q(i,j,L,2)-q(i,j,L,k) )**2 + msec2A(i,j,L,m) = ( sqrt( var(i,j,L,2) ) - sqrt( var(i,j,L,k) ) )**2 + msec2P(i,j,L,m) = 2 * ( 1-rhoc2(i,j,L,m) )*( sqrt( var(i,j,L,2) ) * sqrt( var(i,j,L,k) ) ) + else + msec2(i,j,L,m) = undef + covc2(i,j,L,m) = undef + varc2(i,j,L,m) = undef + rhoc2(i,j,L,m) = undef + + msec2B(i,j,L,m) = undef + msec2A(i,j,L,m) = undef + msec2P(i,j,L,m) = undef + endif + enddo + enddo + enddo + enddo + call timeend('X-Y variances') + +! ------------------------------------------------------------------------------------------- + + ! Compute Initial 3CH Error Variances Estimates + ! --------------------------------------------- + if( root ) write(*,'(" Computing Initial 3CH Variance Error Estimates for Variable: ",a)' ) trim(field(nfield)) + call timebeg('err estimate') + do n=1,nexps-2 + + do L=1,nlev + do j=1,jm + do i=1,im + if( defined( real(var12(i,j,L) ,kind=4),undef ) .and. & + defined( real(varc1(i,j,L,n),kind=4),undef ) .and. & + defined( real(varc2(i,j,L,n),kind=4),undef ) ) then + varec1(i,j,L,n) = 0.5*( var12(i,j,L) + varc1(i,j,L,n) - varc2(i,j,L,n) ) + varec2(i,j,L,n) = 0.5*( var12(i,j,L) + varc2(i,j,L,n) - varc1(i,j,L,n) ) + varec3(i,j,L,n) = 0.5*( varc1(i,j,L,n) + varc2(i,j,L,n) - var12(i,j,L) ) + else + varec1(i,j,L,n) = real(undef,kind=4) + varec2(i,j,L,n) = real(undef,kind=4) + varec3(i,j,L,n) = real(undef,kind=4) + endif + enddo + enddo + enddo + + enddo + call timeend('err estimate') + +! Write Grads Data +! ---------------- + call timebeg('grads write ') + + ! Write 3CH VAR Error Estimates + ! ----------------------------- + do n=1,nexps-2 + m=n+2 + write(char,'("vare1"i1)') m + call writit ( varec1(1,1,1,n),im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = '3CH_Variance_Error_Estimate_for_Fixed_Corner_1_' // trim(experiment(1)%expid) // '_using_Third_Corner_' // trim(experiment(m)%expid) + + write(char,'("vare2"i1)') m + call writit ( varec2(1,1,1,n),im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = '3CH_Variance_Error_Estimate_for_Fixed_Corner_2_' // trim(experiment(2)%expid) // '_using_Third_Corner_' // trim(experiment(m)%expid) + + write(char,'("vare"i1)') m + call writit ( varec3(1,1,1,n),im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = '3CH_Variance_Error_Estimate_for_Third_Corner_' // trim(experiment(m)%expid) + enddo + + ! Write VAR + ! --------- + call writit ( var12,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // 'var12 ' + desc(nvars) = 'Variance_between_Fixed_Corner_1_' // trim(experiment(1)%expid) // '_and_Fixed_Corner_2_' // trim(experiment(2)%expid) + do n=1,nexps-2 + m=n+2 + write(char,'("var1"i1)') m + call writit ( varc1(1,1,1,n) ,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'Variance_between_Fixed_Corner_1_' // trim(experiment(1)%expid) // '_and_Third_Corner_' // trim(experiment(m)%expid) + + write(char,'("var2"i1)') m + call writit ( varc2(1,1,1,n) ,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'Variance_between_Fixed_Corner_2_' // trim(experiment(2)%expid) // '_and_Third_Corner_' // trim(experiment(m)%expid) + enddo + + ! Write MSE Total + ! --------------- + call writit ( mse12,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // 'mse12 ' + desc(nvars) = 'Total_Mean_Square_Error_between_Fixed_Corner_1_' // trim(experiment(1)%expid) // '_and_Fixed_Corner_2_' // trim(experiment(2)%expid) + do n=1,nexps-2 + m=n+2 + write(char,'("mse1"i1)') m + call writit ( msec1(1,1,1,n) ,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'Total_Mean_Square_Error_between_Fixed_Corner_1_' // trim(experiment(1)%expid) // '_and_Third_Corner_' // trim(experiment(m)%expid) + + write(char,'("mse2"i1)') m + call writit ( msec2(1,1,1,n) ,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'Total_Mean_Square_Error_between_Fixed_Corner_2_' // trim(experiment(2)%expid) // '_and_Third_Corner_' // trim(experiment(m)%expid) + enddo + + ! Write MSE Bias + ! -------------- + call writit ( mse12B,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // 'mse12B ' + desc(nvars) = 'BIAS_Mean_Square_Error_between_Fixed_Corner_1_' // trim(experiment(1)%expid) // '_and_Fixed_Corner_2_' // trim(experiment(2)%expid) + do n=1,nexps-2 + m=n+2 + write(char,'("mse1"i1"B")') m + call writit ( msec1b(1,1,1,n) ,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'BIAS_Mean_Square_Error_between_Fixed_Corner_1_' // trim(experiment(1)%expid) // '_and_Third_Corner_' // trim(experiment(m)%expid) + + write(char,'("mse2"i1"B")') m + call writit ( msec2b(1,1,1,n) ,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'BIAS_Mean_Square_Error_between_Fixed_Corner_2_' // trim(experiment(2)%expid) // '_and_Third_Corner_' // trim(experiment(m)%expid) + enddo + + ! Write MSE Amplitude + ! ------------------- + call writit ( mse12A,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // 'mse12A ' + desc(nvars) = 'AMPL_Mean_Square_Error_between_Fixed_Corner_1_' // trim(experiment(1)%expid) // '_and_Fixed_Corner_2_' // trim(experiment(2)%expid) + do n=1,nexps-2 + m=n+2 + write(char,'("mse1"i1"A")') m + call writit ( msec1a(1,1,1,n) ,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'AMPL_Mean_Square_Error_between_Fixed_Corner_1_' // trim(experiment(1)%expid) // '_and_Third_Corner_' // trim(experiment(m)%expid) + + write(char,'("mse2"i1"A")') m + call writit ( msec2a(1,1,1,n) ,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'AMPL_Mean_Square_Error_between_Fixed_Corner_2_' // trim(experiment(2)%expid) // '_and_Third_Corner_' // trim(experiment(m)%expid) + enddo + + ! Write MSE Phase + ! --------------- + call writit ( mse12P,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // 'mse12P ' + desc(nvars) = 'PHAZ_Mean_Square_Error_between_Fixed_Corner_1_' // trim(experiment(1)%expid) // '_and_Fixed_Corner_2_' // trim(experiment(2)%expid) + do n=1,nexps-2 + m=n+2 + write(char,'("mse1"i1"P")') m + call writit ( msec1p(1,1,1,n) ,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'PHAZ_Mean_Square_Error_between_Fixed_Corner_1_' // trim(experiment(1)%expid) // '_and_Third_Corner_' // trim(experiment(m)%expid) + + write(char,'("mse2"i1"P")') m + call writit ( msec2p(1,1,1,n) ,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'PHAZ_Mean_Square_Error_between_Fixed_Corner_2_' // trim(experiment(2)%expid) // '_and_Third_Corner_' // trim(experiment(m)%expid) + enddo + + ! Write RHO + ! --------- + call writit ( rho12,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // 'rho12 ' + desc(nvars) = 'Correlation_Coefficient_between_Fixed_Corner_1_' // trim(experiment(1)%expid) // '_and_Fixed_Corner_2_' // trim(experiment(2)%expid) + do n=1,nexps-2 + m=n+2 + write(char,'("rho1"i1)') m + call writit ( rhoc1(1,1,1,n) ,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'Correlation_Coefficient_between_Fixed_Corner_1_' // trim(experiment(1)%expid) // '_and_Third_Corner_' // trim(experiment(m)%expid) + + write(char,'("rho2"i1)') m + call writit ( rhoc2(1,1,1,n) ,im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'Correlation_Coefficient_between_Fixed_Corner_2_' // trim(experiment(2)%expid) // '_and_Third_Corner_' // trim(experiment(m)%expid) + enddo + + ! Write Time Means + ! ---------------- + n = 1 + write(char,'(i1)') n + call writit ( q(1,1,1,n),im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'Time_Mean_for_Fixed_Corner_1_' // trim(experiment(n)%expid) + n = 2 + write(char,'(i1)') n + call writit ( q(1,1,1,n),im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'Time_Mean_for_Fixed_Corner_2_' // trim(experiment(n)%expid) + do n=1,nexps-2 + m=n+2 + write(char,'(i1)') m + call writit ( q(1,1,1,m),im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'Time_Mean_for_Third_Corner_' // trim(experiment(m)%expid) + enddo + + ! Write Variances + ! --------------- + n = 1 + write(char,'("var"i1)') n + call writit ( var(1,1,1,n),im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'Variance_for_Fixed_Corner_1_' // trim(experiment(n)%expid) + n = 2 + write(char,'("var"i1)') n + call writit ( var(1,1,1,n),im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'Variance_for_Fixed_Corner_2_' // trim(experiment(n)%expid) + do n=1,nexps-2 + m=n+2 + write(char,'("var"i1)') m + call writit ( var(1,1,1,m),im,jm,nlev,lattice ) ; nvars = nvars + 1 ; name(nvars) = trim(field(nfield)) // trim(char) + desc(nvars) = 'Variance_for_Third_Corner_' // trim(experiment(m)%expid) + enddo + call timeend('grads write ') + +! ------------------------------------------------------------------------------------------- + + enddo ! ENDDO for NFIELDS Loop + +! Write Grads CTL file +! -------------------- + if( root ) then + open (86,file= trim(tag) // '.ctl',form='formatted',access='sequential') + write(86,5001) trim(tag) // '.data' + write(86,5002) + write(86,5003) undef + write(86,5004) imglobal,360.0/float(imglobal) + write(86,5005) jmglobal,180.0/float(jmglobal-1) + write(86,5006) nlev,(zlev(k),k=1,nlev) + + nymd = nymdb + nhms = nhmsb + year = nymd/10000 + month = mod(nymd,10000)/100 + write(86,5007) ndates/ndates, months(month),year + + write(86,5008) nvars + do n=1,nvars + write(86,5009) name(n),nlev,trim(desc(n)) + enddo + write(86,5010) + endif + + 5001 format('dset ^',a) + 5002 format('title 3CH_Data',/,'options sequential') + 5003 format('undef ',g13.6) + 5004 format('xdef ',i4,' linear -180 ',f8.5) + 5005 format('ydef ',i4,' linear -90 ',f8.5) + 5006 format('zdef ',i3,' levels ',5(f7.2,1x),/, & + 50(18x, 5(f7.2,1x),/) ) + 5007 format('tdef ',i3,' linear ', '00:00', 'Z01' ,a3,i4,' 6hr') + 5008 format('vars ',i3) + 5009 format(a,2x,i3,' 0 ',a) + 5010 format('endvars') + + call timeend('main ') + if( root ) call timepri (6) + + call my_finalize + stop + end + + subroutine init_levs( experiment,num,nl,lev ) + use ThreeCornerHat_mod + implicit none + integer num, nl + type(triplet_member) :: experiment(num) + real, pointer :: lev(:) + real, allocatable :: dum(:) + real zlev + integer nlev + + integer L,k,n + + nl = 0 + do L=1,experiment(1)%lm + zlev = experiment(1)%levs(L) + nlev = 1 + do n=2,num + do k=1,experiment(n)%lm + if( experiment(n)%levs(k).eq.zlev ) then + nlev = nlev + 1 + exit + endif + enddo + enddo + if( nlev.eq.num ) then + if( nl.eq.0 ) then + nl = nl + 1 + allocate( lev(nl) ) + lev(nl) = zlev + else + allocate( dum(nl) ) + dum = lev + deallocate( lev ) + nl = nl + 1 + allocate( lev(nl) ) + lev(1:nl-1) = dum + lev(nl) = zlev + deallocate( dum ) + endif + endif + enddo + + return + end + + subroutine init_triplet ( experiment,lattice ) + use dynamics_lattice_module + use ThreeCornerHat_mod + implicit none + + type ( dynamics_lattice_type ) lattice + +#ifdef mpi + include 'mpif.h' +#endif + + integer comm,myid,npes,ierror + integer npex,npey + logical root + + type(triplet_member) :: experiment + + integer id,nvars,rc + integer ntime,ngatts,timinc + integer im,jm,lm + integer ndates,num + real undef + + character*256 title + character*256 source + character*256 contact + character*256 levunits + character*256, allocatable :: vname(:) + character*256, allocatable :: vtitle(:) + character*256, allocatable :: vunits(:) + + real, allocatable :: lat(:) + real, allocatable :: lon(:) + real, allocatable :: lev(:) + real, allocatable :: vrange(:,:) + real, allocatable :: prange(:,:) + integer, allocatable :: yymmdd(:) + integer, allocatable :: hhmmss(:) + integer, allocatable :: kmvar(:) + integer, allocatable :: dates(:,:) + integer, allocatable :: datez(:,:) + + root = lattice%myid.eq.0 + +! Read All Experiment Files to Gather Date and Time Information +! ------------------------------------------------------------- +! print *, 'Examining Triplet Files ...' +! print * + ndates = 0 + + do num=1,experiment%nfiles + + if( root ) then + call gfio_open ( experiment%fnames(num),1,id,rc ) + call gfio_diminquire ( id,im,jm,lm,ntime,nvars,ngatts,rc ) + if( rc.ne.0 ) then + print *, 'Failure to Open File: ',trim( experiment%fnames(num) ) + endif + endif + +#ifdef mpi + call mpi_bcast ( rc,1,mpi_integer,0,lattice%comm,ierror ) + call mpi_bcast ( im,1,mpi_integer,0,lattice%comm,ierror ) + call mpi_bcast ( jm,1,mpi_integer,0,lattice%comm,ierror ) + call mpi_bcast ( lm,1,mpi_integer,0,lattice%comm,ierror ) + call mpi_bcast ( ntime,1,mpi_integer,0,lattice%comm,ierror ) + call mpi_bcast ( nvars,1,mpi_integer,0,lattice%comm,ierror ) +#endif + + if( rc.ne.0 ) then + call my_finalize + stop + endif + + allocate ( lon(im) ) + allocate ( lat(jm) ) + allocate ( lev(lm) ) + allocate ( yymmdd(ntime) ) + allocate ( hhmmss(ntime) ) + allocate ( vname(nvars) ) + allocate ( vtitle(nvars) ) + allocate ( vunits(nvars) ) + allocate ( kmvar(nvars) ) + allocate ( vrange(2,nvars) ) + allocate ( prange(2,nvars) ) + + if( root ) then + call gfio_inquire ( id,im,jm,lm,ntime,nvars, & + title,source,contact,undef, & + lon,lat,lev,levunits, & + yymmdd,hhmmss,timinc, & + vname,vtitle,vunits,kmvar, & + vrange,prange,rc ) + endif + +#ifdef mpi + call mpi_bcast ( yymmdd,ntime, mpi_integer,0,lattice%comm,ierror ) + call mpi_bcast ( hhmmss,ntime, mpi_integer,0,lattice%comm,ierror ) + call mpi_bcast ( timinc,1, mpi_integer,0,lattice%comm,ierror ) + call mpi_bcast ( kmvar,nvars, mpi_integer,0,lattice%comm,ierror ) + call mpi_bcast ( lev,lm, lattice%mpi_rkind, 0,lattice%comm,ierror ) +#endif + + if( ndates.eq.0 ) then + ndates = ndates + ntime + allocate ( dates(3,ndates) ) + allocate ( datez(3,ndates) ) + dates(1,ndates-ntime+1:ndates) = yymmdd(:) + dates(2,ndates-ntime+1:ndates) = hhmmss(:) + dates(3,ndates-ntime+1:ndates) = num + datez = dates + allocate ( experiment%levs(lm) ) + experiment%levs = lev + else + deallocate(dates) + ndates = ndates + ntime + allocate ( dates(3,ndates) ) + dates(1,1:ndates-ntime) = datez(1,1:ndates-ntime) + dates(2,1:ndates-ntime) = datez(2,1:ndates-ntime) + dates(3,1:ndates-ntime) = datez(3,1:ndates-ntime) + dates(1,ndates-ntime+1:ndates) = yymmdd(:) + dates(2,ndates-ntime+1:ndates) = hhmmss(:) + dates(3,ndates-ntime+1:ndates) = num + deallocate(datez) + allocate ( datez(3,ndates) ) + datez = dates + endif + + if(root) call gfio_close(id,rc) + deallocate ( lon,lat,lev,yymmdd,hhmmss,vname,vtitle,vunits,kmvar,vrange,prange ) + enddo + + allocate ( experiment%dates(3,ndates) ) + + experiment%dates = dates + experiment%im = im + experiment%jm = jm + experiment%lm = lm + experiment%ndates = ndates + experiment%undef = undef + + ! Note: + ! ----- + ! NDATES are the total number of Dates defined by the INPUT filenames for each Member + ! NDATES is NOT necessarily the total number of Dates requested by the 3CH.rc + + return + end + + subroutine read_triplet ( experiment,nymd,nhms,lmo,zlev,ndate,nexp,field,nfields,zundef,lattice,method ) + use ThreeCornerHat_mod + use dynamics_lattice_module + implicit none + type ( dynamics_lattice_type ) lattice + type(triplet_member) :: experiment +#ifdef mpi + include 'mpif.h' +#endif + integer nymd,nhms,ndate,nexp + integer lmo,nfields + real undef, zundef + real zlev(lmo) + + integer id,nvars,rc + integer ntime,ngatts,timinc + integer L,m,n,msgn + integer im,jm,lm,LN + integer i,imglobal + integer j,jmglobal + integer iratio,jratio + integer method + + integer npes, ierror + integer index(lmo*nfields) + + character*256 title + character*256 source + character*256 contact + character*256 levunits + character*256, allocatable :: vname(:) + character*256, allocatable :: vtitle(:) + character*256, allocatable :: vunits(:) + + real, allocatable :: qglo(:,:,:) + real, allocatable :: q(:,:,:) + real, allocatable :: lat(:) + real, allocatable :: lon(:) + real, allocatable :: lev(:) + real, allocatable :: vrange(:,:) + real, allocatable :: prange(:,:) + integer, allocatable :: yymmdd(:) + integer, allocatable :: hhmmss(:) + integer, allocatable :: kmvar(:) + +! Default Aliases +! --------------- + character*256 field(nfields) + character*256 alias + + character*256 alias_u (6) + character*256 alias_v (6) + character*256 alias_t (6) + character*256 alias_q (3) + character*256 alias_h (4) + character*256 alias_p (4) + + data alias_u /'u','uwnd','ugrd','ugrdprs','U_velocity','ugrdes'/ + data alias_v /'v','vwnd','vgrd','vgrdprs','V_velocity','vgrdes'/ + data alias_t /'t','tmpu','tmp' ,'tmpprs','Temperature','tmpes' / + data alias_q /'q','sphu','qv' / + data alias_h /'h','hght','Height','hgtes' / + data alias_p /'ps','sp','pressfc','surface_pressur' / + + logical check_names + logical shift + logical found_var + logical found_date + integer num, LL, k, loc, len + data id /0/ + data num /0/ + data shift /.false./ + +! Read Appropriate Triplet File to Get Data +! ----------------------------------------- + imglobal = lattice%imglobal + jmglobal = lattice%jmglobal + allocate ( qglo(imglobal,jmglobal,lmo) ) + + npes = lattice%nx * lattice%ny + do m=1,nfields + do L=1,lmo + LN = L + (m-1)*LMO + index(LN) = mod(LN-1,npes) + enddo + enddo + + ! Initialize Experiment to UNDEF + ! ------------------------------ + experiment%q(:,:,:,ndate,:) = zundef + + ! Find the Appropriate Date + ! ------------------------- + found_date = .false. + do num=1,experiment%ndates + if( experiment%dates(1,num).eq.nymd .and. experiment%dates(2,num).eq.nhms ) then + found_date = .true. + + if(lattice%myid.eq.0) then + write(*,'(" Found: ",i8.8,1x,i6.6," for Experiment ",i3)' ) nymd,nhms,nexp + endif + call gfio_open ( experiment%fnames(experiment%dates(3,num)),1,id,rc ) + if(lattice%myid.eq.0) then + call gfio_diminquire ( id,im,jm,lm,ntime,nvars,ngatts,rc ) + endif + +#ifdef mpi + call mpi_bcast ( im,1, mpi_integer, 0, lattice%comm,ierror ) + call mpi_bcast ( jm,1, mpi_integer, 0, lattice%comm,ierror ) + call mpi_bcast ( lm,1, mpi_integer, 0, lattice%comm,ierror ) + call mpi_bcast ( ntime,1, mpi_integer, 0, lattice%comm,ierror ) + call mpi_bcast ( nvars,1, mpi_integer, 0, lattice%comm,ierror ) +#endif + + allocate ( lon(im) ) + allocate ( lat(jm) ) + allocate ( lev(lm) ) + allocate ( yymmdd(ntime) ) + allocate ( hhmmss(ntime) ) + allocate ( vname(nvars) ) + allocate ( vtitle(nvars) ) + allocate ( vunits(nvars) ) + allocate ( kmvar(nvars) ) + allocate ( vrange(2,nvars) ) + allocate ( prange(2,nvars) ) + + if(lattice%myid.eq.0) then + call gfio_inquire ( id,im,jm,lm,ntime,nvars, & + title,source,contact,undef, & + lon,lat,lev,levunits, & + yymmdd,hhmmss,timinc, & + vname,vtitle,vunits,kmvar, & + vrange,prange,rc ) + endif + +#ifdef mpi + call mpi_bcast ( yymmdd,ntime, mpi_integer, 0,lattice%comm,ierror ) + call mpi_bcast ( hhmmss,ntime, mpi_integer, 0,lattice%comm,ierror ) + call mpi_bcast ( kmvar,nvars, mpi_integer, 0,lattice%comm,ierror ) + call mpi_bcast ( vname,nvars*256, mpi_character, 0,lattice%comm,ierror ) + call mpi_bcast ( undef,1, mpi_real, 0,lattice%comm,ierror ) + call mpi_bcast ( lon,im, mpi_real, 0,lattice%comm,ierror ) + call mpi_bcast ( lev,lm, mpi_real, 0,lattice%comm,ierror ) +#endif + + shift = .false. + if( lon(1).eq.0.0 ) then + if(lattice%myid.eq.0) write(*,'(" Triplet data begins at lon: ", & + g6.2," Horizontal Shift will be performed")' ) lon(1) + shift = .true. + endif + + allocate ( q(im,jm,lmo) ) + + do m=1,nfields ! Loop over fields of interest + found_var = .false. ! Initialize FOUND flag for each field + do n=1,nvars ! Loop over variables in Experiment File + + ! Generic Field + ! ------------- + if( .not.found_var ) then + + if( trim(field(m)).eq.'u' ) then ; len = size( alias_u ) ; msgn = 1 ; endif + if( trim(field(m)).eq.'v' ) then ; len = size( alias_v ) ; msgn = 1 ; endif + if( trim(field(m)).eq.'t' ) then ; len = size( alias_t ) ; msgn = 0 ; endif + if( trim(field(m)).eq.'q' ) then ; len = size( alias_q ) ; msgn = 0 ; endif + if( trim(field(m)).eq.'h' ) then ; len = size( alias_h ) ; msgn = 0 ; endif + if( trim(field(m)).eq.'p' ) then ; len = size( alias_p ) ; msgn = 0 ; endif + + do k = 1,len + if( trim(field(m)).eq.'u' ) alias = alias_u(k) + if( trim(field(m)).eq.'v' ) alias = alias_v(k) + if( trim(field(m)).eq.'t' ) alias = alias_t(k) + if( trim(field(m)).eq.'q' ) alias = alias_q(k) + if( trim(field(m)).eq.'h' ) alias = alias_h(k) + if( trim(field(m)).eq.'p' ) alias = alias_p(k) + + if( check_names( vname(n),alias ) ) then + found_var = .true. + if(lattice%myid.eq.0) then + write(*,'(" Found Variable: ",a)' ) trim(field(m)) + endif + + do L=1,lmo + do LL=1,lm + if( lev(LL).eq.zlev(L) ) loc = LL + enddo + LN = L + (m-1)*LMO + + ! Read on ROOT: Global Q(IMxJM) from Experiment + ! --------------------------------------------- + if( index(LN).eq.lattice%myid ) then + + call timebeg(' gfio getvar ') + if( trim(field(m)).eq.'p' ) then + call gfio_getvar ( id,vname(n),nymd,nhms,im,jm,0 ,1,q(1,1,L),rc ) + else + call gfio_getvar ( id,vname(n),nymd,nhms,im,jm,loc,1,q(1,1,L),rc ) + endif + call timeend(' gfio getvar ') + + where( q(:,:,L).eq.undef ) ; q(:,:,L) = zundef ; endwhere + if( shift ) call hshift ( q(1,1,L),im,jm ) + + if( im.eq.imglobal .and. jm.eq.jmglobal ) then + qglo(:,:,L) = q(:,:,L) + else + + ! Bi-Linear Interpolation + ! ----------------------- + if( method.eq.1 ) then + call timebeg(' bi_linear') + iratio = im / imglobal + jratio = (jm-1)/(jmglobal-1) + if( ( imglobal *iratio .eq. im ) .and. & + ( (jmglobal-1)*jratio .eq. (jm-1) ) ) then + do j=1,jmglobal + do i=1,imglobal + qglo(i,j,L) = q( i*iratio-1, j*jratio-1,L ) + enddo + enddo + else + call hinterp ( q(1,1,L),im,jm,qglo(1,1,L),imglobal,jmglobal,1,zundef,method ) + endif + call timeend(' bi_linear') + endif + + ! Bi-Cubic Interpolation + ! ---------------------- + if( method.eq.2 ) then + call timebeg(' bi_cubic') + iratio = im / imglobal + jratio = (jm-1)/(jmglobal-1) + if( ( imglobal *iratio .eq. im ) .and. & + ( (jmglobal-1)*jratio .eq. (jm-1) ) ) then + do j=1,jmglobal + do i=1,imglobal + qglo(i,j,L) = q( i*iratio-1, j*jratio-1,L ) + enddo + enddo + else + call hinterp ( q(1,1,L),im,jm,qglo(1,1,L),imglobal,jmglobal,1,zundef,method ) + endif + call timeend(' bi_cubic') + endif + + ! Box-Average Interpolation + ! ------------------------- + if( method.eq.3 ) then + call timebeg(' box_average') + call bin( q(1,1,L),im,jm,qglo(1,1,L),imglobal,jmglobal,zundef,msgn ) + call timeend(' box_average') + endif + + endif ! End im.eq.imglobal .and. jm.eq.jmglobal Test + + endif ! End MPI-Processor Test + enddo ! End Output Level Loop + + endif ! End NAME test + enddo + endif ! Endif for FOUND test + enddo ! Enddo for N=1,NVARS loop + + if( .not.found_var ) then + if(lattice%myid.eq.0) then + write(*,'(" Not Found Variable: ",a," Setting to UNDEF")' ) trim(field(m)) + endif + endif + + do L=1,lmo +#ifdef mpi + LN = L + (m-1)*LMO + call mpi_bcast ( qglo(1,1,L),imglobal*jmglobal,lattice%mpi_rkind,index(LN),lattice%comm,ierror ) +#endif + ! Scatter Global Output QGLO(IMGLOBALxJMGLOBAL) from Experiment onto Local Array Experiment%Q(IMxJM) + ! -------------------------------------------------------------------------------------------------- + call timebeg(' scatter') + call scatter_2d ( qglo(1,1,L),experiment%q(1,1,L,ndate,m),lattice ) + call timeend(' scatter') + enddo + + enddo ! Enddo for M=1,NFIELDS loop + + ! Close File and Deallocate Space + ! ------------------------------- + call gfio_close(id,rc) + deallocate ( q ) + deallocate ( lon ) + deallocate ( lat ) + deallocate ( lev ) + deallocate ( yymmdd ) + deallocate ( hhmmss ) + deallocate ( vname ) + deallocate ( vtitle ) + deallocate ( vunits ) + deallocate ( kmvar ) + deallocate ( vrange ) + deallocate ( prange ) + + endif ! Endif for Proper Date Test + + enddo ! Enddo for Proper Date Loop + + if( .not.found_date ) then + if(lattice%myid.eq.0) then + write(*,'(" Date Not Found: ",i8.8,1x,i6.6," for Experiment ",i3," Setting Member to UNDEF")' ) nymd,nhms,nexp + endif + endif + + deallocate ( qglo ) + + return + end + + subroutine bin ( qin,im_in,jm_in,qout,im_out,jm_out,undef,msgn ) + implicit none + integer im_in ,jm_in ,msgn + integer im_out,jm_out + real undef + real qin(im_in ,jm_in ) + real qout(im_out,jm_out) + real q10x10(360*6,180*6) + +! Parse Arbitray Field (im,jm) to 10'x10' Variable +! ------------------------------------------------ + call timebeg(' bin_10x10') + call bin_10x10 ( qin,im_in,jm_in,q10x10 ) + call timeend(' bin_10x10') + +! Bin 10'x10' Variable to Output Field (im_out,jm_out) +! ---------------------------------------------------- + call timebeg(' ave_10x10') + call averaged_10x10 ( q10x10,qout,im_out,jm_out,undef,msgn ) + call timeend(' ave_10x10') + + return + end + + subroutine bin_10x10 ( z,im,jm,z10x10 ) +!*********************************************************************** +! +! PURPOSE: +! ======== +! Compute a (10m X 10m) array binned from an input array (im,jm) +! +! INPUT: +! ====== +! z .......... Input array(im,jm) +! im ......... Longitudinal dimension of z +! jm ......... Latitudinal dimension of z +! +! OUTPUT: +! ======= +! z10x10 ..... Output array(360*6,180*6) +! +! NOTES: +! ====== +! Input array z(im,jm) is assumed to be on an A-grid. +! z(i,j) represents the value at the center of the grid-box. +! z(1,j) is located at lon=-180. +! z(i,1) is located at lat=-90. +! z(i,jm) is located at lat=+90. +! +! Output array z10x10 represents values within a 10min X 10min grid-box. +! Each box is referenced by the latitude and longitude of +! its southwest corner, not its center point. Thus, +! the height associated with a coordinate actually +! represents the heights centered to the northeast of that point. +! +!*********************************************************************** +!* GODDARD LABORATORY FOR ATMOSPHERES * +!*********************************************************************** + + implicit none + integer im,jm + real z(im,jm) + real z10x10(360*6,180*6) + + integer i,j,ii,jj,ibeg,iend,jbeg,jend + real zlatc,zlonc + real lonbeg,lonend + real latbeg,latend + real pi,dl,dp,dz + + pi = 4.*atan(1.) + dl = 2*pi/im + dp = pi/(jm-1) + dz = pi/(6.*180) + + do j=1,180*6 + do i=1,360*6 + + zlatc = -pi/2+(j-0.5)*dz ! Latitude at center of 10x10 box + zlonc = -pi +(i-0.5)*dz ! Longitude at center of 10x10 box + +! Find bounding lat and lon on IMxJM grid +! --------------------------------------- + iend = nint( 1.+(zlonc+pi)/dl ) + lonend = -pi + (iend-1)*dl + if( lonend.ge.zlonc ) then + lonbeg = -pi + (iend-2)*dl + else + iend = iend+1 + lonbeg = lonend + lonend = -pi + (iend-1)*dl + endif + ibeg = iend-1 + + jend = nint( 1.+(zlatc+pi/2)/dp ) + latend = -pi/2 + (jend-1)*dp + if( latend.ge.zlatc ) then + latbeg = -pi/2 + (jend-2)*dp + else + jend = jend+1 + latbeg = latend + latend = -pi/2 + (jend-1)*dp + endif + jbeg = jend-1 + + + if(iend.gt.im) iend=iend-im + + if( zlonc.le.lonbeg+0.5*dl ) then + ii = ibeg + else + ii = iend + endif + if( zlatc.le.latbeg+0.5*dp ) then + jj = jbeg + else + jj = jend + endif + + if( ii.lt.1 .or. ii.gt.im .or. & + jj.lt.1 .or. jj.gt.jm ) then + write(6,1000) i,j,zlonc*180/pi,zlatc*180/pi, & + ii,jj,lonbeg*180/pi,lonend*180/pi,latbeg*180/pi,latend*180/pi + endif + + z10x10(i,j) = z(ii,jj) + + enddo + enddo + + 1000 format(1x,'i_10x10: ',i4,' j_10x10: ',i4,' lon_10x10: ',f10.4,' lat_10x10: ',f10.4, & + 4x,'i_IMxJM: ',i4,' j_IMxJM: ',i4,' lonbeg: ',f10.4,' lonend: ',f10.4, & + ' latbeg: ',f10.4,' latend: ',f10.4) + return + end + + subroutine averaged_10x10 ( z10x10,z,im,jm,undef,msgn ) +!*********************************************************************** +! +! PURPOSE: +! ======== +! Average a (10m X 10m) input array to an output array (im,jm) +! +! INPUT: +! ====== +! z10x10 ..... Input array(360*6,180*6) +! msgn ....... Integer Flag for scalar (0) or vector (1) +! +! OUTPUT: +! ======= +! z .......... Output array(im,jm) +! im ......... Longitudinal dimension of z +! jm ......... Latitudinal dimension of z +! +! NOTES: +! ====== +! Input array z10x10 represents values within a 10min X 10min grid-box. +! Each box is referenced by the latitude and longitude of +! its southwest corner, not its center point. Thus, +! the height associated with a coordinate actually +! represents the heights centered to the northeast of that point. +! +! Output array z(im,jm) is assumed to be on an A-grid. +! z(i,j) represents the value at the center of the grid-box. +! z(1,j) is located at lon=-180. +! z(i,1) is located at lat=-90. +! z(i,jm) is located at lat=+90. +! +!*********************************************************************** +!* GODDARD LABORATORY FOR ATMOSPHERES * +!*********************************************************************** + + implicit none + integer im,jm,msgn + real z(im,jm) + real dlam(im), dphi(jm) + real z10x10(360*6,180*6) + + integer i,j,ibeg,iend,jbeg,jend + integer ii,jj,itmp + real sum1,sum2 + real zlat,zlon + real lon1,lon2,wx + real lat1,lat2,wy + real lonbeg,lonend,lat,coslat + real latbeg,latend + real undef + real pi,dz + real lon_cmp(im) + real lat_cmp(jm) + logical defined + + pi = 4.*atan(1.) + dz = pi/(6.*180) + dlam = 2*pi/ im + dphi = pi/(jm-1) + +! Compute Computational Lambda's and Phi's +! ---------------------------------------- + lon_cmp(1) = -pi + do i=2,im + lon_cmp(i) = lon_cmp(i-1) + dlam(i-1) + enddo + lat_cmp(1) = -pi*0.5 + do j=2,jm-1 + lat_cmp(j) = lat_cmp(j-1) + dphi(j-1) + enddo + lat_cmp(jm) = pi*0.5 + + +! Compute average away from poles +! ------------------------------- + do j=2,jm-1 + do i=1,im + + zlat = lat_cmp(j) + zlon = lon_cmp(i) + + latbeg = zlat-dphi(j-1)/2 + latend = zlat+dphi(j) /2 + if( i.eq.1 ) then + lonbeg = zlon-dlam(im) /2 + else + lonbeg = zlon-dlam(i-1)/2 + endif + lonend = zlon+dlam(i) /2 + + ibeg = 1.+(lonbeg+pi) /dz + iend = 1.+(lonend+pi) /dz + jbeg = 1.+(latbeg+pi/2)/dz + jend = 1.+(latend+pi/2)/dz + + sum1 = 0 + sum2 = 0 + do jj=jbeg,jend + lat = -pi/2+(jj-0.5)*dz + coslat = cos(lat) + lat1 = -pi/2 + (jj-1)*dz + lat2 = -pi/2 + jj *dz + wy = 1.0 + if( lat1.lt.latbeg ) wy = (lat2-latbeg)/dz + if( lat2.gt.latend ) wy = (latend-lat1)/dz + + if(ibeg.ge.1) then + do ii=ibeg,iend + if( defined(z10x10(ii,jj),undef) ) then + lon1 = -pi + (ii-1)*dz + lon2 = -pi + ii *dz + wx = 1.0 + if( lon1.lt.lonbeg ) wx = (lon2-lonbeg)/dz + if( lon2.gt.lonend ) wx = (lonend-lon1)/dz + sum1 = sum1 + z10x10(ii,jj)*coslat*wx*wy + sum2 = sum2 + coslat*wx*wy + endif + enddo + else + itmp = 1.+(lonbeg+0.1*dz+3*pi)/dz + do ii=itmp,360*6 + if( defined(z10x10(ii,jj),undef) ) then + lon1 = -pi + (ii-1)*dz + lon2 = -pi + ii *dz + wx = 1.0 + if( lon1.lt.lonbeg+2*pi ) wx = (lon2-lonbeg-2*pi)/dz + if( lon2.gt.lonend+2*pi ) wx = (2*pi+lonend-lon1)/dz + sum1 = sum1 + z10x10(ii,jj)*coslat*wx*wy + sum2 = sum2 + coslat*wx*wy + endif + enddo + do ii=1,iend + if( defined(z10x10(ii,jj),undef) ) then + lon1 = -pi + (ii-1)*dz + lon2 = -pi + ii *dz + wx = 1.0 + if( lon1.lt.lonbeg ) wx = (lon2-lonbeg)/dz + if( lon2.gt.lonend ) wx = (lonend-lon1)/dz + sum1 = sum1 + z10x10(ii,jj)*coslat*wx*wy + sum2 = sum2 + coslat*wx*wy + endif + enddo + endif + + enddo + if( sum2.ne.0.0 ) then + z(i,j) = sum1/sum2 + else + z(i,j) = undef + endif + enddo + enddo + +! Compute average at South Pole +! ----------------------------- + j=1 + do i=1,im + + zlat = lat_cmp(j) + zlon = lon_cmp(i) + + latbeg = zlat + latend = zlat+dphi(j) /2 + if( i.eq.1 ) then + lonbeg = zlon-dlam(im) /2 + else + lonbeg = zlon-dlam(i-1)/2 + endif + lonend = zlon+dlam(i) /2 + + ibeg = 1.+(lonbeg+pi) /dz + iend = 1.+(lonend+pi) /dz + jbeg = 1 + jend = 1.+(latend+pi/2)/dz + + sum1 = 0 + sum2 = 0 + do jj=jbeg,jend + lat = -pi/2+(jj-0.5)*dz + coslat = cos(lat) + lat1 = -pi/2 + (jj-1)*dz + lat2 = -pi/2 + jj *dz + wy = 1.0 + if( lat1.lt.latbeg ) wy = (lat2-latbeg)/dz + if( lat2.gt.latend ) wy = (latend-lat1)/dz + + if(ibeg.ge.1) then + do ii=ibeg,iend + if( defined(z10x10(ii,jj),undef) ) then + lon1 = -pi + (ii-1)*dz + lon2 = -pi + ii *dz + wx = 1.0 + if( lon1.lt.lonbeg ) wx = (lon2-lonbeg)/dz + if( lon2.gt.lonend ) wx = (lonend-lon1)/dz + sum1 = sum1 + z10x10(ii,jj)*coslat*wx*wy + sum2 = sum2 + coslat*wx*wy + endif + enddo + else + itmp = 1.+(lonbeg+0.1*dz+3*pi)/dz + do ii=itmp,360*6 + if( defined(z10x10(ii,jj),undef) ) then + lon1 = -pi + (ii-1)*dz + lon2 = -pi + ii *dz + wx = 1.0 + if( lon1.lt.lonbeg+2*pi ) wx = (lon2-lonbeg-2*pi)/dz + if( lon2.gt.lonend+2*pi ) wx = (2*pi+lonend-lon1)/dz + sum1 = sum1 + z10x10(ii,jj)*coslat*wx*wy + sum2 = sum2 + coslat*wx*wy + endif + enddo + do ii=1,iend + if( defined(z10x10(ii,jj),undef) ) then + lon1 = -pi + (ii-1)*dz + lon2 = -pi + ii *dz + wx = 1.0 + if( lon1.lt.lonbeg ) wx = (lon2-lonbeg)/dz + if( lon2.gt.lonend ) wx = (lonend-lon1)/dz + sum1 = sum1 + z10x10(ii,jj)*coslat*wx*wy + sum2 = sum2 + coslat*wx*wy + endif + enddo + endif + + enddo + if( sum2.ne.0.0 ) then + z(i,j) = sum1/sum2 + else + z(i,j) = undef + endif + enddo + +! Compute average at North Pole +! ----------------------------- + j=jm + do i=1,im + + zlat = lat_cmp(j) + zlon = lon_cmp(i) + + latbeg = zlat-dphi(j-1)/2 + latend = zlat + if( i.eq.1 ) then + lonbeg = zlon-dlam(im) /2 + else + lonbeg = zlon-dlam(i-1)/2 + endif + lonend = zlon+dlam(i) /2 + + ibeg = 1.+(lonbeg+pi) /dz + iend = 1.+(lonend+pi) /dz + jbeg = 1.+(latbeg+pi/2)/dz + jend = 1080 + + sum1 = 0 + sum2 = 0 + do jj=jbeg,jend + lat = -pi/2+(jj-0.5)*dz + coslat = cos(lat) + lat1 = -pi/2 + (jj-1)*dz + lat2 = -pi/2 + jj *dz + wy = 1.0 + if( lat1.lt.latbeg ) wy = (lat2-latbeg)/dz + if( lat2.gt.latend ) wy = (latend-lat1)/dz + + if(ibeg.ge.1) then + do ii=ibeg,iend + if( defined(z10x10(ii,jj),undef) ) then + lon1 = -pi + (ii-1)*dz + lon2 = -pi + ii *dz + wx = 1.0 + if( lon1.lt.lonbeg ) wx = (lon2-lonbeg)/dz + if( lon2.gt.lonend ) wx = (lonend-lon1)/dz + sum1 = sum1 + z10x10(ii,jj)*coslat*wx*wy + sum2 = sum2 + coslat*wx*wy + endif + enddo + else + itmp = 1.+(lonbeg+0.1*dz+3*pi)/dz + do ii=itmp,360*6 + if( defined(z10x10(ii,jj),undef) ) then + lon1 = -pi + (ii-1)*dz + lon2 = -pi + ii *dz + wx = 1.0 + if( lon1.lt.lonbeg+2*pi ) wx = (lon2-lonbeg-2*pi)/dz + if( lon2.gt.lonend+2*pi ) wx = (2*pi+lonend-lon1)/dz + sum1 = sum1 + z10x10(ii,jj)*coslat*wx*wy + sum2 = sum2 + coslat*wx*wy + endif + enddo + do ii=1,iend + if( defined(z10x10(ii,jj),undef) ) then + lon1 = -pi + (ii-1)*dz + lon2 = -pi + ii *dz + wx = 1.0 + if( lon1.lt.lonbeg ) wx = (lon2-lonbeg)/dz + if( lon2.gt.lonend ) wx = (lonend-lon1)/dz + sum1 = sum1 + z10x10(ii,jj)*coslat*wx*wy + sum2 = sum2 + coslat*wx*wy + endif + enddo + endif + + enddo + if( sum2.ne.0.0 ) then + z(i,j) = sum1/sum2 + else + z(i,j) = undef + endif + enddo + +! Average Pole Values +! ------------------- + if( msgn.eq.0 ) then + sum1 = 0 + j = 0 + do i=1,im + if( defined(z(i,1),undef) ) then + sum1 = sum1 + z(i,1) + j = j + 1 + endif + enddo + if( j.ne.0 ) then + z(:,1) = sum1/j + else + z(:,1) = undef + endif + + sum2 = 0 + j = 0 + do i=1,im + if( defined(z(i,jm),undef) ) then + sum2 = sum2 + z(i,jm) + j = j + 1 + endif + enddo + if( j.ne.0 ) then + z(:,jm) = sum2/j + else + z(:,jm) = undef + endif + + endif + + return + end + + function defined ( q,undef ) + implicit none + logical defined + real q,undef + defined = abs(q-undef).gt.0.1*abs(undef) + return + end + + subroutine hshift ( q,im,jm ) + real q(im,jm), dum(im,jm) + dum(1:im/2,:) = q(1:im/2,:) + q(1:im/2,:) = q(1+im/2:im,:) + q(1+im/2:im,:) = dum(1:im/2,:) + return + end + + subroutine minmax (q,im,jm,undef) + real q(im,jm) + qmin = 1e33 + qmax = -1e33 + do j=1,jm + do i=1,im + if(q(i,j).ne.undef) qmin = min( qmin,q(i,j) ) + if(q(i,j).ne.undef) qmax = max( qmax,q(i,j) ) + enddo + enddo + print *, ' qmin: ',qmin,' qmax: ',qmax + return + end + + subroutine writit ( q,im,jm,lm,lattice ) + use dynamics_lattice_module + use iso_fortran_env, only: REAL64 + implicit none + type ( dynamics_lattice_type ) lattice + integer im,jm,lm,L,img,jmg + real(REAL64) q(im,jm,lm) + real, allocatable :: qglo(:,:) + real, allocatable :: qloc(:,:) + img = lattice%imglobal + jmg = lattice%jmglobal + allocate ( qglo(img,jmg) ) + allocate ( qloc(im ,jm ) ) + do L=1,lm + qloc(:,:) = q(:,:,L) + call timebeg(' gather ') + call gather_2d ( qglo,qloc,lattice ) + call timeend(' gather ') + if( lattice%myid.eq.0 ) then + write(51) qglo + endif + enddo + deallocate ( qglo ) + deallocate ( qloc ) + return + end + + subroutine tick (nymd,nhms,ndt) +!*********************************************************************** +! Purpose +! Tick the Date (nymd) and Time (nhms) by NDT (seconds) +! +!*********************************************************************** +!* GODDARD LABORATORY FOR ATMOSPHERES * +!*********************************************************************** + + IF(NDT.NE.0) THEN + NSEC = NSECF(NHMS) + NDT + + IF (NSEC.GT.86400) THEN + DO WHILE (NSEC.GT.86400) + NSEC = NSEC - 86400 + NYMD = INCYMD (NYMD,1) + ENDDO + ENDIF + + IF (NSEC.EQ.86400) THEN + NSEC = 0 + NYMD = INCYMD (NYMD,1) + ENDIF + + IF (NSEC.LT.00000) THEN + DO WHILE (NSEC.LT.0) + NSEC = 86400 + NSEC + NYMD = INCYMD (NYMD,-1) + ENDDO + ENDIF + + NHMS = NHMSF (NSEC) + ENDIF + + RETURN + end subroutine tick + + function incymd (NYMD,M) +!*********************************************************************** +! PURPOSE +! INCYMD: NYMD CHANGED BY ONE DAY +! MODYMD: NYMD CONVERTED TO JULIAN DATE +! DESCRIPTION OF PARAMETERS +! NYMD CURRENT DATE IN YYMMDD FORMAT +! M +/- 1 (DAY ADJUSTMENT) +! +!*********************************************************************** +!* GODDARD LABORATORY FOR ATMOSPHERES * +!*********************************************************************** + + INTEGER NDPM(12) + DATA NDPM /31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/ + LOGICAL LEAP + LEAP(NY) = MOD(NY,4).EQ.0 .AND. (MOD(NY,100).NE.0 .OR. MOD(NY,400).EQ.0) + +!*********************************************************************** + + NY = NYMD / 10000 + NM = MOD(NYMD,10000) / 100 + ND = MOD(NYMD,100) + M + + IF (ND.EQ.0) THEN + NM = NM - 1 + IF (NM.EQ.0) THEN + NM = 12 + NY = NY - 1 + ENDIF + ND = NDPM(NM) + IF (NM.EQ.2 .AND. LEAP(NY)) ND = 29 + ENDIF + + IF (ND.EQ.29 .AND. NM.EQ.2 .AND. LEAP(NY)) GO TO 20 + + IF (ND.GT.NDPM(NM)) THEN + ND = 1 + NM = NM + 1 + IF (NM.GT.12) THEN + NM = 1 + NY = NY + 1 + ENDIF + ENDIF + + 20 CONTINUE + INCYMD = NY*10000 + NM*100 + ND + RETURN + +!*********************************************************************** +! E N T R Y M O D Y M D +!*********************************************************************** + + ENTRY MODYMD (NYMD) + NY = NYMD / 10000 + NM = MOD(NYMD,10000) / 100 + ND = MOD(NYMD,100) + + 40 CONTINUE + IF (NM.LE.1) GO TO 60 + NM = NM - 1 + ND = ND + NDPM(NM) + IF (NM.EQ.2 .AND. LEAP(NY)) ND = ND + 1 + GO TO 40 + + 60 CONTINUE + MODYMD = ND + RETURN + end function incymd + + function nsecf (nhms) +!*********************************************************************** +! Purpose +! Converts NHMS format to Total Seconds +! +!*********************************************************************** +!* GODDARD LABORATORY FOR ATMOSPHERES * +!*********************************************************************** + implicit none + integer nhms, nsecf + nsecf = nhms/10000*3600 + mod(nhms,10000)/100*60 + mod(nhms,100) + return + end function nsecf + + function nhmsf (nsec) +!*********************************************************************** +! Purpose +! Converts Total Seconds to NHMS format +! +!*********************************************************************** +!* GODDARD LABORATORY FOR ATMOSPHERES * +!*********************************************************************** + implicit none + integer nhmsf, nsec + nhmsf = nsec/3600*10000 + mod(nsec,3600)/60*100 + mod(nsec,60) + return + end function nhmsf + + function check_names (name1,name2) + implicit none + logical check_names + character(*) name1,name2 + integer len,i + character*256 uname1,uname2 + character*1 c + +! Convert name1 to All UpperCase uname1 +! ------------------------------------- + len = len_trim(name1) + uname1 = '' + do i=1,len + c = name1(i:i) + if( ichar(c).ge.97 .and. ichar(c).le.122 ) then + c = achar( ichar(c)-32 ) + endif + uname1 = trim(uname1) // c + enddo + +! Convert name2 to All UpperCase uname2 +! ------------------------------------- + len = len_trim(name2) + uname2 = '' + do i=1,len + c = name2(i:i) + if( ichar(c).ge.97 .and. ichar(c).le.122 ) then + c = achar( ichar(c)-32 ) + endif + uname2 = trim(uname2) // c + enddo + +! Compare uname1 and uname2 +! ------------------------- + ! print *, 'Check Names: ',trim(uname1),' ',trim(uname2) + check_names = ( trim(uname1) == trim(uname2) ) + return + end + + subroutine hinterp ( qin,iin,jin,qout,iout,jout,mlev,undef,method ) + implicit none + integer iin,jin, iout,jout, mlev + real qin(iin,jin,mlev), qout(iout,jout,mlev) + real undef,pi,dlin,dpin,dlout,dpout + real dlam(iin), lons(iout*jout), lon + real dphi(jin), lats(iout*jout), lat + integer i,j,loc,method + + pi = 4.0*atan(1.0) + dlin = 2*pi/iin + dpin = pi/(jin-1) + dlam(:) = dlin + dphi(:) = dpin + + dlout = 2*pi/iout + dpout = pi/(jout-1) + + loc = 0 + do j=1,jout + do i=1,iout + loc = loc + 1 + lon = -pi + (i-1)*dlout + lons(loc) = lon + enddo + enddo + + loc = 0 + do j=1,jout + lat = -pi/2.0 + (j-1)*dpout + do i=1,iout + loc = loc + 1 + lats(loc) = lat + enddo + enddo + + call interp_h ( qin,iin,jin,mlev,dlam,dphi,qout,iout*jout,lons,lats,undef,method ) + + return + end subroutine hinterp + + subroutine interp_h ( q_cmp,im,jm,lm,dlam,dphi,q_geo,irun,lon_geo,lat_geo,undef,method ) +!*********************************************************************** +! +! PURPOSE: +! ======== +! Performs a horizontal interpolation from a field on a computational grid +! to arbitrary locations. +! +! INPUT: +! ====== +! q_cmp ...... Field q_cmp(im,jm,lm) on the computational grid +! im ......... Longitudinal dimension of q_cmp +! jm ......... Latitudinal dimension of q_cmp +! lm ......... Vertical dimension of q_cmp +! dlam ....... Computational Grid Delta Lambda +! dphi ....... Computational Grid Delta Phi +! irun ....... Number of Output Locations +! lon_geo .... Longitude Location of Output +! lat_geo .... Latitude Location of Output +! +! OUTPUT: +! ======= +! q_geo ...... Field q_geo(irun,lm) at arbitrary locations +! +! +!*********************************************************************** +!* GODDARD LABORATORY FOR ATMOSPHERES * +!*********************************************************************** + + implicit none + +! Input Variables +! --------------- + integer im,jm,lm,irun + integer method + + real q_geo(irun,lm) + real lon_geo(irun) + real lat_geo(irun) + + real q_cmp(im,jm,lm) + real dlam(im) + real dphi(jm) + +! Local Variables +! --------------- + integer i,j,l + integer, allocatable :: ip1(:), ip0(:), im1(:), im2(:) + integer, allocatable :: jp1(:), jp0(:), jm1(:), jm2(:) + +! Bi-Linear Weights +! ----------------- + real, allocatable :: wl_ip0jp0 (:) + real, allocatable :: wl_im1jp0 (:) + real, allocatable :: wl_ip0jm1 (:) + real, allocatable :: wl_im1jm1 (:) + +! Bi-Cubic Weights +! ---------------- + real, allocatable :: wc_ip1jp1 (:) + real, allocatable :: wc_ip0jp1 (:) + real, allocatable :: wc_im1jp1 (:) + real, allocatable :: wc_im2jp1 (:) + real, allocatable :: wc_ip1jp0 (:) + real, allocatable :: wc_ip0jp0 (:) + real, allocatable :: wc_im1jp0 (:) + real, allocatable :: wc_im2jp0 (:) + real, allocatable :: wc_ip1jm1 (:) + real, allocatable :: wc_ip0jm1 (:) + real, allocatable :: wc_im1jm1 (:) + real, allocatable :: wc_im2jm1 (:) + real, allocatable :: wc_ip1jm2 (:) + real, allocatable :: wc_ip0jm2 (:) + real, allocatable :: wc_im1jm2 (:) + real, allocatable :: wc_im2jm2 (:) + + real ap1, ap0, am1, am2 + real bp1, bp0, bm1, bm2 + + real lon_cmp(im) + real lat_cmp(jm) + real q_tmp(irun) + + real pi,d + real lam,lam_ip1,lam_ip0,lam_im1,lam_im2 + real phi,phi_jp1,phi_jp0,phi_jm1,phi_jm2 + real dl,dp + real lam_cmp + real phi_cmp + real undef + integer im1_cmp,icmp + integer jm1_cmp,jcmp + +! Initialization +! -------------- + pi = 4.*atan(1.) + dl = 2*pi/ im ! Uniform Grid Delta Lambda + dp = pi/(jm-1) ! Uniform Grid Delta Phi + +! Allocate Memory for Weights and Index Locations +! ----------------------------------------------- + allocate ( wl_ip0jp0(irun) , wl_im1jp0(irun) ) + allocate ( wl_ip0jm1(irun) , wl_im1jm1(irun) ) + allocate ( wc_ip1jp1(irun) , wc_ip0jp1(irun) , wc_im1jp1(irun) , wc_im2jp1(irun) ) + allocate ( wc_ip1jp0(irun) , wc_ip0jp0(irun) , wc_im1jp0(irun) , wc_im2jp0(irun) ) + allocate ( wc_ip1jm1(irun) , wc_ip0jm1(irun) , wc_im1jm1(irun) , wc_im2jm1(irun) ) + allocate ( wc_ip1jm2(irun) , wc_ip0jm2(irun) , wc_im1jm2(irun) , wc_im2jm2(irun) ) + allocate ( ip1(irun) , ip0(irun) , im1(irun) , im2(irun) ) + allocate ( jp1(irun) , jp0(irun) , jm1(irun) , jm2(irun) ) + +! Compute Input Computational-Grid Latitude and Longitude Locations +! ----------------------------------------------------------------- + lon_cmp(1) = -pi + do i=2,im + lon_cmp(i) = lon_cmp(i-1) + dlam(i-1) + enddo + lat_cmp(1) = -pi*0.5 + do j=2,jm-1 + lat_cmp(j) = lat_cmp(j-1) + dphi(j-1) + enddo + lat_cmp(jm) = pi*0.5 + +! Compute Weights for Computational to Geophysical Grid Interpolation +! ------------------------------------------------------------------- + do i=1,irun + lam_cmp = lon_geo(i) + phi_cmp = lat_geo(i) + +! Determine Indexing Based on Computational Grid +! ---------------------------------------------- + im1_cmp = 1 + do icmp = 2,im + if( lon_cmp(icmp).lt.lam_cmp ) im1_cmp = icmp + enddo + jm1_cmp = 1 + do jcmp = 2,jm + if( lat_cmp(jcmp).lt.phi_cmp ) jm1_cmp = jcmp + enddo + + im1(i) = im1_cmp + ip0(i) = im1(i) + 1 + ip1(i) = ip0(i) + 1 + im2(i) = im1(i) - 1 + + jm1(i) = jm1_cmp + jp0(i) = jm1(i) + 1 + jp1(i) = jp0(i) + 1 + jm2(i) = jm1(i) - 1 + +! Fix Longitude Index Boundaries +! ------------------------------ + if(im1(i).eq.im) then + ip0(i) = 1 + ip1(i) = 2 + endif + if(im1(i).eq.1) then + im2(i) = im + endif + if(ip0(i).eq.im) then + ip1(i) = 1 + endif + + +! Compute Immediate Surrounding Coordinates +! ----------------------------------------- + lam = lam_cmp + phi = phi_cmp + +! Compute and Adjust Longitude Weights +! ------------------------------------ + lam_im2 = lon_cmp(im2(i)) + lam_im1 = lon_cmp(im1(i)) + lam_ip0 = lon_cmp(ip0(i)) + lam_ip1 = lon_cmp(ip1(i)) + + if( lam_im2.gt.lam_im1 ) lam_im2 = lam_im2 - 2*pi + if( lam_im1.gt.lam_ip0 ) lam_ip0 = lam_ip0 + 2*pi + if( lam_im1.gt.lam_ip1 ) lam_ip1 = lam_ip1 + 2*pi + if( lam_ip0.gt.lam_ip1 ) lam_ip1 = lam_ip1 + 2*pi + + +! Compute and Adjust Latitude Weights +! Note: Latitude Index Boundaries are Adjusted during Interpolation +! ------------------------------------------------------------------ + phi_jm2 = lat_cmp( min(max(1,jm2(i)),jm) ) + phi_jm1 = lat_cmp( min(max(1,jm1(i)),jm) ) + phi_jp0 = lat_cmp( min(max(1,jp0(i)),jm) ) + phi_jp1 = lat_cmp( min(max(1,jp1(i)),jm) ) + + if( jm2(i).eq.0 ) phi_jm2 = phi_jm1 - dphi(1) + if( jm1(i).eq.jm ) then + phi_jp0 = phi_jm1 + dphi(jm-1) + phi_jp1 = phi_jp0 + dphi(jm-2) + endif + if( jp1(i).eq.jm+1 ) phi_jp1 = phi_jp0 + dphi(jm-1) + + +! Bi-Linear Weights +! ----------------- + d = (lam_ip0-lam_im1)*(phi_jp0-phi_jm1) + wl_im1jm1(i) = (lam_ip0-lam )*(phi_jp0-phi )/d + wl_ip0jm1(i) = (lam -lam_im1)*(phi_jp0-phi )/d + wl_im1jp0(i) = (lam_ip0-lam )*(phi -phi_jm1)/d + wl_ip0jp0(i) = (lam -lam_im1)*(phi -phi_jm1)/d + +! Bi-Cubic Weights +! ---------------- + ap1 = ( (lam -lam_ip0)*(lam -lam_im1)*(lam -lam_im2) ) & + / ( (lam_ip1-lam_ip0)*(lam_ip1-lam_im1)*(lam_ip1-lam_im2) ) + ap0 = ( (lam_ip1-lam )*(lam -lam_im1)*(lam -lam_im2) ) & + / ( (lam_ip1-lam_ip0)*(lam_ip0-lam_im1)*(lam_ip0-lam_im2) ) + am1 = ( (lam_ip1-lam )*(lam_ip0-lam )*(lam -lam_im2) ) & + / ( (lam_ip1-lam_im1)*(lam_ip0-lam_im1)*(lam_im1-lam_im2) ) + am2 = ( (lam_ip1-lam )*(lam_ip0-lam )*(lam_im1-lam ) ) & + / ( (lam_ip1-lam_im2)*(lam_ip0-lam_im2)*(lam_im1-lam_im2) ) + + bp1 = ( (phi -phi_jp0)*(phi -phi_jm1)*(phi -phi_jm2) ) & + / ( (phi_jp1-phi_jp0)*(phi_jp1-phi_jm1)*(phi_jp1-phi_jm2) ) + bp0 = ( (phi_jp1-phi )*(phi -phi_jm1)*(phi -phi_jm2) ) & + / ( (phi_jp1-phi_jp0)*(phi_jp0-phi_jm1)*(phi_jp0-phi_jm2) ) + bm1 = ( (phi_jp1-phi )*(phi_jp0-phi )*(phi -phi_jm2) ) & + / ( (phi_jp1-phi_jm1)*(phi_jp0-phi_jm1)*(phi_jm1-phi_jm2) ) + bm2 = ( (phi_jp1-phi )*(phi_jp0-phi )*(phi_jm1-phi ) ) & + / ( (phi_jp1-phi_jm2)*(phi_jp0-phi_jm2)*(phi_jm1-phi_jm2) ) + + wc_ip1jp1(i) = bp1*ap1 + wc_ip0jp1(i) = bp1*ap0 + wc_im1jp1(i) = bp1*am1 + wc_im2jp1(i) = bp1*am2 + + wc_ip1jp0(i) = bp0*ap1 + wc_ip0jp0(i) = bp0*ap0 + wc_im1jp0(i) = bp0*am1 + wc_im2jp0(i) = bp0*am2 + + wc_ip1jm1(i) = bm1*ap1 + wc_ip0jm1(i) = bm1*ap0 + wc_im1jm1(i) = bm1*am1 + wc_im2jm1(i) = bm1*am2 + + wc_ip1jm2(i) = bm2*ap1 + wc_ip0jm2(i) = bm2*ap0 + wc_im1jm2(i) = bm2*am1 + wc_im2jm2(i) = bm2*am2 + + enddo + +! Interpolate Computational-Grid Quantities to Geophysical Grid +! ------------------------------------------------------------- + do L=1,lm + do i=1,irun + + if( lat_geo(i).le.lat_cmp(2) .or. & + lat_geo(i).ge.lat_cmp(jm-1) .or. & + method.eq.1 ) then + +! 1st Order Interpolation at Poles +! -------------------------------- + if( q_cmp( im1(i),jm1(i),L ).ne.undef .and. & + q_cmp( ip0(i),jm1(i),L ).ne.undef .and. & + q_cmp( im1(i),jp0(i),L ).ne.undef .and. & + q_cmp( ip0(i),jp0(i),L ).ne.undef ) then + + q_tmp(i) = wl_im1jm1(i) * q_cmp( im1(i),jm1(i),L ) & + + wl_ip0jm1(i) * q_cmp( ip0(i),jm1(i),L ) & + + wl_im1jp0(i) * q_cmp( im1(i),jp0(i),L ) & + + wl_ip0jp0(i) * q_cmp( ip0(i),jp0(i),L ) + + else + q_tmp(i) = undef + endif + + else + +! Cubic Interpolation away from Poles +! ----------------------------------- + if( q_cmp( ip1(i),jp0(i),L ).ne.undef .and. & + q_cmp( ip0(i),jp0(i),L ).ne.undef .and. & + q_cmp( im1(i),jp0(i),L ).ne.undef .and. & + q_cmp( im2(i),jp0(i),L ).ne.undef .and. & + + q_cmp( ip1(i),jm1(i),L ).ne.undef .and. & + q_cmp( ip0(i),jm1(i),L ).ne.undef .and. & + q_cmp( im1(i),jm1(i),L ).ne.undef .and. & + q_cmp( im2(i),jm1(i),L ).ne.undef .and. & + + q_cmp( ip1(i),jp1(i),L ).ne.undef .and. & + q_cmp( ip0(i),jp1(i),L ).ne.undef .and. & + q_cmp( im1(i),jp1(i),L ).ne.undef .and. & + q_cmp( im2(i),jp1(i),L ).ne.undef .and. & + + q_cmp( ip1(i),jm2(i),L ).ne.undef .and. & + q_cmp( ip0(i),jm2(i),L ).ne.undef .and. & + q_cmp( im1(i),jm2(i),L ).ne.undef .and. & + q_cmp( im2(i),jm2(i),L ).ne.undef ) then + + q_tmp(i) = wc_ip1jp1(i) * q_cmp( ip1(i),jp1(i),L ) & + + wc_ip0jp1(i) * q_cmp( ip0(i),jp1(i),L ) & + + wc_im1jp1(i) * q_cmp( im1(i),jp1(i),L ) & + + wc_im2jp1(i) * q_cmp( im2(i),jp1(i),L ) & + + + wc_ip1jp0(i) * q_cmp( ip1(i),jp0(i),L ) & + + wc_ip0jp0(i) * q_cmp( ip0(i),jp0(i),L ) & + + wc_im1jp0(i) * q_cmp( im1(i),jp0(i),L ) & + + wc_im2jp0(i) * q_cmp( im2(i),jp0(i),L ) & + + + wc_ip1jm1(i) * q_cmp( ip1(i),jm1(i),L ) & + + wc_ip0jm1(i) * q_cmp( ip0(i),jm1(i),L ) & + + wc_im1jm1(i) * q_cmp( im1(i),jm1(i),L ) & + + wc_im2jm1(i) * q_cmp( im2(i),jm1(i),L ) & + + + wc_ip1jm2(i) * q_cmp( ip1(i),jm2(i),L ) & + + wc_ip0jm2(i) * q_cmp( ip0(i),jm2(i),L ) & + + wc_im1jm2(i) * q_cmp( im1(i),jm2(i),L ) & + + wc_im2jm2(i) * q_cmp( im2(i),jm2(i),L ) + + elseif( q_cmp( im1(i),jm1(i),L ).ne.undef .and. & + q_cmp( ip0(i),jm1(i),L ).ne.undef .and. & + q_cmp( im1(i),jp0(i),L ).ne.undef .and. & + q_cmp( ip0(i),jp0(i),L ).ne.undef ) then + + q_tmp(i) = wl_im1jm1(i) * q_cmp( im1(i),jm1(i),L ) & + + wl_ip0jm1(i) * q_cmp( ip0(i),jm1(i),L ) & + + wl_im1jp0(i) * q_cmp( im1(i),jp0(i),L ) & + + wl_ip0jp0(i) * q_cmp( ip0(i),jp0(i),L ) + + else + q_tmp(i) = undef + endif + + endif + enddo + +! Load Temp array into Output array +! --------------------------------- + do i=1,irun + q_geo(i,L) = q_tmp(i) + enddo + enddo + + deallocate ( wl_ip0jp0 , wl_im1jp0 ) + deallocate ( wl_ip0jm1 , wl_im1jm1 ) + deallocate ( wc_ip1jp1 , wc_ip0jp1 , wc_im1jp1 , wc_im2jp1 ) + deallocate ( wc_ip1jp0 , wc_ip0jp0 , wc_im1jp0 , wc_im2jp0 ) + deallocate ( wc_ip1jm1 , wc_ip0jm1 , wc_im1jm1 , wc_im2jm1 ) + deallocate ( wc_ip1jm2 , wc_ip0jm2 , wc_im1jm2 , wc_im2jm2 ) + deallocate ( ip1 , ip0 , im1 , im2 ) + deallocate ( jp1 , jp0 , jm1 , jm2 ) + + return + end subroutine interp_h + + subroutine usage() + write(*, '()' ) + write(*, '(" Usage: ")' ) + write(*, '(" ------ ")' ) + write(*, '(" 3CH.x -exp1 expid plus filelist for 1st 3CH Triplet member (exp1:exp2:exp3)")' ) + write(*, '(" -exp2 expid plus filelist for 2nd 3CH Triplet member (exp1:exp2:exp3)")' ) + write(*, '(" -exp3 expid plus filelist for 3rd 3CH Triplet member (exp1:exp2:exp3)")' ) + write(*, '()' ) + write(*, '(" -nymdb Beginning Date for 3CH computation")' ) + write(*, '(" -nhmsb Beginning Time for 3CH computation")' ) + write(*, '(" -nymde Ending Date for 3CH computation")' ) + write(*, '(" -nhmse Ending Time for 3CH computation")' ) + write(*, '()' ) + write(*, '(" Optional Arguments: ")' ) + write(*, '(" ------------------- ")' ) + write(*, '(" <-exp4 expid plus filelist for 3rd 3CH Triplet member of 2nd Triplet (exp1:exp2:exp4)>")' ) + write(*, '(" <-exp5 expid plus filelist for 3rd 3CH Triplet member of 3rd Triplet (exp1:exp2:exp5)>")' ) + write(*, '(" .")' ) + write(*, '(" .")' ) + write(*, '(" <-expN expid plus filelist for 3rd 3CH Triplet member of N-2 Triplet (exp1:exp2:expN)>")' ) + write(*, '()' ) + write(*, '(" <-ndt Time Frequency in seconds (Default: 21600)>")' ) + write(*, '()' ) + write(*, '(" <-levs levels used for 3CH computation (e.g., 1000 925 850 700 ) (Default: ALL coincident levels)>")' ) + write(*, '(" <-fields fields used for 3CH computation (Default: u v t q h)>")' ) + write(*, '(" <-im Longitudinal Dimension for Output (Default: Minimum among input experiments)>")' ) + write(*, '(" <-jm Latitudinal Dimension for Output (Default: Minimum among input experiments)>")' ) + write(*, '()' ) + write(*, '(" <-method 1 => Bilinear Interpolation (Default)")' ) + write(*, '(" 2 => BiCubic Interpolation")' ) + write(*, '(" 3 => Box-Average Interpolation")' ) + write(*, '()' ) + write(*, '(" <-tag tag used for Output Filename (Default: grads)>")' ) + write(*, '()' ) + write(*, '(" creates: tag.data")' ) + write(*, '(" -------- tag.ctl")' ) + write(*, '()' ) + write(*, '(" Contains 3-D fields of 3CH Variance Error Estimates for each Triplet Member: var(expN error),")' ) + write(*, '(" plus full 3-D fields of Member Means: ave(expN), Variance Differences: var(expM-expN)")' ) + write(*, '(" and 3-D fields of Mean Square Error Decomposition: Total, Bias, Amplitude, Phase)")' ) + write(*, '()' ) + error stop 7 + end subroutine usage + diff --git a/GEOS_Util/post/3CH.j b/GEOS_Util/post/3CH.j new file mode 100755 index 00000000..61078545 --- /dev/null +++ b/GEOS_Util/post/3CH.j @@ -0,0 +1,100 @@ +#!/bin/csh -f + +unsetenv LD_LIBRARY_PATH + +setenv ARCH `uname` +setenv GEOSBIN @BINARY_INSTALL_DIR@ +source $GEOSBIN/g5_modules +setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${BASEDIR}/${ARCH}/lib + +setenv RUN_CMD "$GEOSBIN/esma_mpirun -np " + +if ($?SLURM_NTASKS) then + set NCPUS = $SLURM_NTASKS +else + set NCPUS = 1 +endif + +# ---------------------------------------------------- +# Define Experiment IDs, Locations, and Relevant Files +# ---------------------------------------------------- + +set nymdb = `cat 3CH.rc | grep -v \# | grep nymdb: | cut -d: -f2` +set nhmsb = `cat 3CH.rc | grep -v \# | grep nhmsb: | cut -d: -f2` +set nymde = `cat 3CH.rc | grep -v \# | grep nymde: | cut -d: -f2` +set nhmse = `cat 3CH.rc | grep -v \# | grep nhmse: | cut -d: -f2` +set ndt = `cat 3CH.rc | grep -v \# | grep ndt: | cut -d: -f2` + +if( $ndt == '' ) set ndt = 21600 + +@ numexps = `cat 3CH.rc | grep -v \# | grep expid_ | wc -l` +set command_line = " " + +@ n = 1 +while( $n <= $numexps ) +set expid = `cat 3CH.rc | grep -v \# | grep expid_$n | cut -d: -f2` +set files = `cat 3CH.rc | grep -v \# | grep files_$n | cut -d: -f2` + +/bin/rm -f exp_files.$n +touch exp_files.$n + +set command_line = "$command_line -exp"$n" $expid " + +set nymd = $nymdb +set nhms = 000000 +while( $nymd <= $nymde ) + set year = `echo $nymd | cut -b1-4` + set month = `echo $nymd | cut -b5-6` + set day = `echo $nymd | cut -b7-8` + set hour = `echo $nhms | cut -b1-2` + set dir = `echo $files | sed -e "s/%y4/$year/g" | sed -e "s/%m2/$month/g" | sed -e "s/%d2/$day/g" | sed -e "s/%h2/$hour/g"` + echo Looking for $dir ... + set list = `/bin/ls -1 ${dir}* | grep -v daily_mean` + echo $list >> exp_files.$n + set date = `tick $nymd $nhms $ndt` + set nymd = $date[1] + set nhms = $date[2] +end +set dum = `cat exp_files.$n` + +set command_line = "$command_line $dum " + +echo " " +@ n = $n + 1 +end + +/bin/rm -f exp_files.* + +set im = `cat 3CH.rc | grep -v \# | grep im: | cut -d: -f2` ; if( "$im" != '' ) set im = "-im $im" +set jm = `cat 3CH.rc | grep -v \# | grep jm: | cut -d: -f2` ; if( "$jm" != '' ) set jm = "-jm $jm" +set levs = `cat 3CH.rc | grep -v \# | grep levs: | cut -d: -f2` ; if( "$levs" != '' ) set levs = "-levs $levs" +set fields = `cat 3CH.rc | grep -v \# | grep fields: | cut -d: -f2` ; if( "$fields" != '' ) set fields = "-fields $fields" + +set method = `cat 3CH.rc | grep -v \# | grep interpolation_method: | cut -d: -f2` + +if($method != '' ) then + if( $method == 'BL' ) set method = "-method 1" + if( $method == 'BC' ) set method = "-method 2" + if( $method == 'BA' ) set method = "-method 3" +endif + +# ---------------------------------------------------- +# Perform 3CH Calculation +# ---------------------------------------------------- + +$RUN_CMD $NCPUS $GEOSBIN/3CH_mpi.x $command_line $im $jm $levs $fields $method \ + -nymdb $nymdb -nhmsb $nhmsb -nymde $nymde -nhmse $nhmse -ndt $ndt + +# ---------------------------------------------------- +# Convert grads to nc4 file +# ---------------------------------------------------- + +set ctl_files = `/bin/ls -1t *ctl` +set ctl_file = $ctl_files[1] +set length = `echo $ctl_file | awk '{print length($0)}'` +@ loc = $length - 4 +set newfile = `echo $ctl_file | cut -b1-$loc` +echo Newfile = $newfile + +$GEOSBIN/flat2hdf.x -flat $newfile.data -ctl $newfile.ctl -nymd $nymdb -nhms $nhmsb -ndt $ndt + diff --git a/GEOS_Util/post/3CH.rc b/GEOS_Util/post/3CH.rc new file mode 100644 index 00000000..e63a5b03 --- /dev/null +++ b/GEOS_Util/post/3CH.rc @@ -0,0 +1,77 @@ +# -------------------------------------------------------------------------------------------------------------- +# Required Parameters +# ------------------- +# expid_1: expid for 1st 3CH Triplet member (exp1:exp2:exp3) +# files_1: file location and name for 1st 3CH Triplet member (exp1:exp2:exp3) +# +# expid_2: expid for 2nd 3CH Triplet member (exp1:exp2:exp3) +# files_2: file location and name for 2nd 3CH Triplet member (exp1:exp2:exp3) +# +# expid_3: expid for 3rd 3CH Triplet member (exp1:exp2:exp3) +# files_3: file location and name for 3rd 3CH Triplet member (exp1:exp2:exp3) +# +# nymdb: Beginning Date for 3CH computation +# nhmsb: Beginning Time for 3CH computation +# nymde: Ending Date for 3CH computation +# nhmse: Ending Time for 3CH computation + +# Optional Parameters +# ------------------- +# ( for N=4,5,... ) +# expid_N: expid for 3rd 3CH Triplet member of N-2 Triplet (exp1:exp2:expN) +# files_N: file location and name for 3rd 3CH Triplet member of N-2 Triplet (exp1:exp2:expN) +# +# ndt: Time Frequency in seconds (Default: 21600) +# +# levs: levels used for 3CH computation (e.g., 1000 925 850 700 ) (Default: ALL coincident levels) +# fields: fields used for 3CH computation (Default: u v t q h p) +# im: Longitudinal Dimension for Output (Default: Minimum among input experiments) +# jm: Latitudinal Dimension for Output (Default: Minimum among input experiments) +# +# interpolation_method: BL => Bilinear Interpolation (Default) +# BC => BiCubic Interpolation +# BA => Box-Average Interpolation +# +# creates: nc4 file which contains +# 3-D fields of 3CH Variance Error Estimates for each Triplet Member: var(expN error), +# plus full 3-D fields of Member Means: ave(expN), Variance Differences: var(expM-expN) +# and 3-D fields of Mean Square Error Decomposition: Total, Bias, Amplitude, Phase +# +# -------------------------------------------------------------------------------------------------------------- + + +# Required Parameters (One Complete Triplet Set + Dates of Interest) +# ------------------------------------------------------------------ + expid_1: GFS + files_1: /discover/nobackup/projects/gmao/g6dev/ltakacs/GFS/analysis/Y%y4/M%m2/gfs.0.5x0.5_L47.%y4%m2%d2_%h2z.nc4 + + expid_2: ECOPS + files_2: /discover/nobackup/projects/gmao/g6dev/ltakacs/ecmwf/Y%y4/M%m2/ecmwf.1x125_14_levels.%y4%m2%d2_%h2z.nc4 + + expid_3: f5271_fp + files_3: /discover/nobackup/projects/gmao/g6dev/ltakacs/f5271_fp/f5271_fp.inst3_3d_asm_Np.%y4%m2%d2_%h200z.nc4 + + expid_4: prePP + files_4: /discover/nobackup/projects/gmao/dadev/rtodling/archive/prePP/diag/Y2021/M10/prePP.inst3_3d_asm_Np.%y4%m2%d2_%h200z.nc4 + +# expid_2: ERA5 +# files_2: /discover/nobackup/projects/gmao/g6dev/sdrabenh/validation_data/era5/pres_levels_daily/Y%y4/M%m2/era5_pl-allvar.%y4%m2%d2_%h2z.nc4 +# files_2: /discover/nobackup/projects/gmao/g6dev/sdrabenh/validation_data/era5/pres_levels_daily/Y%y4/M%m2/era5_mrg_selvar_4dly.%y4%m2%d2_%h2z.nc4 + +# expid_3: MERRA2 +# files_3: /gpfsm/dnb55/projects/p136/aelakkra/archive/LevSubset/merra2/Y%y4/M%m2/MERRA-2.inst3_3d_asm_Np.%y4%m2%d2_%h200z.levsubset.nc4 + +# expid_3: f522_fp +# files_3: /gpfsm/dnb55/projects/p136/aelakkra/archive/LevSubset/f522_fp/Y%y4/M%m2/f522_fp.inst3_3d_asm_Np.%y4%m2%d2_%h200z.levsubset.nc4 + +# expid_4: f525_fp +# files_4: /gpfsm/dnb55/projects/p136/aelakkra/archive/LevSubset/f525_p7_fp/Y%y4/M%m2/f525_p7_fp.inst3_3d_asm_Np.%y4%m2%d2_%h200z.levsubset.nc4 + + nymdb: 20211001 + nhmsb: 000000 + nymde: 20211031 + nhmse: 180000 + +# fields: q +# im: 576 +# jm: 361 diff --git a/GEOS_Util/post/CMakeLists.txt b/GEOS_Util/post/CMakeLists.txt index ccb4c086..f20b76bc 100644 --- a/GEOS_Util/post/CMakeLists.txt +++ b/GEOS_Util/post/CMakeLists.txt @@ -28,14 +28,23 @@ ecbuild_add_executable (TARGET binarytile.x SOURCES binarytile.F90) ecbuild_add_executable (TARGET rs_numtiles.x SOURCES rs_numtiles.F90) ecbuild_add_executable (TARGET rs_vinterp.x SOURCES rs_vinterp.F90) ecbuild_add_executable (TARGET rs_vinterp_scm.x SOURCES rs_vinterp_scm.F90) + ecbuild_add_executable (TARGET stats.x SOURCES stats.F90) if (DISABLE_FIELD_WIDTH_WARNING) set_target_properties (stats.x PROPERTIES COMPILE_FLAGS ${DISABLE_FIELD_WIDTH_WARNING}) endif () set_target_properties (stats.x PROPERTIES COMPILE_FLAGS "${BIG_ENDIAN}") +set_target_properties(stats.x PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}}) + ecbuild_add_executable (TARGET convert_aerosols.x SOURCES convert_aerosols.F) +ecbuild_add_executable (TARGET 3CH_mpi.x SOURCES 3CH.F90) -file(GLOB perlscripts *.pl) +set (perlscripts + ecmwf2geos.pl + g5fcst_stats.pl + ncep2geos.pl + regrid.pl + ) install( PROGRAMS ${perlscripts} ec2grd.csh DESTINATION bin) @@ -43,6 +52,7 @@ install( set_property(SOURCE rsg3_vinterp.F APPEND_STRING PROPERTY COMPILE_FLAGS "${FREAL8} ${BYTERECLEN} ${EXTENDED_SOURCE}") set_property(SOURCE rs_vinterp.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "${FREAL8} ${BYTERECLEN}") set_property(SOURCE rs_vinterp_scm.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "${FREAL8} ${BYTERECLEN}") +set_property(SOURCE 3CH.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "${BYTERECLEN} ${EXTENDED_SOURCE}") set_property(SOURCE dynamics_lattice_module.F APPEND_STRING PROPERTY COMPILE_FLAGS "${BYTERECLEN} ${EXTENDED_SOURCE}") set_property(SOURCE mpi_util.F APPEND_STRING PROPERTY COMPILE_FLAGS "${BYTERECLEN} ${EXTENDED_SOURCE}") @@ -81,6 +91,7 @@ target_link_libraries (flat2hdf.x post_nompi GMAO_gfio_r4) target_link_libraries (gg2fv.x post) target_link_libraries (rs2hdf.x post) target_link_libraries (time_ave.x ${this} GMAO_gfio_r4 MAPL ) +target_link_libraries (3CH_mpi.x ${this} GMAO_gfio_r4 ${MPI_Fortran_LIBRARIES}) target_link_libraries (rsg3_vinterp.x ${this} GMAO_hermes) target_link_libraries (rs_vinterp.x ${this} GMAO_hermes) @@ -133,6 +144,7 @@ set (post_rc post.rc stats.rc time_ave.rc + 3CH.rc ) install ( @@ -144,3 +156,11 @@ install ( FILES stats.rc time_ave.rc DESTINATION etc ) + +# 3CH.j needs to know where we install +set(BINARY_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin") +configure_file(3CH.j 3CH.j @ONLY) +install(PROGRAMS + ${CMAKE_CURRENT_BINARY_DIR}/3CH.j + DESTINATION post + ) diff --git a/GEOS_Util/post/alias.F b/GEOS_Util/post/alias.F index 97d7e55f..8ee43a87 100644 --- a/GEOS_Util/post/alias.F +++ b/GEOS_Util/post/alias.F @@ -56,6 +56,11 @@ function match (name,alias) if( trim(alias) == 'HGT' ) match = .true. endif + if( trim(name) == 'gz' ) then + if( trim(alias) == 'gz' ) match = .true. + if( trim(alias) == 'GZ' ) match = .true. + endif + if( trim(name) == 'th' ) then if( trim(alias) == 'th' ) match = .true. if( trim(alias) == 'TH' ) match = .true. @@ -78,6 +83,8 @@ function match (name,alias) if( trim(name) == 'ps' ) then if( trim(alias) == 'ps' ) match = .true. if( trim(alias) == 'PS' ) match = .true. + if( trim(alias) == 'sp' ) match = .true. + if( trim(alias) == 'SP' ) match = .true. endif if( trim(name) == 'dp' ) then @@ -112,6 +119,8 @@ function match (name,alias) if( trim(alias) == 'PRMSLMSL') match = .true. if( trim(alias) == 'prmsl' ) match = .true. if( trim(alias) == 'PRMSL' ) match = .true. + if( trim(alias) == 'msl' ) match = .true. + if( trim(alias) == 'MSL' ) match = .true. endif return diff --git a/GEOS_Util/post/alias.com b/GEOS_Util/post/alias.com index d6e2563e..2559e13f 100644 --- a/GEOS_Util/post/alias.com +++ b/GEOS_Util/post/alias.com @@ -9,6 +9,7 @@ character*256, parameter :: c_t = 't' character*256, parameter :: c_q = 'q' character*256, parameter :: c_h = 'h' + character*256, parameter :: c_gz = 'gz' character*256, parameter :: c_th = 'th' character*256, parameter :: c_tv = 'tv' character*256, parameter :: c_thv = 'thv' diff --git a/GEOS_Util/post/binarytile.F90 b/GEOS_Util/post/binarytile.F90 index b04207bc..9fc2d219 100644 --- a/GEOS_Util/post/binarytile.F90 +++ b/GEOS_Util/post/binarytile.F90 @@ -7,15 +7,17 @@ Program binarytile integer, parameter :: NumGlobalVars=4 integer, parameter :: NumGridVars=3 integer :: N - integer :: NT + integer :: NT, NPFAF, line_size integer :: IM integer :: JM - integer :: N_GRIDS + integer :: N_GRIDS,pfaf_number + integer :: grid_info(2),status real, allocatable :: AVR(:,:) real :: DUMMY character(len=128) :: NAME character(len=128) :: filenameIN - character(len=128) :: filenameOUT + character(len=128) :: filenameOUT + integer, parameter :: max_rec=2 call getarg(1,filenameIN) if (filenameIN == "") filenameIN = 'input' @@ -24,8 +26,21 @@ Program binarytile open(unit=unitR, file=filenameIN, form='FORMATTED') open(unit=unitW, file=filenameOUT,form='UNFORMATTED') - READ (unitR, *) NT - WRITE(unitW ) NT + !READ (unitR, *) NT, NPFAF + !WRITE(unitW ) NT, NPFAF + +! Number of grids that can be attached +!------------------------------------- + + grid_info(2)=-1 + do n=1,max_rec + rewind(unitR) + read(unitR,*,iostat=status)grid_info(1:n) + if (status<0) exit + enddo + nt=grid_info(1) + !pfaf_number=grid_info(2) + WRITE (unitW) grid_info ! Number of grids that can be attached !------------------------------------- diff --git a/GEOS_Util/post/g5fcst_stats.pl b/GEOS_Util/post/g5fcst_stats.pl index b1c7d8d3..436601c4 100755 --- a/GEOS_Util/post/g5fcst_stats.pl +++ b/GEOS_Util/post/g5fcst_stats.pl @@ -21,7 +21,9 @@ # global variables #----------------- -my ($anadir, $arcfile, $archiveFLG, $dasFLG, $dryrun, $etcdir); +my ($EXP_ARCHIVE); +my ($EXP_DATAMOVE_CONSTRAINT); +my ($anadir, $arcfile, $archiveFLG, $dasFLG, $nodes, $dryrun, $etcdir); my ($expid, $fhours, $fhours_dflt, $fs_tag, $fv_etcdir); my ($idate, $ihh, $jobdir, $localID, $ncsuffix, $ndays, $noprompt, $nver); my ($offset_sec, $pesto, $progdir, $progtype, $secs_per_day, $secs_per_hour); @@ -43,7 +45,7 @@ my ($fdir, $file, $getlist, $ffile, $ffile0, $fname, $fstatswork); my ($mm, $mm1, $ndate, $ndd, $ndy, $nmm, $ntime, $nv, $nyyyy); my ($pid, $vdate, $vdate0, $vdate1, $vdd, $vhh, $vhh0, $vhh1); - my ($vmm, $vtime, $vyyyy, $yyyy, $yyyy1); + my ($vmm, $vmn, $vtime, $vyyyy, $yyyy, $yyyy1); my (%args, %fcsthash, %pesto_dirs, %vanahash); my (@alist, @ana_fnames, @climfiles, @fcst_fnames, @fcstlist, @fcstget); my (@pesto_dir_list, @rmlist, @vanalist, @vanaget); @@ -117,7 +119,7 @@ # for labeling output and log files #---------------------------------- $vdate1 = $vdate; - $vhh1 = extract_hh($vtime); + ($vhh1, $vmn) = extract_hh_mn($vtime); # save initial verification date/time from first forecast # for labeling archive log @@ -129,11 +131,11 @@ foreach $nv (1..$nver) { ($vyyyy, $vmm, $vdd) = extract_yyyy_mm_dd($vdate); - $vhh = extract_hh($vtime); + ($vhh, $vmn) = extract_hh_mn($vtime); if ($ihh eq "00" and $nv == 1) { $fdir = "$vanadir/Y$nyyyy/M$nmm"; - $fname = "$vexpid.$vanatype.inst3d_met_p.${vdate}_${vhh}z"; + $fname = "$vexpid.$vanatype.inst3d_met_p.${vdate}_${vhh}${vmn}z"; $ffile0 = "$fdir/$fname$ncsuffix"; } else { @@ -142,11 +144,11 @@ #---------------------------------------------------------- if ($progtype eq "ana") { $fdir = "$anadir/Y$vyyyy/M$vmm"; - $fname = "$expid.ana.inst3d_met_p.${vdate}_${vhh}z"; + $fname = "$expid.ana.inst3d_met_p.${vdate}_${vhh}${vmn}z"; } else { $fdir = "$progdir/Y$nyyyy/M$nmm/D$ndd/H$ihh"; - $fname = "$expid.prog.$progtype.${ndate}_${ihh}z+${vdate}_${vhh}z"; + $fname = "$expid.prog.$progtype.${ndate}_${ihh}z+${vdate}_${vhh}${vmn}z"; } } $ffile = "$fdir/$fname$ncsuffix"; @@ -159,12 +161,13 @@ # multiple naming convention options #----------------------------------- @alist = (); - if ($vexpid eq "gfs" or $vexpid eq "ecmwf") { + if ($vexpid eq "gfs" or $vexpid eq "ecmwf" or $vexpid eq "era5") { push @alist, "$vexpid.$vanatype.${vdate}_${vhh}00z"; push @alist, "$vexpid.$vanatype.${vdate}_${vhh}z+${vdate}_${vhh}z"; + push @alist, "$vexpid.$vanatype.${vdate}_${vhh}z+${vdate}_${vhh}${vmn}z"; } else { - push @alist, "$vexpid.$vanatype.inst3d_met_p.${vdate}_${vhh}z"; + push @alist, "$vexpid.$vanatype.inst3d_met_p.${vdate}_${vhh}${vmn}z"; } # loop through naming convention options @@ -200,7 +203,7 @@ # get fcst and ana filenames #--------------------------- - if ($vexpid eq "g5ncep" or $vexpid eq "gfs" or $vexpid eq "ecmwf") { + if ($vexpid eq "g5ncep" or $vexpid eq "gfs" or $vexpid eq "ecmwf" or $vexpid eq "era5") { if ($progtype eq "ana") { push @fcst_fnames, "$expid.ana.inst3d_met_p.*$ncsuffix"; push @ana_fnames, "$vexpid.$vanatype.*$ncsuffix"; @@ -264,6 +267,8 @@ copy $file, $fstatswork or die "Error. copy failed: $file; $!"; } + $nodes = "null" unless $nodes; + # store calling arguments in a hash #---------------------------------- $args{"ana_fnames_addr"} = \@ana_fnames; @@ -276,6 +281,7 @@ $args{"vdate1"} = $vdate1; $args{"vhh0"} = $vhh0; $args{"vhh1"} = $vhh1; + $args{"nodes"} = $nodes; # submit job to calculate stats #------------------------------ @@ -310,6 +316,11 @@ sub init { $ENV{"PATH"} = ".:$Bin:$ENV{PATH}"; do "g5_modules_perl_wrapper"; + $EXP_ARCHIVE = $ENV{"ARCHIVE"}; + $EXP_ARCHIVE = $ENV{"FVARCH"} if $ENV{"FVARCH"}; + + $EXP_DATAMOVE_CONSTRAINT = $ENV{"DATAMOVE_CONSTRAINT"}; + # flush buffer after each output operation #----------------------------------------- $| = 1; @@ -331,6 +342,8 @@ sub init { "storedir=s" => \$storedir, "archive!" => \$archiveFLG, + "nodes=s" => \$nodes, + "das" => \$dasFLG, "np" => \$noprompt, @@ -414,15 +427,15 @@ sub init { # get $anadir and $progdir #------------------------- - $anadir = "$ENV{ARCHIVE}/$expid/ana" unless $anadir; + $anadir = "$EXP_ARCHIVE/$expid/ana" unless $anadir; until (-d $anadir) { unless ($noprompt) { print "ANA directory does not exist: $anadir\n\n"; - $anadir = query("forecast ana directory:", $anadir); + $anadir = query("verification ana directory:", $anadir); } - else { die "forecast ana directory does not exist: $anadir;" } + #else { die "verification ana directory does not exist: $anadir;" } } - $progdir = dirname($anadir) ."/prog" unless $progdir; + $progdir = "$EXP_ARCHIVE/$expid/prog" unless $progdir; until (-d $progdir) { unless ($noprompt) { print "forecase prog directory does not exist: $progdir\n\n"; @@ -462,14 +475,17 @@ sub init { # determine fs_tag #-------------------- - $fs_tag = "fstats_$vanatype"; + $fs_tag = "fstats_${vexpid}_$vanatype"; if ($vanatype eq "inst3_3d_ana_Np") { $fs_tag = "fstats_ana" } - if ($vexpid eq "dctl573" or $vexpid eq "dhyb573a") { - $vanadir = "/archive/u/aelakkra/$vexpid/ana"; + if ($vexpid eq "era5") { + $fs_tag = "fstats_era5"; + if ($progtype eq "ana") { + $fs_tag = "astats_era5"; + } } elsif ($vexpid eq "ecmwf") { $fs_tag = "fstats_ecmwf"; @@ -534,7 +550,7 @@ sub init { #======================================================================= sub das_check { my ($ndate, $ntime); - my ($calculate_stats, $fdatetime, $FVHOME, $dotSUBMITTED); + my ($calculate_stats, $fdatetime, $FVHOME, $dotDONEFCST); my ($ddate, $dtime, $ddatetime, $dotDONE, %notfound); $ndate = shift @_; @@ -548,13 +564,13 @@ sub das_check { die "Error. FVHOME environment variable not defined;" unless $FVHOME; die "Error. Cannot find FVHOME directory: $FVHOME;" unless -d $FVHOME; - # check for fcst SUBMITTED hidden file + # check for fcst DONE hidden file #------------------------------------- $fdatetime = "${ndate}_" .substr($ntime, 0, 2) ."z"; - $dotSUBMITTED = "$ENV{FVHOME}/fcst/.SUBMITTED.$fdatetime"; - unless (-e $dotSUBMITTED) { + $dotDONEFCST = "$ENV{FVHOME}/fcst/.DONE_FCST.$fdatetime"; + unless (-e $dotDONEFCST) { print "\nCannot find forecast hidden file:\n" - . "- $dotSUBMITTED\n\n"; + . "- $dotDONEFCST\n\n"; $calculate_stats = 0; } @@ -585,12 +601,6 @@ sub das_check { #======================================================================= # name - write_g5fcst_stats_arc # purpose - write the g5fcst_stats.arc file -# -# NOTE: -# The fstats_inputs.log entry is obsolete (renamed to fstats_run.log in fvsetup). -# Both names are maintained in the arc file for old experiments which may be -# transitioning to the new version of this script. Eventually the -# fstats_inputs.log entry can be removed. #======================================================================= sub write_g5fcst_stats_arc { use File::Copy qw(move); @@ -610,9 +620,7 @@ sub write_g5fcst_stats_arc { \${PESTOROOT}%s/prog/$fs_tag/Y%y4/M%m2/%s.%H2z.stats.b%y4%m2%d2_%h2z.e%Y4%M2%D2_%H2z.ctl2 \${PESTOROOT}%s/prog/$fs_tag/Y%y4/M%m2/%s.%H2z.stats.b%y4%m2%d2_%h2z.e%Y4%M2%D2_%H2z.data \${PESTOROOT}%s/prog/$fs_tag/Y%y4/M%m2/%s.fstats.log.%y4%m2%d2_%h2z.txt -\${PESTOROOT}%s/etc/Y%y4/M%m2/%s.fstats_inputs.log.%y4%m2%d2_%h2z.txt \${PESTOROOT}%s/etc/Y%y4/M%m2/%s.fstats_calc.log.%y4%m2%d2_%h2z.txt -\${PESTOROOT}%s/etc/Y%y4/M%m2/%s.fstats_run.log.%y4%m2%d2_%h2z.txt EOF ; close ARC; @@ -629,7 +637,9 @@ sub submit_calcjob { my ($logdir, $logfile1, $logfile2, $jobname, $jobdate, $jobfile, $jobtype); my ($cmd, $jobID, $jobIDline); my (@levs, @levels_19, @levels_11); - my ($mynodes, $mympi); + my ($mynodes,$usrnodes); + my ($qos, $partition); + my ($ntspn, $npn); @levels_19 = ( 1000.0, 975.0, 950.0, 925.0, 900.0, 850.0, 800.0, 750.0, @@ -657,6 +667,7 @@ sub submit_calcjob { $fstatswork = $args{"fstatswork"}; $vdate1 = $args{"vdate1"}; $vhh1 = $args{"vhh1"}; + $usrnodes = $args{"nodes"}; foreach (@fcstlist, @vanalist) { push @rmfilelist, basename($_) }; @@ -671,34 +682,61 @@ sub submit_calcjob { $jobfile = "$jobdir/$jobname.j"; $logfile1 = "$jobdir/$jobtype.log.$jobdate.o%j.txt"; $logfile2 = "$logdir/$expid.$jobtype.log.$jobdate.txt"; - if ( -e "/etc/os-release" ) { + $npn = `facter processorcount`; chomp($npn); + if ( $npn == 40 ) { $mynodes = "sky"; - $mympi = "mpirun"; + $ntspn = 36; + $qos = "#SBATCH --qos=dastest"; # wired for now since only way to use SKY + $partition = "#SBATCH --partition=preops"; # wired for now since only way to use SKY + } elsif ( $npn == 48 ) { + $mynodes = "cas"; + $ntspn = 42; + $qos = "#SBATCH --qos=dastest"; # wired for now since only way to use CAS + $partition = "#SBATCH --partition=preops"; # wired for now since only way to use CAS } else { $mynodes = "hasw"; - $mympi = "mpiexec_mpt"; + $ntspn = 24; + $qos = ""; + $partition = ""; +# $qos = "#SBATCH --qos=dastest"; # wired for now since only way to use HASW +# $partition = "#SBATCH --partition=preops"; # wired for now since only way to use HASW } + if ( $usrnodes ne "null" ) { $mynodes = $usrnodes }; # overwrite with specification from command line print "\nwriting jobfile: $jobfile\n"; open FH, "> $jobfile" or die "Error opening $jobfile; $!"; print FH <<"EOF" or die "Error writing to $jobfile: $!"; #!/usr/bin/csh +#SBATCH --ntasks=1 #SBATCH --time=1:00:00 #SBATCH --job-name=$jobname #SBATCH --output=$logfile1 #SBATCH --export=NONE #SBATCH --constraint=$mynodes +$qos +$partition source $Bin/g5_modules set echo chdir $fstatswork -$dryrun $mympi $statsX -np 1 -fcst @fcst_fnames \\ +# slurm env is messed up (inconsistent) +#unsetenv SLURM_MEM_PER_CPU +unsetenv SLURM_MEM_PER_GPU +unsetenv SLURM_MEM_PER_NODE + +if ( \$?I_MPI_ROOT ) then + set mympi = "mpirun" +else + set mympi = "mpiexec_mpt" +endif + +$dryrun \$mympi -np 1 $statsX -fcst @fcst_fnames \\ -ana @ana_fnames \\ -cli @climfiles \\ -tag $expid.${ihh}z \\ -nfreq ${tau_freq}0000 \\ - -levs "@levs" \\ + -levs @levs \\ -o $expid.fstats.log.$jobdate.txt \\ -verif gmao \\ -fcsrc gmao \\ @@ -772,12 +810,6 @@ sub submit_archivejob { if ($ndays == 1) { $dtFLG = "-date $vdate0 -syntime ${vhh0}0000" } else { $dtFLG = "" } - if ( -e "/etc/os-release" ) { - $mynodes = "sky"; - } else { - $mynodes = "hasw"; - } - # write archive jobfile #---------------------- print "writing jobfile: $jobfile\n"; @@ -787,9 +819,9 @@ sub submit_archivejob { #SBATCH --time=1:00:00 #SBATCH --job-name=$jobname #SBATCH --partition=datamove +#$EXP_DATAMOVE_CONSTRAINT #SBATCH --output=$logfile1 #SBATCH --export=NONE -#SBATCH --constraint=$mynodes set echo @ archive_status = 0 @@ -799,7 +831,7 @@ sub submit_archivejob { $pesto -arc $arcfile \\ -expid $expid $dtFLG \\ -d $storedir/$expid/\$dir \\ - -r $ENV{"ARCHIVE"} \\ + -r $EXP_ARCHIVE \\ -l -v -clean @ archive_status += \$status @@ -836,7 +868,7 @@ sub submit_archivejob { foreach (@statsIDs) { $deps .= ":$_" if $_ } $dependFLG = ""; - $dependFLG = "--dependency afterany$deps" if $deps; + $dependFLG = "--dependency=afterany$deps" if $deps; print "submitting jobfile: $jobfile\n"; $cmd = "sbatch $dependFLG $jobfile"; @@ -848,8 +880,8 @@ sub submit_archivejob { } #======================================================================= -# name: extract_hh -# purpose: extract hh value from hhmmss string +# name: extract_hh_mn +# purpose: extract hh and mn values from hhmmss string # # input parameter: # => $hhmmss: input time string @@ -857,13 +889,13 @@ sub submit_archivejob { # return value: # => $hh: extracted hour value #======================================================================= -sub extract_hh { - my ($hhmmss, $hh); +sub extract_hh_mn{ + my ($hhmmss, $hh, $mn); $hhmmss = shift @_; - ($hh) = ($hhmmss =~ m/^(\d{2})\d{4}$/) + ($hh, $mn) = ($hhmmss =~ m/^(\d{2})(\d{2})\d{2}$/) or die "Error. Undecipherable time: $hhmmss;"; - return $hh; + return $hh, $mn; } #======================================================================= @@ -954,6 +986,7 @@ sub usage { [dirname(\$FVHOME) or \$NOBACKUP] -noarchive do not archive outputs [archives by default] + -nodes nodesname specify nodes (e.g., sky, hasw, or cas) -das check for DAS hidden files before attempting to fetch files and set no prompt; requires \$FVHOME environment variable; diff --git a/GEOS_Util/post/gcmclim.script b/GEOS_Util/post/gcmclim.script index 0fafe11e..337dd570 100755 --- a/GEOS_Util/post/gcmclim.script +++ b/GEOS_Util/post/gcmclim.script @@ -91,13 +91,11 @@ endif # Determine if running in BATCH # ----------------------------- if( $NCPUS == "NULL" ) then - if ($?PBS_NODEFILE & $?BATCHNAME) then - set BATCHJOB = `qstat | grep $BATCHNAME | grep $LOGNAME | cut -d' ' -f1` - set numjobs = $#BATCHJOB - if( $numjobs != 0 ) then - set NCPUS = `cat $PBS_NODEFILE | wc -l` - endif - endif + if ($?SLURM_NTASKS) then + set NCPUS = $SLURM_NTASKS + else if ($?PBS_NODEFILE) then + set NCPUS = `cat $PBS_NODEFILE | wc -l` + endif endif echo Use: NCPUS = $NCPUS diff --git a/GEOS_Util/post/gcmplot.script b/GEOS_Util/post/gcmplot.script index 12ac1c46..be42e695 100755 --- a/GEOS_Util/post/gcmplot.script +++ b/GEOS_Util/post/gcmplot.script @@ -43,7 +43,7 @@ endif # -------------------- setenv ARCH ` uname` setenv HOST `hostname` -set name = `echo $HOST` ; if ( ($name =~ pfe*) || ($name =~ r[0-9]*i[0-9]*n[0-9]*) ) setenv HOST pleiades +set name = `echo $HOST` ; if ( ($name =~ pfe*) || ($name =~ r[0-9]*i[0-9]*n[0-9]*) || ($name =~ r[0-9]*c[0-9]*t[0-9]*n[0-9]*) ) setenv HOST pleiades set name = `echo $HOST | cut -b 1-8` ; if( $name == 'discover' ) setenv HOST $name set name = `echo $HOST | cut -b 1-4` ; if( $name == 'borg' ) setenv HOST discover diff --git a/GEOS_Util/post/gcmpost.script b/GEOS_Util/post/gcmpost.script index e554da4f..fed078a0 100755 --- a/GEOS_Util/post/gcmpost.script +++ b/GEOS_Util/post/gcmpost.script @@ -216,7 +216,7 @@ endif # -------------------- setenv ARCH ` uname` setenv HOST `hostname` -set name = `echo $HOST` ; if ( ($name =~ pfe*) || ($name =~ r[0-9]*i[0-9]*n[0-9]*) ) setenv HOST pleiades +set name = `echo $HOST` ; if ( ($name =~ pfe*) || ($name =~ r[0-9]*i[0-9]*n[0-9]*) || ($name =~ r[0-9]*c[0-9]*t[0-9]*n[0-9]*) ) setenv HOST pleiades set name = `echo $HOST | cut -b 1-8` ; if( $name == 'discover' ) setenv HOST $name set name = `echo $HOST | cut -b 1-4` ; if( $name == 'borg' ) setenv HOST discover @@ -240,14 +240,12 @@ endif # Determine Number of Nodes if running in BATCH # --------------------------------------------- if( $NCPUS == "NULL" ) then - if ($?PBS_NODEFILE & $?BATCHNAME) then - set BATCHJOB = `qstat | grep $BATCHNAME | grep $LOGNAME | cut -d' ' -f1` - set numjobs = $#BATCHJOB - if( $numjobs != 0 ) then + if ($?SLURM_NTASKS) then + set NCPUS = $SLURM_NTASKS + else if ($?PBS_NODEFILE) then set NCPUS = `cat $PBS_NODEFILE | wc -l` endif endif -endif echo Use: NCPUS = $NCPUS @@ -490,17 +488,17 @@ end if( $RECDATE != "NULL" ) then if( ${#monthly_attribute} == 0 ) then /bin/rm -f ${expid}.${collection}.monthly.$RECDATE.* - set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep -v monthly | grep -v diurnal | grep $RECDATE` - else + set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep -v monthly | grep -v diurnal | grep $RECDATE` + else set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep -v diurnal | grep $RECDATE` endif else if( ${#monthly_attribute} == 0 ) then /bin/rm -f ${expid}.${collection}.monthly.* - set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep -v monthly | grep -v diurnal` + set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep -v monthly | grep -v diurnal` else set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep -v diurnal` - endif + endif endif echo "Collection: $collection" echo " Locals: $locals" @@ -586,7 +584,7 @@ foreach collection ( $collections ) cd $SOURCE/holding/$collection/$date if( ${#monthly_attribute} == 0 ) then - set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep -v monthly | grep -v diurnal` + set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep -v monthly | grep -v diurnal` else set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep -v diurnal` endif @@ -648,6 +646,7 @@ foreach collection ( $collections ) if( ($prvmon != $begmon && $endmon != $nxtmon) | (".$STRICT" != .) ) then if( $MOVEFILES == "TRUE" ) then + # Submit Time_Ave Job # ------------------- cd $SOURCE/post @@ -669,25 +668,25 @@ EOF /bin/rm -f gcm_post.${collection}.j${date} sed -f sedfile $SOURCE/post/gcm_post.j > gcm_post.${collection}.j${date} chmod 755 gcm_post.${collection}.j${date} - $batch_cmd gcm_post.${collection}.j${date} + $batch_cmd gcm_post.${collection}.j${date} echo " " /bin/rm -f sedfile /bin/rm -f LOCKFILE sleep 5 # ------------------ - else - echo " Performing time average ..." - if(! -e time_ave.rc ) ln -s $GEOSUTIL/post/time_ave.rc . - if( $NCPUS == "NULL" | $NCPUS == 1 | !($?RUN_CMD) ) then + else + echo " Performing time average ..." + if(! -e time_ave.rc ) ln -s $GEOSUTIL/post/time_ave.rc . + if( $NCPUS == "NULL" | $NCPUS == 1 | !($?RUN_CMD) ) then $GEOSUTIL/bin/time_ave_nompi.x -hdf $locals -rc time_ave.rc \ - -tag $expid.$collection.monthly \ + -tag $expid.$collection.monthly \ -d $expid.$collection.diurnal $STRICT $IGNORE_NAN - else + else $RUN_CMD $NCPUS $GEOSUTIL/bin/time_ave.x -hdf $locals -rc time_ave.rc \ - -tag $expid.$collection.monthly \ + -tag $expid.$collection.monthly \ -d $expid.$collection.diurnal $STRICT $IGNORE_NAN - endif + endif endif else @@ -744,16 +743,16 @@ foreach collection ( $collections ) if( $streamdates[1] != 0 ) then foreach date ( $streamdates ) - if( -e $SOURCE/holding/$collection/$date ) then + if( -e $SOURCE/holding/$collection/$date ) then set locdir = $SOURCE/holding/$collection/$date cd $SOURCE/holding/$collection/$date - set archfile = $SOURCE/archive/archive_commands.$collection.$date.`date +%Y%m%d_%H%M%S` + set archfile = $SOURCE/archive/archive_commands.$collection.$date.`date +%Y%m%d_%H%M%S` /bin/rm -f $archfile - touch $archfile + touch $archfile if( ${#monthly_attribute} == 0 ) then - set num = `/bin/ls -1 $expid.$collection.monthly.* | wc -l` + set num = `/bin/ls -1 $expid.$collection.monthly.* | wc -l` else set num = `/bin/ls -1 $expid.$collection.* | wc -l` endif @@ -768,64 +767,64 @@ foreach collection ( $collections ) # Tar and Archive Dailies # ----------------------- if( ${#monthly_attribute} == 0 ) then - set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep -v monthly | grep -v diurnal` + set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep -v monthly | grep -v diurnal` if( $#locals != 0 ) then echo "Archiving Dailies for Collection: $collection for Date: $date" - @ daily_date_node = $date_node - if( $HIRES == FALSE ) then - $mytar cf $expid.${collection}.daily.$date.$ext.tar $locals - set locals = $expid.${collection}.daily.$date.$ext.tar - @ daily_date_node = $date_node + 1 # Since daily is simply appended to collection name - endif - - foreach local ($locals) - - set fdate = `echo $local | cut -d "." -f${daily_date_node}` # Assumed date format: YYYYMMDD_HHMMSS - set year = `echo $fdate | cut -c1-4` - set month = `echo $fdate | cut -c5-6` - set day = `echo $fdate | cut -c7-8` - set hour = `echo $fdate | cut -c10-11` - - set archive = `echo $archives[$m] | sed -e "s/%c/$collection/ g" | \ - sed -e "s/%y4/$year/ g" | \ - sed -e "s/%m2/$month/ g" | \ - sed -e "s/%d2/$day/ g" | \ - sed -e "s/%h2/$hour/ g"` - - echo "if( -e $local ) then" >> $archfile - echo "ssh ${MASTOR} mkdir -p ${MASDIR}/$archive" >> $archfile - echo 'echo " "' >> $archfile - echo "echo 'Archiving: '$local" >> $archfile - - if( $HOST == 'pleiades' ) then - echo "ssh ${MASTOR} $scpvar $locdir/$local ${MASDIR}/$archive" >> $archfile - - echo 'if ($status == 0) then ' >> $archfile - echo 'echo " Archive ... PASS "' >> $archfile - if( $FSEGMENT == 00000000 ) echo "/bin/rm -f $local" >> $archfile - echo 'else' >> $archfile - echo 'echo " Archive ... FAIL!"' >> $archfile - echo 'set success = FALSE' >> $archfile - echo 'endif' >> $archfile - - else if( $HOST == 'discover' ) then - echo "$scpvar $local ${MASTOR}:${MASDIR}/$archive | set archive_status = "'`sed -e "s/ / /g"`' >> $archfile - - echo 'if ( .$archive_status[4] == .OK ) then' >> $archfile - echo 'echo " Archive ... PASS "' >> $archfile - if( $FSEGMENT == 00000000 ) echo "/bin/rm -f $local" >> $archfile - echo 'else' >> $archfile - echo 'echo " Archive ... FAIL!"' >> $archfile - echo 'set success = FALSE' >> $archfile - echo 'endif' >> $archfile - - echo 'unset archive_status' >> $archfile - endif + @ daily_date_node = $date_node + if( $HIRES == FALSE ) then + $mytar cf $expid.${collection}.daily.$date.$ext.tar $locals + set locals = $expid.${collection}.daily.$date.$ext.tar + @ daily_date_node = $date_node + 1 # Since daily is simply appended to collection name + endif + + foreach local ($locals) + + set fdate = `echo $local | cut -d "." -f${daily_date_node}` # Assumed date format: YYYYMMDD_HHMMSS + set year = `echo $fdate | cut -c1-4` + set month = `echo $fdate | cut -c5-6` + set day = `echo $fdate | cut -c7-8` + set hour = `echo $fdate | cut -c10-11` - echo 'endif' >> $archfile + set archive = `echo $archives[$m] | sed -e "s/%c/$collection/ g" | \ + sed -e "s/%y4/$year/ g" | \ + sed -e "s/%m2/$month/ g" | \ + sed -e "s/%d2/$day/ g" | \ + sed -e "s/%h2/$hour/ g"` + + echo "if( -e $local ) then" >> $archfile + echo "ssh ${MASTOR} mkdir -p ${MASDIR}/$archive" >> $archfile + echo 'echo " "' >> $archfile + echo "echo 'Archiving: '$local" >> $archfile + + if( $HOST == 'pleiades' ) then + echo "ssh ${MASTOR} $scpvar $locdir/$local ${MASDIR}/$archive" >> $archfile - end - echo "wait" >> $archfile + echo 'if ($status == 0) then ' >> $archfile + echo 'echo " Archive ... PASS "' >> $archfile + if( $FSEGMENT == 00000000 ) echo "/bin/rm -f $local" >> $archfile + echo 'else' >> $archfile + echo 'echo " Archive ... FAIL!"' >> $archfile + echo 'set success = FALSE' >> $archfile + echo 'endif' >> $archfile + + else if( $HOST == 'discover' ) then + echo "$scpvar $local ${MASTOR}:${MASDIR}/$archive | set archive_status = "'`sed -e "s/ / /g"`' >> $archfile + + echo 'if ( .$archive_status[4] == .OK ) then' >> $archfile + echo 'echo " Archive ... PASS "' >> $archfile + if( $FSEGMENT == 00000000 ) echo "/bin/rm -f $local" >> $archfile + echo 'else' >> $archfile + echo 'echo " Archive ... FAIL!"' >> $archfile + echo 'set success = FALSE' >> $archfile + echo 'endif' >> $archfile + + echo 'unset archive_status' >> $archfile + endif + + echo 'endif' >> $archfile + + end + echo "wait" >> $archfile endif endif # EndTest for monthly_attribute @@ -835,7 +834,7 @@ foreach collection ( $collections ) if( ${#monthly_attribute} != 0 ) @ monthly_date_node = $date_node if( ${#monthly_attribute} == 0 ) then - set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep monthly | grep -v diurnal` + set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep monthly | grep -v diurnal` else set locals = `/bin/ls -1 | grep ${expid}.${collection} | grep -v diurnal` endif @@ -909,7 +908,7 @@ foreach collection ( $collections ) sed -e "s/%d2/$day/ g" | \ sed -e "s/%h2/$hour/ g"` - mkdir -p $SOURCE/$collection/diurnal + mkdir -p $SOURCE/$collection/diurnal $cpvar $local $SOURCE/$collection/diurnal echo "if( -e $local ) then" >> $archfile @@ -1036,7 +1035,7 @@ wait @ nstream = 0 foreach collection ( $collections ) set monthly_attribute = `grep -i $collection.monthly: $HISTORYRC` - @ nstream = $nstream + 1 + @ nstream = $nstream + 1 if( ( ($MOVEFILES != "TRUE") & ${#monthly_attribute} == 0 ) | \ ( ($MOVEFILES == "TRUE") & ${#monthly_attribute} != 0 ) | \ @@ -1053,7 +1052,7 @@ foreach collection ( $collections ) set monthlies = `/bin/ls -1 $expid.${collection}.* | grep -v clim` endif - set num = `/bin/ls -1 $monthlies | wc -l` + set num = `/bin/ls -1 $monthlies | wc -l` if( $num != 0 ) then @@ -1113,14 +1112,14 @@ end if( ${#monthly_attribute} == 0 ) then - echo DSET $SOURCE/${collection}/$expid.${collection}.monthly.%y4%m2.$ext > xdf.tabl + echo DSET $SOURCE/${collection}/$expid.${collection}.monthly.%y4%m2.$ext > xdf.tabl else set template = `grep -i $collection.template: $HISTORYRC | cut -d: -f2 | cut -d"'" -f2` echo DSET $SOURCE/${collection}/$expid.${collection}.$template > xdf.tabl endif - echo TITLE $expdsc >> xdf.tabl - echo OPTIONS template >> xdf.tabl - echo TDEF time $nmonths LINEAR 00:00Z01$MON$year 1$timinc >> xdf.tabl + echo TITLE $expdsc >> xdf.tabl + echo OPTIONS template >> xdf.tabl + echo TDEF time $nmonths LINEAR 00:00Z01$MON$year 1$timinc >> xdf.tabl endif # Endif for monthlies NUM = 0 check @@ -1169,7 +1168,7 @@ cd $SOURCE/plot set STATUS = `grep PLOT_STATUS: plot.rc | grep -v '#' | cut -d':' -f2 | tr "[:lower:]" "[:upper:]"` set SEASONS = `grep PLOT_SEASONS: plot.rc | grep -v '#' | cut -d':' -f2 | tr "[:lower:]" "[:upper:]"` set FREQUENCY = `grep PLOT_FREQUENCY: plot.rc | grep -v '#' | cut -d':' -f2 | tr "[:lower:]" "[:upper:]"` - set OPTIONS = `grep PLOT_OPTIONS: plot.rc | grep -v '#' | cut -d':' -f2 ` + set OPTIONS = `grep PLOT_OPTIONS: plot.rc | grep -v '#' | cut -d':' -f2- ` set CMPEXP = `grep PLOT_CMPEXP: plot.rc | grep -v '#' | cut -d':' -f2- ` set MISCTMP = `grep PLOT_MISC: plot.rc | grep -v '#' | tr "[:lower:]" "[:upper:]"` set NJOBS = `grep PLOT_JOBS: plot.rc | grep -v '#' | cut -d':' -f2- ` diff --git a/GEOS_Util/post/gcmpost_CPLFCSTfull.script b/GEOS_Util/post/gcmpost_CPLFCSTfull.script index eb2a830f..793c9904 100755 --- a/GEOS_Util/post/gcmpost_CPLFCSTfull.script +++ b/GEOS_Util/post/gcmpost_CPLFCSTfull.script @@ -208,7 +208,7 @@ endif # -------------------- setenv ARCH ` uname` setenv HOST `hostname` -set name = `echo $HOST` ; if ( ($name =~ pfe*) || ($name =~ p4fe*) || ($name =~ r[0-9]*i[0-9]*n[0-9]*) || ($name =~ bridge*) ) setenv HOST pleiades +set name = `echo $HOST` ; if ( ($name =~ pfe*) || ($name =~ p4fe*) || ($name =~ r[0-9]*i[0-9]*n[0-9]*) || ($name =~ r[0-9]*c[0-9]*t[0-9]*n[0-9]*) || ($name =~ bridge*) ) setenv HOST pleiades set name = `echo $HOST | cut -b 1-8` ; if( $name == 'discover' ) setenv HOST $name set name = `echo $HOST | cut -b 1-4` ; if( $name == 'borg' ) setenv HOST discover @@ -244,13 +244,11 @@ endif # Determine Number of Nodes if running in BATCH # --------------------------------------------- if( $NCPUS == "NULL" ) then - if ($?PBS_NODEFILE & $?BATCHNAME) then - set BATCHJOB = `qstat | grep $BATCHNAME | grep $LOGNAME | cut -d' ' -f1` - set numjobs = $#BATCHJOB - if( $numjobs != 0 ) then - set NCPUS = `cat $PBS_NODEFILE | wc -l` - endif - endif + if ($?SLURM_NTASKS) then + set NCPUS = $SLURM_NTASKS + else if ($?PBS_NODEFILE) then + set NCPUS = `cat $PBS_NODEFILE | wc -l` + endif endif echo Use: NCPUS = $NCPUS diff --git a/GEOS_Util/post/gcmpost_CPLFCSTpart.script b/GEOS_Util/post/gcmpost_CPLFCSTpart.script index a69ada11..3d6aec1f 100755 --- a/GEOS_Util/post/gcmpost_CPLFCSTpart.script +++ b/GEOS_Util/post/gcmpost_CPLFCSTpart.script @@ -244,13 +244,11 @@ endif # Determine Number of Nodes if running in BATCH # --------------------------------------------- if( $NCPUS == "NULL" ) then - if ($?PBS_NODEFILE & $?BATCHNAME) then - set BATCHJOB = `qstat | grep $BATCHNAME | grep $LOGNAME | cut -d' ' -f1` - set numjobs = $#BATCHJOB - if( $numjobs != 0 ) then - set NCPUS = `cat $PBS_NODEFILE | wc -l` - endif - endif + if ($?SLURM_NTASKS) then + set NCPUS = $SLURM_NTASKS + else if ($?PBS_NODEFILE) then + set NCPUS = `cat $PBS_NODEFILE | wc -l` + endif endif echo Use: NCPUS = $NCPUS diff --git a/GEOS_Util/post/getdates b/GEOS_Util/post/getdates index f5415c5b..e1454ad6 100755 --- a/GEOS_Util/post/getdates +++ b/GEOS_Util/post/getdates @@ -17,6 +17,10 @@ if( -e $BASEDIR/$arch/bin/hdfdump ) then else set hdfdump = ncdump set version = `file -b $1` + if( $version[1] == "symbolic" ) then + set link = `file -b $1 | cut -d " " -f 4` + set version = `file -b $link` + endif if("$version" == "Hierarchical Data Format (version 4) data") then if( -e $BASEDIR/$arch/bin/ncdump-hdf4 ) then set hdfdump = ncdump-hdf4 diff --git a/GEOS_Util/post/plot.rc b/GEOS_Util/post/plot.rc index 81ae3de2..cc74c5b4 100644 --- a/GEOS_Util/post/plot.rc +++ b/GEOS_Util/post/plot.rc @@ -34,7 +34,7 @@ PLOT_STATUS: ON PLOT_SEASONS: DJF JJA PLOT_FREQUENCY: CLIM - PLOT_OPTIONS: + PLOT_OPTIONS: -cintdiff ON PLOT_CMPEXP: PLOT_MISC: MISC PLOT_MOVE: OFF diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index ab429429..fc69d567 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -25,32 +25,34 @@ my ($ESMABIN, $ESMATAG, $bcsHEAD, $bcsHEAD_ops, $bcsTagIN, $bcsTagOUT); my ($bkgFLG, $bkg_regrid_FLG, $c2cX, $capture, $coupled_model_dir); my ($dbHash, $debug, $drymassFLG, $dyn2dynX, $expid); -my ($g5modules, $gcmFLG, $getinput, $grIN, $grINocean, $grINocean_); -my ($grOUT, $grOUTocean, $grouplist, $grpID, $hr, $interactive); +my ($g5modules, $gcmFLG, $getinput, $grIN, $grINocean, $grINocean_, $mdlINocean); +my ($grOUT, $grOUTocean, $grOUTocean_, $mdlOUTocean, $grouplist, $grpID, $hr, $interactive); my ($interp_restartsX, $landIceDT, $lblFLG, $lcvFLG, $levsIN, $levsOUT); my ($logfile, $merra, $mk_RestartsX, $mk_catch, $mk_catchcn, $mk_route); my ($mkdrstdateX, $month, $newid, $node, $noprompt, $outdir, $outdir_save); -my ($qos, $regridj, $rsFLG, $rstdir, $rstTAR, $rs_hinterpX, $rs_scaleX); +my ($qos, $partition, $constraint, $regridj, $rsFLG, $rstdir, $rstTAR, $rs_hinterpX, $rs_scaleX); my ($rstIN_template, $rstIN_templateB, $rst_tarfile, $rst_template); my ($rst_templateB, $scale_catchX, $scale_catchcnX, $slurmjob); my ($surfFLG, $surflay, $surflayIN, $tagIN, $tagOUT, $tarFLG); my ($upairFLG, $verbose, $wemIN, $wemOUT, $workdir); +my ($binRST); my ($year, $ymd, $zoom, $zoom_); my ($qcmd, $qwaitFLG); my (%CS, %CSo, %IN, %OUT, %SURFACE, %UPPERAIR_OPT, %UPPERAIR_REQ); -my (%atmLevs, %coupledFLG, %coupled_model_tile, %hgrd, %iceIN); +my (%atmLevs, %dataFLG, %coupledFLG, %coupledMDLFLG, %hgrd, %iceIN); my (%im, %im4, %imo, %imo4, %input_restarts); my (%jm, %jm4, %jm5, %jmo, %jmo4, %newLand); -my (@anafiles, @warnings); +my (@anafiles, @cnlist, @warnings); # global tag variables #--------------------- my $former_tag = "Ganymed-4_0"; # default for input restarts -my $current_tag = "Ganymed-4_0"; # default for output restarts +my $current_tag = "Icarus-NLv3"; # default for output restarts my (@GCMtags, @DAStags); my (@F14, @F20, @F21, @G10, @G10p, @G20, @G30, @G40, @INL, @ICA); -my (@D214, @D540, @D561, @D580, @D591p, @D5A0, @D5B0, @D512, @D517); +my (@GITOL, @GITNL); # Git GCM tags +my (@D214, @D540, @D561, @D580, @D591p, @D5A0, @D5B0, @D512, @D517, @D525); my (%bcsTAG, %rank, %landIceVER, $landIceFLG); my ($rank_1_catchcn, $rank_1_route, $rank_saltwater_split); @@ -75,8 +77,9 @@ $atmLevs{"144"} = "144"; $atmLevs{"181"} = "181"; -# ocean grids -#------------ +# data ocean grids +#----------------- +%dataFLG = ( "c" => 1, "e" => 1, "f" => 1, "CS" => 1 ); $imo{"c"} = "360"; $jmo{"c"} = "180"; # Reynolds $imo{"e"} = "1440"; $jmo{"e"} = "720"; # MERRA-2 $imo{"f"} = "2880"; $jmo{"f"} = "1440"; # OSTIA @@ -88,34 +91,21 @@ $jmo{"C$_"} = 6*$_; } +# coupled ocean models +#--------------------- +%coupledMDLFLG = ( "MOM5" => 1, "MOM6" => 1 ); + # coupled ocean grids #-------------------- -%coupledFLG = ( "cc" => 1, "dd" => 1, "ee" => 1 ); -$imo{"cc"} = "360"; $jmo{"cc"} = "200"; -$imo{"dd"} = "720"; $jmo{"dd"} = "410"; +%coupledFLG = ( "aa" => 1, "cc" => 1, "dd" => 1, "ee" => 1 ); +$imo{"aa"} = "72"; $jmo{"aa"} = "36"; +$imo{"cc"} = "360"; $jmo{"cc"} = "200"; +$imo{"dd"} = "720"; $jmo{"dd"} = "410"; $imo{"ee"} = "1440"; $jmo{"ee"} = "1080"; # until an official location for coupled-model tiles is created #-------------------------------------------------------------- -$coupled_model_dir = "/discover/nobackup/yvikhlia/coupled/Forcings"; - -$coupled_model_tile{"CF0048x6C_TM0360xTM0200-Pfafstetter.til"} = - "${coupled_model_dir}/Ganymed/a48x288_o360x200/"; - -$coupled_model_tile{"CF0090x6C_TM0360xTM0200-Pfafstetter.til"} = - "${coupled_model_dir}/a90x540_o360x200"; - -$coupled_model_tile{"CF0090x6C_TM0720xTM0410-Pfafstetter.til"} = - "${coupled_model_dir}/Ganymed/a90x540_o720x410"; - -$coupled_model_tile{"CF0090x6C_TM1440xTM1080-Pfafstetter.til"} = - "${coupled_model_dir}/Ganymed/a90x540_o1440x1080"; - -$coupled_model_tile{"CF0180x6C_TM0720xTM0410-Pfafstetter.til"} = - "${coupled_model_dir}/a180x1080_o720x410"; - -$coupled_model_tile{"CF0180x6C_TM1440xTM1080-Pfafstetter.til"} = - "${coupled_model_dir}/Ganymed/a180x1080_o1440x1080"; +$coupled_model_dir = "/discover/nobackup/projects/gmao/ssd/aogcm/atmosphere_bcs"; # atmosphere cubed-sphere grids #------------------------------ @@ -164,18 +154,26 @@ "geoschemchem_internal_rst" => 1, "gmichem_internal_rst" => 1, "gocart_internal_rst" => 1, + "hemco_internal_rst" => 1, "mam_internal_rst" => 1, "matrix_internal_rst" => 1, "pchem_internal_rst" => 1, "stratchem_internal_rst" => 1, + "ss_internal_rst" => 1, + "du_internal_rst" => 1, + "cabr_internal_rst" => 1, + "cabc_internal_rst" => 1, + "caoc_internal_rst" => 1, + "ni_internal_rst" => 1, + "su_internal_rst" => 1, "tr_internal_rst" => 1); %SURFACE = ("catch_internal_rst" => 1, "catchcn_internal_rst" => 1, + "route_internal_rst" => 1, "lake_internal_rst" => 1, "landice_internal_rst" => 1, "openwater_internal_rst" => 1, - "route_internal_rst" => 1, "saltwater_internal_rst" => 1, "seaicethermo_internal_rst" => 1); @@ -261,7 +259,9 @@ sub init { "np|noprompt" => \$noprompt, "levsout=s" => \$levsOUT, "oceanin=s" => \$grINocean, + "ocnmdlin=s" => \$mdlINocean, "oceanout=s" => \$grOUTocean, + "ocnmdlout=s" => \$mdlOUTocean, "esmabin=s" => \$ESMABIN, "iceDT=s" => \$landIceDT, "newid=s" => \$newid, @@ -270,16 +270,18 @@ sub init { "tar" => \$tarFLG, "rs=i" => \$rsFLG, "catch" => \$mk_catch, - "catchcn" => \$mk_catchcn, + "catchcn=s" => \$mk_catchcn, "route" => \$mk_route, - "wemin" => \$wemIN, - "wemout" => \$wemOUT, + "wemin=i" => \$wemIN, + "wemout=i" => \$wemOUT, "bkg!" => \$bkgFLG, "lbl!" => \$lblFLG, "lcv!" => \$lcvFLG, "gcm" => \$gcmFLG, "grpid=s" => \$grpID, "qos=s" => \$qos, + "partition=s" => \$partition, + "constraint=s" => \$constraint, "altbcs:s{,1}" => \$bcsALT, "zoom=i" => \$zoom, "db|debug|nc" => \$debug, @@ -292,6 +294,8 @@ sub init { $dbHash = 1 if $debug; $verbose = 0 unless $verbose; $qos = 0 unless $qos; + $partition = 0 unless $partition; + $constraint = "sky" unless $constraint; usage() if $help; setprompt(0) if $noprompt; @@ -453,28 +457,42 @@ sub init_tag_arrays_and_hashes { # BCS Tags: Icarus (New Land Parameters, New Topography) #--------------------------------------------------------------------------- @ICA = qw( ICA Icarus Jason ); - @D517 = qw( GEOSadas-5_17_0 GEOSadas-5_17_1 GEOSadas-5_18_0 + @D517 = qw( 517 + GEOSadas-5_17_0 GEOSadas-5_17_1 GEOSadas-5_18_0 GEOSadas-5_18_1 GEOSadas-5_18_2 GEOSadas-5_18_3 GEOSadas-5_18_3_p1 GEOSadas-5_19_0 GEOSadas-5_20_0 GEOSadas-5_20_0_p1 GEOSadas-5_20_0_p2 GEOSadas-5_21_0 GEOSadas-5_21_2 GEOSadas-5_21_3_p1 GEOSadas-5_22_0 GEOSadas-5_22_0_p1 GEOSadas-5_22_0_p2 GEOSadas-5_23_0 GEOSadas-5_23_0_p1 GEOSadas-5_24_0 GEOSadas-5_24_0_p1 ); + @GITOL = qw( GITOL + 10.3 10.4 10.5 + 10.6 10.7 10.8 + 10.9 10.10 10.11 + 10.12 10.13 10.14 + 10.15 10.16 10.17 + 10.18 ); # BCS Tags: Icarus-NLv3 (New Land Parameters) #--------------------------------------------------------------------------- - @INL = qw( INL Icarus-NL Icarus-NLv3 ); - - foreach (@F14) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-1_4" } - foreach (@F20) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-2_0" } - foreach (@F21) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-2_1" } - foreach (@G10) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Ganymed-1_0" } - foreach (@G10p) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Ganymed-1_0_M" } - foreach (@G20) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Ganymed-1_0_M" } + @INL = qw( INL Icarus-NL Icarus-NLv3 Jason-NL ); + @GITNL = qw( GITNL 10.19 10.20 ); + @D525 = qw( 525 + GEOSadas-5_25_1 GEOSadas-5_25_1_p5 GEOSadas-5_25_p7 + GEOSadas-5_27_1 GEOSadas-5_29_3 ); + + foreach (@F14) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-1_4" } + foreach (@F20) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-2_0" } + foreach (@F21) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-2_1" } + foreach (@G10) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Ganymed-1_0" } + foreach (@G10p) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Ganymed-1_0_M" } + foreach (@G20) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Ganymed-1_0_M" } foreach (@G30) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Ganymed-1_0_Reynolds" } foreach (@G40) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Ganymed-4_0_Reynolds" } - foreach (@ICA) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus_Reynolds" } + foreach (@ICA) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus_Reynolds" } + foreach (@GITOL) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus_Reynolds" } foreach (@INL) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus-NLv3_Reynolds" } + foreach (@GITNL) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus-NLv3_Reynolds" } foreach (@D214) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-1_4" } foreach (@D540) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-1_4" } @@ -485,9 +503,10 @@ sub init_tag_arrays_and_hashes { foreach (@D5B0) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Ganymed-1_0_Reynolds" } foreach (@D512) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Ganymed-4_0_Reynolds" } foreach (@D517) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus_Reynolds" } + foreach (@D525) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus-NLv3_Reynolds" } - @GCMtags = (\@F14, \@F20, \@F21, \@G10, \@G10p, \@G20, \@G30, \@G40, \@INL, \@ICA); - @DAStags = (\@D214, \@D540, \@D561, \@D580, \@D591p, \@D5A0, \@D5B0, \@D512); + @GCMtags = (\@F14, \@F20, \@F21, \@G10, \@G10p, \@G20, \@G30, \@G40, \@ICA, \@GITOL, \@INL, \@GITNL); + @DAStags = (\@D214, \@D540, \@D561, \@D580, \@D591p, \@D5A0, \@D5B0, \@D512, \@D517, \@D525); # rank of BCS tags #----------------- @@ -532,10 +551,13 @@ sub init_tag_arrays_and_hashes { #======================================================================= sub check_inputs { my ($ans, $arcdir, $bkg_dflt, $dflt, $fname, $fvrst); - my ($grINocean_dflt, $grOUTocean_dflt); + my ($grINocean_data_dflt, $grOUTocean_data_dflt, $ii); + my ($grINocean_coupled_dflt, $grOUTocean_coupled_dflt); + my ($mdlINocean_dflt, $mdlOUTocean_dflt); my ($label, $landIceVERin, $landIceVERout, $lbl_dflt); my ($lcv_dflt, $len, $levsOUTdflt, $msg, $newid_dflt); my ($prompt, $rstlcvIN, $warnFLG, $wemINdflt, $wemOUTdflt); + my (@cnlabel); # check for input tarfile #------------------------ @@ -633,6 +655,7 @@ sub check_inputs { $tagIN = "Fortuna-1_4"; $grIN = "d"; $grINocean = "c"; + $mdlINocean = "data"; if ($year < 1979) { die "Error. MERRA data < 1979 not available\n" } elsif ($year < 1989) { $expid = "d5_merra_jan79" } @@ -645,6 +668,7 @@ sub check_inputs { $tagIN = "Ganymed-4_0"; $grIN = "C180"; $grINocean = "e"; + $mdlINocean = "data"; if ("$year$month" < 197901) { die "Error. MERRA-2 data < 1979 not available\n" @@ -733,45 +757,81 @@ sub check_inputs { # # For non-cubed-sphere grids, $grINocean_ = $grINocean #--------------------------------------------------------------------------- - $grINocean_dflt = "c"; - $grOUTocean_dflt = "c"; - - unless ($grINocean and ($imo{$grINocean}) and + $grINocean_data_dflt = "c"; + $grOUTocean_data_dflt = "c"; + + $grINocean_coupled_dflt = "dd"; + $grOUTocean_coupled_dflt = "dd"; + + # These are the defaults for ocean model + $mdlINocean_dflt = "data"; + $mdlOUTocean_dflt = "data"; # We don't need a default if dataocean in + + unless ($mdlINocean and not $merra) { + print "\nOcean Models\n" + . "------------\n" + . "data (Reynolds, MERRA-2, Ostia, Cubed-Sphere)\n" + . "MOM5 \n" + . "MOM6 \n" + . "\n"; + until ($mdlINocean and ( ($mdlINocean eq "data") or ($coupledMDLFLG{$mdlINocean}) ) ) { + $mdlINocean = query("Enter INPUT ocean model", $mdlINocean_dflt); + } + } + print "INPUT ocean model: $mdlINocean\n"; + + unless ($grINocean and $imo{$grINocean} and $grOUTocean and $imo{$grOUTocean}) { - print "\nOcean Grids\n" - . "-----------\n" - . "c = 360x180 (Reynolds)\n" - . "e = 1440x720 (MERRA-2)\n" - . "f = 2880x1440 (OSTIA)\n" - . "CS = same as atmosphere (OSTIA cubed-sphere)\n" - . "\n" - . "Coupled Ocean Grids\n" - . "-------------------\n" - . "cc = 360x200\n" - . "dd = 720x410\n" - . "ee = 1440x1080\n\n"; - } - until ($grINocean and $imo{$grINocean}) { - $grINocean = query("Enter INPUT ocean grid:", $grINocean_dflt); - } - if (($grINocean eq "CS") or ($grINocean eq "CSi")) { - unless ($CSo{$grIN}) { - die "Error. Cannot have cubed ocean with atmosphere grid $grIN"; - } - $grINocean = "CSi"; - $grINocean_ = "CS"; - $imo{"CSi"} = $im{$grIN}; - $jmo{"CSi"} = $jm{$grIN}; - $imo4{"CSi"} = $im4{$grIN}; - $jmo4{"CSi"} = $jm4{$grIN}; + print "\nData Ocean Grids\n" + . "----------------\n" + . "c = 360x180 (Reynolds)\n" + . "e = 1440x720 (MERRA-2)\n" + . "f = 2880x1440 (OSTIA)\n" + . "CS = same as atmosphere (OSTIA cubed-sphere)\n" + . "\nCoupled Ocean Grids\n" + . "-------------------\n" + . "aa = 72x36\n" + . "cc = 360x200\n" + . "dd = 720x410\n" + . "ee = 1440x1080\n\n"; + until ($grINocean and $imo{$grINocean} and ($dataFLG{$grINocean} or $coupledFLG{$grINocean}) ) { + if ($mdlINocean eq "data") { + $grINocean = query("Enter INPUT ocean grid:", $grINocean_data_dflt); + } else { + $grINocean = query("Enter INPUT ocean grid:", $grINocean_coupled_dflt); + } + } + if (($grINocean eq "CS") or ($grINocean eq "CSi")) { + unless ($CSo{$grIN}) { + die "Error. Cannot have cubed ocean with atmosphere grid $grIN"; + } + $grINocean = "CSi"; + $grINocean_ = "CS"; + $imo{"CSi"} = $im{$grIN}; + $jmo{"CSi"} = $jm{$grIN}; + $imo4{"CSi"} = $im4{$grIN}; + $jmo4{"CSi"} = $jm4{$grIN}; + } } $grINocean_ = $grINocean unless $grINocean_; print "INPUT ocean grid: $grINocean_\n"; + # output ocean model $mdlOUTocean + #-------------------------------- + # If dataocean, we can only output data ocean, but if coupled, we can choose + until ($mdlOUTocean and ( ($mdlOUTocean eq "data") or ($coupledMDLFLG{$mdlOUTocean}) ) ) { + $mdlOUTocean = query("Enter OUTPUT ocean model", $mdlOUTocean_dflt); + } + print "OUTPUT ocean model: $mdlOUTocean\n"; + # output ocean grid: $grOUTocean #------------------------------- - until ($grOUTocean and $imo{$grOUTocean}) { - $grOUTocean = query("Enter OUTPUT ocean grid:", $grOUTocean_dflt); + until ($grOUTocean and $imo{$grOUTocean} and ($dataFLG{$grOUTocean} or $coupledFLG{$grOUTocean})) { + if ($mdlOUTocean eq "data") { + $grOUTocean = query("Enter OUTPUT ocean grid:", $grOUTocean_data_dflt); + } else { + $grOUTocean = query("Enter OUTPUT ocean grid:", $grOUTocean_coupled_dflt); + } } if ($grOUTocean eq "CS") { unless ($CSo{$grOUT}) { @@ -782,7 +842,8 @@ sub check_inputs { $imo4{"CS"} = $im4{$grOUT}; $jmo4{"CS"} = $jm4{$grOUT}; } - print "OUTPUT ocean grid: $grOUTocean\n"; + $grOUTocean_ = $grOUTocean unless $grOUTocean_; + print "OUTPUT ocean grid: $grOUTocean_\n"; # check tag info: $tagIN and $tagOUT #----------------------------------- @@ -809,7 +870,7 @@ sub check_inputs { print "\n"; } } - if ($bcsTagIN) { print_("\nINPUT tag: $bcsTagIN\n\n") } + if ($bcsTagIN) { print_("INPUT tag: $bcsTagIN\n") } else { until ($bcsTagIN) { print_("\nType 'bcs' to see BCS tags or\n"); @@ -821,11 +882,14 @@ sub check_inputs { if ($rank{$bcsTagIN} >= 12 ) { $surflayIN = 50 } else { $surflayIN = 20 } - until ($bcsTagOUT) { - print_("\nType 'bcs' to see BCS tags or\n"); - $tagOUT = query("Enter GCM or DAS tag for outputs:", $current_tag); - $bcsTagOUT = resolve_bcsTAG($tagOUT, $grOUTocean, "out"); - $tagOUT = $bcsTagOUT if $tagOUT eq "bcs"; + if ($bcsTagOUT) { print_("OUTPUT tag: $bcsTagOUT\n") } + else { + until ($bcsTagOUT) { + print_("\nType 'bcs' to see BCS tags or\n"); + $tagOUT = query("Enter GCM or DAS tag for outputs:", $current_tag); + $bcsTagOUT = resolve_bcsTAG($tagOUT, $grOUTocean, "out"); + $tagOUT = $bcsTagOUT if $tagOUT eq "bcs"; + } } if ($rank{$bcsTagOUT} >= 12 ) { $surflay = 50; $drymassFLG = 1 } else { $surflay = 20 } @@ -878,15 +942,17 @@ sub check_inputs { else { $mk_catch = 0; $mk_catchcn = 0; $mk_route = 0 } # get minimum snow water equivalent threshold - # (WEmin = 13 mm is newer value, from SMAP Nature Run 7.2, and Icarus-NL* + # (WEmin = 13 mm is newer value, from SMAP Nature Run 7.2, and Icarus-NL*; was also used in (original) MERRA # WEmin = 26 mm is older value, used in MERRA-2) #----------------------------------------------- if ($mk_catch or $mk_catchcn) { - print "\nMinimum snow water equivalent thresholds (WEmin) needed for catch(cn).\n" - . " WEmin = 13 mm is newer value (INL),\n" - . " WEmin = 26 mm is older value (ICA,G40)\n" - . "----------------------------------------------\n"; - + print "\nRegridding of Catch[CN] restarts requires specification of minimum snow water equivalent\n" + . "values (WEmin) for the runs associated with the source (input) and target (output) restarts.\n" + . "FYI, the following values are used in existing GEOS systems:\n" + . " WEmin = 26 kg/m2 : FP 5.13-5.22, MERRA-2, MERRA-Land, (Fortuna, Ganymed [G40], Icarus [ICA], Git GCM 10.3-10.18)\n" + . " WEmin = 13 kg/m2 : FP 5.25- , MERRA, (Icarus-NewLand [INL], Git GCM 10.19+)\n" + . "----------------------------------------------------------------------------------------------\n"; + if ($newLand{$bcsTagIN}) { $wemINdflt = 13 } else { $wemINdflt = 26 } @@ -909,6 +975,25 @@ sub check_inputs { $mk_catchcn = 0 if $rank{$bcsTagOUT} < $rank_1_catchcn; $mk_route = 0 if $rank{$bcsTagOUT} < $rank_1_route; + # get CNLIST values + #------------------ + @cnlist = split(/,/, $mk_catchcn) if $mk_catchcn; + if ($mk_catchcn) { + unless (scalar(@cnlist) != 4 || scalar(@cnlist) != 1) { + @cnlabel = (qw(CN_VERSION RESTART_ID RESTART_PATH RESTART_DOMAIN)); + foreach $ii (0..3) { + $prompt = "Enter Carbon (CN) $cnlabel[$ii]"; + if ($cnlist[$ii]) { $cnlist[$ii] = query($prompt, $cnlist[$ii]) } + else { $cnlist[$ii] = query($prompt) } + } + $mk_catchcn = join(",", @cnlist[0..3]); + } + + unless ( $cnlist[0] eq "clm40" or $cnlist[0] eq "clm45") { + die "Error. CN_VERSION should be clm40 or clm45\n"; + } + } + # get zoom value #--------------- if ($surfFLG) { @@ -1054,8 +1139,8 @@ sub check_inputs { #----------------------------------------- if ($outdir =~ /archive/ and $CS{$grOUT} and $upairFLG) { warn "\n=======\nWARNING\n=======\n" - ."> CS upper-air restarts are created with a PBS job.\n" - ."> PBS jobs cannot write to the archive directories.\n" + ."> CS upper-air restarts are created with a batch job.\n" + ."> Batch jobs cannot write to the archive directories.\n" ."> Your OUTPUT directory appears to be in the archives.\n\n" ."outdir: $outdir\n\n"; $ans = query("Quit (y/n)", "y"); @@ -1267,6 +1352,11 @@ sub get_fvrst { #----------------------------- $ext = ftype($fvrst); die "Error. $fvrst not 'bin' or 'nc4';" if $ext ne "bin" and $ext ne "nc4"; + if ($ext eq 'bin') { + $binRST = 1; + } else { + $binRST = 0; + } $rst_template = "%s.%s.${ymd}_${hr}z.$ext"; $rst_templateB = "%s.%s.${ymd}_${hr}z.bin"; @@ -1413,7 +1503,7 @@ sub resolve_bcsTAG { # was BCS tag found? #------------------ else { - print "\nWARNING. Cannot recognize Tag ID: $tagIDx"; + print "\nWARNING. Cannot recognize Tag ID: $tagIDx (NOTE: Use only X.Y for Git Tags)"; print " ($tagID)" if $tagID ne $tagIDx; print "\n"; } @@ -1465,12 +1555,13 @@ sub check_programs { die "Error. Program not found: $rs_scaleX;" unless -x $rs_scaleX; } if ($CS{$grOUT}) { - $interp_restartsX = "$ESMABIN/interp_restarts.x"; + + if ($binRST) { + $interp_restartsX = "$ESMABIN/interp_restarts_bin.x"; + } else { + $interp_restartsX = "$ESMABIN/interp_restarts.x"; + } $g5modules = "$ESMABIN/g5_modules"; - $c2cX = "$ESMABIN/c2c.x"; - die "Error. $interp_restartsX not found;" unless -e $interp_restartsX; - die "Error. $g5modules not found;" unless -e $g5modules; - die "Error. $c2cX not found;" unless -x $c2cX; } } @@ -1540,8 +1631,13 @@ sub check_rst_files { %notfound = (); if ($surfFLG) { foreach $type (sort keys %SURFACE) { - if ($type eq "catchcn_internal_rst") { next unless $mk_catchcn } - if ($type eq "route_internal_rst") { next } + if ($type eq "catchcn_internal_rst") { + next unless $mk_catchcn; + delete($SURFACE{$type}); + $type = "catchcn${cnlist[0]}_internal_rst"; + $SURFACE{$type} = 1; + } + if ($type eq "route_internal_rst") { next } $fname = rstname($expid, $type, $rstIN_template); $file = findinput($fname); @@ -1550,9 +1646,32 @@ sub check_rst_files { else { $notfound{$type} = 1 } } foreach $type (keys %notfound) { - next if $type eq "catchcn_internal_rst"; $SURFACE{$type} = 0; $swFLG = 1; + if ($type eq "catchcn${cnlist[0]}_internal_rst") { + $SURFACE{$type} = 1; + if (scalar(@cnlist) eq 4) { + # find GEOSldas file first + $fname = rstname($cnlist[1], $type, "%s.%s.${ymd}_${hr}00"); + my $ldas_rst_dir = "$cnlist[2]/$cnlist[1]/output/$cnlist[3]/rs/ens0000/Y${year}/M${month}/"; + $file = findinput($fname, $ldas_rst_dir); + # find LDASsa file + unless ($file) { + $fname = rstname($cnlist[1], $type, "%s.ens0000.%s.${ymd}_${hr}00z"); + $ldas_rst_dir = "$cnlist[2]/$cnlist[1]/output/$cnlist[3]/rs/ens0000/Y${year}/M${month}/"; + $file = findinput($fname, $ldas_rst_dir); + } + } + elsif (scalar(@cnlist) eq 1) { + $fname = rstname($expid, $type, "%s.%s.${ymd}_${hr}00"); + $file = findinput($fname); + } + if ($file) { $input_restarts{$type} = $file} + else { + die("File $file not found;"); + } + next; + } if ($type eq "saltwater_internal_rst") { $swFLG = 0 if $notfound{"openwater_internal_rst"}; $swFLG = 0 if $notfound{"seaicethermo_internal_rst"} @@ -1841,7 +1960,7 @@ sub set_IN_OUT { my ($HH, $agrid, $atmosID1, $atmosID2, $atmosID3, $atmosID4); my ($bcsTAG, $bcsdir, $gridID, $gridID_tile, $hgrid); my ($im, $im4, $imo, $imo4, $jm, $jm4, $jm5, $jmo, $jmo4); - my ($oceanID1, $oceanID2, $ogrid, $ogrid_); + my ($oceanID1, $oceanID2, $ogrid, $ogrid_, $omdl); my ($tile, $topo, $val); # tag values @@ -1873,7 +1992,10 @@ sub set_IN_OUT { $OUT{"ogrid"} = $grOUTocean; $IN{"ogrid_"} = $grINocean_; # used for display purposes - $OUT{"ogrid_"} = $grOUTocean; + $OUT{"ogrid_"} = $grOUTocean_; + + $IN{"omdl"} = $mdlINocean; + $OUT{"omdl"} = $mdlOUTocean; # bkg_eta grid value #------------------- @@ -1930,6 +2052,7 @@ sub set_IN_OUT { $agrid = $$HH{"agrid"}; $ogrid = $$HH{"ogrid"}; $ogrid_ = $$HH{"ogrid_"}; + $omdl = $$HH{"omdl"}; $im = $im{$agrid}; $im4 = $im4{$agrid}; @@ -2027,7 +2150,15 @@ sub set_IN_OUT { $bcsdir = "$bcsHEAD/$bcsTAG/$gridID"; } if ($coupledFLG{$ogrid}) { - $bcsdir = (<${bcsdir}*>)[0]; + if ($rank{$bcsTAG} >= $rank{"Icarus-NLv3_Reynolds"}) { + $bcsdir = "$coupled_model_dir/Icarus-NLv3/$omdl/$gridID_tile"; + } elsif ($rank{$bcsTAG} >= $rank{"Icarus_Reynolds"}) { + $bcsdir = "$coupled_model_dir/Icarus/$omdl/$gridID_tile"; + } elsif ($rank{$bcsTAG} >= $rank{"Ganymed-4_0_Reynolds"}) { + $bcsdir = "$coupled_model_dir/Ganymed/$omdl/$gridID_tile"; + } else { + die "Only BCs Ganymed-4_0 and newer supported"; + } } die "Error; Cannot find bcs directory: $bcsdir;" unless -d $bcsdir; @@ -2050,9 +2181,9 @@ sub set_IN_OUT { } $tile = "$bcsdir/$tile"; + # Coupled tile files if ($coupledFLG{$ogrid}) { - $tile = "${gridID_tile}-Pfafstetter.til"; - $tile = "$coupled_model_tile{$tile}/$tile"; + $tile = "$bcsdir/${gridID_tile}-Pfafstetter.til"; } die "Error. Cannot find tile file: $tile" unless -f $tile; @@ -2137,6 +2268,7 @@ sub confirm_inputs { . ". atmos grid: $IN{atmos3} ($IN{agrid})\n" . ". atmos levs: $IN{levs}\n" . ". ocean grid: $IN{ocean} ($IN{ogrid_})\n" + . ". ocean model: $IN{omdl}\n" . ". bcsdir: $IN{bcsdir}\n" . ". tile file: $IN{tile}\n" . ". BCS tag: $IN{bcsTAG}\n"); @@ -2163,6 +2295,7 @@ sub confirm_inputs { . ". atmos grid: $OUT{atmos3} ($OUT{agrid})\n" . ". atmos levs: $OUT{levs}\n" . ". ocean grid: $OUT{ocean} ($OUT{ogrid})\n" + . ". ocean model: $OUT{omdl}\n" . ". bcsdir: $OUT{bcsdir}\n" . ". tile file: $OUT{tile}\n"); print_( ". bkg_eta grid: $OUT{bkg_regrid}\n") if $OUT{"bkg_regrid"}; @@ -2255,16 +2388,17 @@ sub copy_upperair_rsts { #======================================================================= # name - regrid_upperair_rsts_CS -# purpose - set up and submit PBS job to perform conversion to +# purpose - set up and submit batch job to perform conversion to # cubed-sphere upper-air restarts #======================================================================= sub regrid_upperair_rsts_CS { - my ($qcmdlog, $im, $NPE, $QOS, $QOSline, $MEMPERCPU, $nwrit); + my ($qcmdlog, $im, $NPE, $QOS, $QOSline, $PART, $PARTline, $MEMPERCPU, $nwrit); my ($type, $src, $dest, $input_nml, $FH); my ($DYN, $MOIST, $ACHEM, $CCHEM, $CARMA, $AGCM, $AGCMout, $GMICHEM, $GOCART); my ($MAM, $MATRIX, $PCHEM, $STRATCHEM, $TR); + my ($HEMCO, $SSCHEM, $DUCHEM, $NICHEM, $SUCHEM, $CABRCHEM, $CABCCHEM, $CAOCCHEM); my ($moist, $newrst, $rst, $status); - my ($mynodes); + my (%allowedConstraint); $im = $im{$grOUT}; if ($im eq "12") { $NPE = 12; $nwrit = 1 } @@ -2289,9 +2423,18 @@ sub regrid_upperair_rsts_CS { if ($QOS) { $QOSline = "SBATCH --qos=$QOS" } else { $QOSline = "" } + $PART = $partition; + if ($PART) { $PARTline = "SBATCH --partition=$PART" } + else { $PARTline = "" } + if ($im >= "2880") { $MEMPERCPU = "--mem-per-cpu=4G"} else { $MEMPERCPU = "" } + %allowedConstraint = ( "hasw" => 1, "sky" => 1, "cas" => 1); + unless($allowedConstraint{$constraint}) { + die "Error. Constraint $constraint is not allowed."; + } + # MAT Workaround C180 -> C720 cannot run on 192 # --------------------------------------------- if (($im{$grIN} eq "180") and ($im eq "720")) { $NPE = 96 } @@ -2335,6 +2478,14 @@ sub regrid_upperair_rsts_CS { $PCHEM = rstname($expid, "pchem_internal_rst", $rstIN_template); $STRATCHEM = rstname($expid, "stratchem_internal_rst", $rstIN_template); $TR = rstname($expid, "tr_internal_rst", $rstIN_template); + $HEMCO = rstname($expid, "hemco_internal_rst", $rstIN_template); + $SSCHEM = rstname($expid, "ss_internal_rst", $rstIN_template); + $DUCHEM = rstname($expid, "du_internal_rst", $rstIN_template); + $NICHEM = rstname($expid, "ni_internal_rst", $rstIN_template); + $SUCHEM = rstname($expid, "su_internal_rst", $rstIN_template); + $CABRCHEM = rstname($expid, "cabr_internal_rst", $rstIN_template); + $CABCCHEM = rstname($expid, "cabc_internal_rst", $rstIN_template); + $CAOCCHEM = rstname($expid, "caoc_internal_rst", $rstIN_template); chdir_($workdir, $verbose); $ACHEM = "" unless -e $ACHEM; @@ -2348,16 +2499,17 @@ sub regrid_upperair_rsts_CS { $PCHEM = "" unless -e $PCHEM; $STRATCHEM = "" unless -e $STRATCHEM; $TR = "" unless -e $TR; + $HEMCO = "" unless -e $HEMCO; + $DUCHEM = "" unless -e $DUCHEM; + $SSCHEM = "" unless -e $SSCHEM; + $NICHEM = "" unless -e $NICHEM; + $SUCHEM = "" unless -e $SUCHEM; + $CABRCHEM = "" unless -e $CABRCHEM; + $CABCCHEM = "" unless -e $CABCCHEM; + $CAOCCHEM = "" unless -e $CAOCCHEM; $AGCMout = rstnameI(".", "agcm_import_rst"); - my $npn = `facter processorcount`; chomp($npn); - if ( $npn == 40 ) { - $mynodes = "sky"; - } else { - $mynodes = "hasw"; - } - # write input.nml file #--------------------- $input_nml = "$workdir/input.nml"; @@ -2386,8 +2538,9 @@ sub regrid_upperair_rsts_CS { #SBATCH --time=1:00:00 #SBATCH --ntasks=${NPE} ${MEMPERCPU} #SBATCH --job-name=regrid -#SBATCH --constraint=$mynodes +#SBATCH --constraint=$constraint #$QOSline +#$PARTline unlimit @@ -2412,6 +2565,14 @@ sub regrid_upperair_rsts_CS { if( ".$PCHEM" != . ) /bin/ln -s $PCHEM pchem_internal_restart_in if( ".$STRATCHEM" != . ) /bin/ln -s $STRATCHEM stratchem_internal_restart_in if( ".$TR" != . ) /bin/ln -s $TR tr_internal_restart_in +if( ".$HEMCO" != . ) /bin/ln -s $HEMCO hemco_internal_restart_in +if( ".$DUCHEM" != . ) /bin/ln -s $DUCHEM du_internal_restart_in +if( ".$SSCHEM" != . ) /bin/ln -s $SSCHEM ss_internal_restart_in +if( ".$NICHEM" != . ) /bin/ln -s $NICHEM ni_internal_restart_in +if( ".$SUCHEM" != . ) /bin/ln -s $SUCHEM su_internal_restart_in +if( ".$CABRCHEM" != . ) /bin/ln -s $CABRCHEM cabr_internal_restart_in +if( ".$CABCCHEM" != . ) /bin/ln -s $CABCCHEM cabc_internal_restart_in +if( ".$CAOCCHEM" != . ) /bin/ln -s $CAOCCHEM caoc_internal_restart_in # The MERRA fvcore_internal_restarts don't include W or DZ, but we can add them by setting # HYDROSTATIC = 0 which means HYDROSTATIC = FALSE @@ -2421,31 +2582,25 @@ sub regrid_upperair_rsts_CS { if (\$?I_MPI_ROOT) then - # intel scaling suggestions - #-------------------------- + # Based on GEOSgcm NCCS Intel MPI settings + #----------------------------------------- - setenv I_MPI_DAPL_UD on - - setenv DAPL_UCM_CQ_SIZE 4096 - setenv DAPL_UCM_QP_SIZE 4096 - - setenv I_MPI_DAPL_UD_SEND_BUFFER_NUM 4096 - setenv I_MPI_DAPL_UD_RECV_BUFFER_NUM 4096 - setenv I_MPI_DAPL_UD_ACK_SEND_POOL_SIZE 4096 - setenv I_MPI_DAPL_UD_ACK_RECV_POOL_SIZE 4096 - setenv I_MPI_DAPL_UD_RNDV_EP_NUM 2 - setenv I_MPI_DAPL_UD_REQ_EVD_SIZE 2000 - - setenv DAPL_UCM_REP_TIME 2000 - setenv DAPL_UCM_RTU_TIME 2000 - setenv DAPL_UCM_RETRY 7 - setenv DAPL_ACK_RETRY 7 - setenv DAPL_ACK_TIMER 20 - setenv DAPL_UCM_RETRY 10 - setenv DAPL_ACK_RETRY 10 + setenv I_MPI_ADJUST_ALLREDUCE 12 + setenv I_MPI_ADJUST_GATHERV 3 + + setenv I_MPI_SHM_HEAP_VSIZE 512 + setenv PSM2_MEMORY large + setenv I_MPI_EXTRA_FILESYSTEM 1 + setenv I_MPI_EXTRA_FILESYSTEM_FORCE gpfs + setenv ROMIO_FSTYPE_FORCE "gpfs:" else if (\$?MVAPICH2) then + setenv MV2_ENABLE_AFFINITY 0 + setenv MV2_ENABLE_AFFINITY 0 + setenv SLURM_DISTRIBUTION block + setenv MV2_MPIRUN_TIMEOUT 100 + setenv MV2_GATHERV_SSEND_THRESHOLD 256 endif @@ -2498,7 +2653,7 @@ sub regrid_upperair_rsts_CS { system_("$regridj 1>$qcmdlog 2>&1") && die "Error with $regridj;"; } else { - print_("\nThe CS regridding is MPI based; submitting job to PBS\n"); + print_("\nThe CS regridding is MPI based; submitting job to batch system\n"); system_("$qcmd $qwaitFLG -o $qcmdlog $regridj"); } chdir_($workdir, $verbose); @@ -2704,9 +2859,11 @@ sub regrid_surface_rsts { foreach $type (sort keys %SURFACE) { next unless $SURFACE{$type}; - if ($type eq "catch_internal_rst") { next unless $mk_catch } - if ($type eq "catchcn_internal_rst") { next unless $mk_catchcn } - if ($type eq "route_internal_rst") { next unless $mk_route } + if ($type eq "catch_internal_rst") { next unless $mk_catch } + if ($type eq "catchcn_internal_rst") { next } + if ($type eq "catchcn${cnlist[0]}_internal_rst") { next unless $mk_catchcn}; + + if ($type eq "route_internal_rst") { next unless $mk_route } if ($landIceDT) { if ($H1{"landIce"}) { @@ -2731,15 +2888,17 @@ sub regrid_surface_rsts { $flags .= " -openwater" if $input_restarts{"openwater_internal_rst"}; $flags .= " -seaice" if $input_restarts{"seaicethermo_internal_rst"}; - $flags .= " -route" if $mk_route; - $flags .= " -catch" if $mk_catch; - $flags .= " -catchcn" if $mk_catchcn; + $flags .= " -route" if $mk_route; + $flags .= " -catch" if $mk_catch; + $flags .= " -catchcn $mk_catchcn" if $mk_catchcn; $flags .= " -wemin $wemIN" if $mk_catch or $mk_catchcn; $flags .= " -wemout $wemOUT" if $mk_catch or $mk_catchcn; $flags .= " -surflay $surflay" if $mk_catch or $mk_catchcn; $flags .= " -grpID $grpID" if ($mk_catch or $mk_catchcn) and $grpID; $flags .= " -rsttime $ymd$hr" if $mk_catchcn or $mk_route; $flags .= " -qos $qos" if ($mk_catch or $mk_catchcn) and $qos; + $flags .= " -partition $partition" if ($mk_catch or $mk_catchcn) and $partition; + $flags .= " -constraint $constraint" if ($mk_catch or $mk_catchcn) and $constraint; } $flags .= " -zoom $zoom" if $zoom; @@ -2769,7 +2928,7 @@ sub regrid_surface_rsts { $template1 = $H1{"template"}; $catchtype{"catch_internal_rst"} = 1; - $catchtype{"catchcn_internal_rst"} = 1; + $catchtype{"catchcn${cnlist[0]}_internal_rst"} = 1; foreach $type (@SFC) { next if $type eq "route_internal_rst"; @@ -2785,9 +2944,9 @@ sub regrid_surface_rsts { else { print_("\n$type not found.\n"); - # use catch for catchcn, if needed + # use catch for catchcn, if needed. WJ note: use catch for cnclm40 only #--------------------------------- - if ($type eq "catchcn_internal_rst") { + if ($type eq "catchcn${cnlist[0]}_internal_rst") { $alt = "catch_internal_rst"; $src = $input_restarts{$alt}; if ($src) { @@ -2815,6 +2974,18 @@ sub regrid_surface_rsts { symlinkinput($tile2, $OutData_dir); } + # catchcn apparently needs clsm here, but + # this breaks the catch regridding. So only + # link here if catchcn. Note that there is + # *another* link to clsm below for the catch case + if ($mk_catchcn) { + # link clsm directory to OutData + #------------------------------- + $clsm = dirname($tile2) ."/clsm"; + $clsm = "$H2{bcsdir}/clsm" unless -d $clsm; + symlinkinput($clsm, $OutData_dir); + } + # link rst directory to OutData #------------------------------ symlinkinput("$H2{bcsdir}/rst", $OutData_dir) if $mk_route; @@ -2862,12 +3033,13 @@ sub regrid_surface_rsts { $catch = "$rstdir2/$catchName"; $catch .= ".$tagID.$gridID" if $label; - $catchcnName = rstname($expid2, "catchcn_internal_rst", $template2); - $catchcnIN = "$InData_dir/$catchcnName"; - - $catchcn = "$rstdir2/$catchcnName"; - $catchcn .= ".$tagID.$gridID" if $label; - + if ($mk_catchcn) { + #$catchcnName = rstname($expid2, "catchcn${cnlist[0]}_internal_rst", $template2); + $catchcnName = rstname($expid2, "catchcn${cnlist[0]}_internal_rst", "%s.%s.${ymd}_${hr}z.nc4"); + $catchcnIN = "$InData_dir/$catchcnName"; + $catchcn = "$rstdir2/$catchcnName"; + $catchcn .= ".$tagID.$gridID" if $label; + } # new input directory for step 2 #------------------------------- move_($InData_dir, "$InData_dir.step1", $verbose); @@ -2879,31 +3051,38 @@ sub regrid_surface_rsts { move_("\n$catch", "$catchIN", $verbose) if $mk_catch; move_("\n$catchcn", "$catchcnIN", $verbose) if $mk_catchcn; - # link clsm directory to OutData - #------------------------------- - $clsm = dirname($tile2) ."/clsm"; - $clsm = "$H2{bcsdir}/clsm" unless -d $clsm; - symlinkinput($clsm, $OutData_dir); + # Note this was done above if catchcn is being + # regridded. It is done here because now catch + # needs it, but we don't want to do it twice + unless ($mk_catchcn) { + # link clsm directory to OutData + #------------------------------- + $clsm = dirname($tile2) ."/clsm"; + $clsm = "$H2{bcsdir}/clsm" unless -d $clsm; + symlinkinput($clsm, $OutData_dir); + } # catch and/or catchcn restart only during this pass #--------------------------------------------------- $flags = ""; - $flags .= " -catch" if $mk_catch; - $flags .= " -catchcn" if $mk_catchcn; - $flags .= " -wemin $wemIN" if $mk_catch or $mk_catchcn; - $flags .= " -wemout $wemOUT" if $mk_catch or $mk_catchcn; - $flags .= " -surflay $surflay"; + $flags .= " -catch" if $mk_catch; + $flags .= " -catchcn $mk_catchcn" if $mk_catchcn; + $flags .= " -wemin $wemIN" if $mk_catch or $mk_catchcn; + $flags .= " -wemout $wemOUT" if $mk_catch or $mk_catchcn; + $flags .= " -surflay $surflay" if $mk_catch or $mk_catchcn; $flags .= " -grpID $grpID" if ($mk_catch or $mk_catchcn) and $grpID; $flags .= " -rsttime $ymd$hr" if $mk_catchcn; $flags .= " -rescale" if $mk_catch or $mk_catchcn; $flags .= " -zoom $zoom" if $zoom; $flags .= " -qos $qos" if ($mk_catch or $mk_catchcn) and $qos; + $flags .= " -partition $partition" if ($mk_catch or $mk_catchcn) and $partition; + $flags .= " -constraint $constraint" if ($mk_catch or $mk_catchcn) and $constraint; #--$flags .= " -walltime 2:00:00" if $mk_catchcn; #--$flags .= " -ntasks 112" if $mk_catchcn; @SFC = (); push @SFC, "catch_internal_rst" if $mk_catch; - push @SFC, "catchcn_internal_rst" if $mk_catchcn; + push @SFC, "catchcn${cnlist[0]}_internal_rst" if ($mk_catchcn); # run mk_Restarts program #------------------------ @@ -3003,6 +3182,7 @@ sub rename_surface_rsts { } $newname = rstname($expid2, $type, "$outdir/$template2"); $newname .= ".$tagID.$gridID" if $label; + if ($type eq "catchcn${cnlist[0]}_internal_rst" ){ $newname = rstname($expid2, $type, "$outdir/%s.%s.${ymd}_${hr}z.nc4")}; move_("\n$newrst", $newname); } @@ -3261,6 +3441,7 @@ sub write_CMD_file { } $capture .= " -tagin $tagIN" if $capture !~ m/\s+\-tagin\b/; $capture .= " -oceanin $grINocean_" if $capture !~ m/\s+\-oceanin\b/; + $capture .= " -ocnmdlin $mdlINocean" if $capture !~ m/\s+\-ocnmdlin\b/; } if ($interactive) { @@ -3285,6 +3466,7 @@ sub write_CMD_file { $capture .= " -rs $rsFLG" if $capture !~ m/\s+\-rs\b/; $capture .= " -oceanout $grOUTocean" if $capture !~ m/\s+\-oceanout\b/; + $capture .= " -ocnmdlout $mdlOUTocean" if $capture !~ m/\s+\-ocnmdlout\b/; if ($mk_catchcn) { $capture .= " -catchcn" if $capture !~ m/\s+\-catchcn\b/; @@ -3296,6 +3478,9 @@ sub write_CMD_file { $capture .= " -iceDT 0" if $capture !~ m/\s+\-iceDT\b/; } + $capture .= " -wemin $wemIN" if $capture !~ m/\s+\-wemin\b/; + $capture .= " -wemout $wemOUT" if $capture !~ m/\s+\-wemout\b/; + $capture .= " -grpID $grpID" if $capture !~ m/\s+\-grpID\b/ and $grpID; $capture .= " -zoom $zoom" if $capture !~ m/\s+\-zoom\b/ and $zoom_; @@ -3796,10 +3981,10 @@ sub usage { ----------------------------- as ordered runtime parameters ----------------------------- - yyyymmdd 8-digit date of the restarts being regridded - hr 2-digit hour of the restarts being regridded - grOUT grid ID of the output restarts (see GRID IDENTIFIERS below) - outdir directory location for output restarts + yyyymmdd 8-digit date of the restarts being regridded + hr 2-digit hour of the restarts being regridded + grOUT grid ID of the output restarts (see GRID IDENTIFIERS below) + outdir directory location for output restarts -------------------- or as flagged values @@ -3810,73 +3995,96 @@ sub usage { -outdir outdir REQUIRED OPTION FOR MERRA INPUTS - -merra (same as -merra2) - -merra1 get input restarts from OPS MERRA-1 data archives - -merra2 get input restarts from OPS MERRA-2 data archives + -merra (same as -merra2) + -merra1 get input restarts from OPS MERRA-1 data archives + -merra2 get input restarts from OPS MERRA-2 data archives REQUIRED OPTIONS FOR NON-MERRA INPUTS - -d rstdir pathname for input tarfile or restart directory - -expid expid experiment ID of input restart files + -d rstdir pathname for input tarfile or restart directory + -expid expid experiment ID of input restart files INTERACTIVE OPTION - -i prompt for inputs that are not supplied - (this is the default if no inputs are supplied) - -np no prompt; take defaults for all prompts; - note: the -np flag takes precedence over the -i flag + -i prompt for inputs that are not supplied + (this is the default if no inputs are supplied) + -np no prompt; take defaults for all prompts; + note: the -np flag takes precedence over the -i flag OTHER OPTIONS - -levsout levsout number of atmosphere levels in output - -oceanin oceanIN ocean horizontal grid of inputs - =c : 1-deg (360x180); e.g. Reynolds - =e : 1/4-deg (1440x720); e.g. MERRA-2 - =f : 1/8-deg (2880x1440); e.g. OSTIA - =CS : OSTIA regridded to cubed-sphere - defaults to \'c\' - -oceanout oceanOUT ocean horizontal grid of outputs (see -oceanIN) - -esmabin ESMABIN location of build\'s scripts and programs; defaults to location - of regrid.pl script - -iceDT dtime datetime for alternate landice rst input if regridding to - \'Ganymed-2_0\' from earlier tag; dtime should have the - following format: -iceDT yyyymmdd_hh - if dtime is not provided or if no restarts can be found to - match dtime, then script will prompt user from list of - available datetimes. - if dtime eq \'0\', then alternate landice rst will not be used - -newid newid label to replace expid in output restart names; - defaults to \'n-expid\' where n is OUTPUT atmosphere grid ID - -tagin tagIN GCM or DAS tag associated with inputs (see TAGS below); - defaults to $former_tag - -tagout tagOUT GCM or DAS tag associated with outputs (see TAGS below); - defaults to $current_tag - -rs flag flag indicating which restarts to regrid - =1 for upper-air restarts only - =2 for land-surface restarts only - =3 for both upper-air and land-surface restarts (default) - -catchcn Create a version of the catch restart which contains carbon values; - Not valid for tags prior to Heracles; Note: This option will add - 10-20 minutes to the regrid process. - -wemin wemIN minimum water snow water equivalent for input catch/cn - -wemout wemOUT minimum water snow water equivalent for output catch/cn - - -route write the route_internal_rst - - -[no]bkg copy and rename input bkg + satbang/bias files - -[no]lbl label final restarts with \'tagID.gridID\' extension - -[no]lcv create rst.lcv file for final restarts - -gcm gcm mode; equivalent to -nobkg, -lbl, and -nolcv flags - -altbcs [bcsdir] use boundary condition files found in bcsdir; if bcsdir - is not given, then use Larry\'s bcs directory - -zoom n zoom value to send to land regridding codes - - -grpid group id; sponsor code to use for batch job charge - -qos val use \'SBATCH --qos=val directive\' for batch jobs; - \'-qos debug\' will not work unless these conditions are met - -> numtasks <= 532 - -> walltime le \'1:00:00\' - -db (debug mode) Do not clean work directory after running programs; - -dbh (debug hash) Show contents of hashes: \%IN and \%OUT - -v verbose mode - -h[elp] print usage message + -levsout levsout number of atmosphere levels in output + -ocnmdlin ocnMDLIN ocean input model + =data : data ocean (Reynolds, MERRA-2, Ostia, CS) + =MOM5 : MOM5 + =MOM6 : MOM6 + defailts to \'data\' + -oceanin oceanIN ocean horizontal grid of inputs + data ocean grids + =c : 1-deg (360x180); e.g. Reynolds + =e : 1/4-deg (1440x720); e.g. MERRA-2 + =f : 1/8-deg (2880x1440); e.g. OSTIA + =CS : OSTIA regridded to cubed-sphere + defaults to \'c\' + coupled ocean grids (requires choice of ocean model) + =aa : 5-deg (72x36) + =cc : 1-deg (360x200) + =dd : 1/2-deg (720x410) + =ee : 1/4-deg (1440x1080) + defaults to \'dd\' + -ocnmdlout ocnMDLOUT ocean model of outputs (see -ocnmdlin) + -oceanout oceanOUT ocean horizontal grid of outputs (see -oceanin) + -esmabin ESMABIN location of build\'s scripts and programs; defaults to location + of regrid.pl script + -iceDT dtime datetime for alternate landice rst input if regridding to + \'Ganymed-2_0\' from earlier tag; dtime should have the + following format: -iceDT yyyymmdd_hh + if dtime is not provided or if no restarts can be found to + match dtime, then script will prompt user from list of + available datetimes. + if dtime eq \'0\', then alternate landice rst will not be used + -newid newid label to replace expid in output restart names; + defaults to \'n-expid\' where n is OUTPUT atmosphere grid ID + -tagin tagIN GCM or DAS tag associated with inputs (see TAGS below); + defaults to $former_tag + -tagout tagOUT GCM or DAS tag associated with outputs (see TAGS below); + defaults to $current_tag + -rs flag flag indicating which restarts to regrid + =1 for upper-air restarts only + =2 for land-surface restarts only + =3 for both upper-air and land-surface restarts (default) + -catchcn offers 2 options: + = 0, cold start for CLM40 using an archived restart file. For e.g. + -catchcn 0, - Notice the trailing comma + = CN_VERSION, RESTART_ID, RESTART_PATH, RESTART_DOMAIN + to start from a GEOSldas restart file (Note, keywords are comma-separated). + where CN_VERSION is the 2-digit CLM version (40, 45, etc.) while other keywords + are same as those in GEOSldas exeinp file. For e.g. + -catchcn 45,GEOSldas45_M36_rst_ldas06_16,/discover/nobackup/elee15/GEOSldas_4_5/sims/,SMAP_EASEv2_M36 + IMPORTANT GEOSldas restart file at 0z on the AGCM restart date must be available in GEOSldas directory. + Not valid for tags prior to Heracles; Note: This option will add + 10-20 minutes to the regrid process. + -wemin wemIN minimum water snow water equivalent for input catch/cn + -wemout wemOUT minimum water snow water equivalent for output catch/cn + + -route write the route_internal_rst + + -[no]bkg copy and rename input bkg + satbang/bias files + -[no]lbl label final restarts with \'tagID.gridID\' extension + -[no]lcv create rst.lcv file for final restarts + -gcm gcm mode; equivalent to -nobkg, -lbl, and -nolcv flags + -altbcs [bcsdir] use boundary condition files found in bcsdir; if bcsdir + is not given, then use Larry\'s bcs directory + -zoom n zoom value to send to land regridding codes + + -grpid group id; sponsor code to use for batch job charge + -qos val use \'SBATCH --qos=val directive\' for batch jobs; + \'-qos debug\' will not work unless these conditions are met + -> numtasks <= 532 + -> walltime le \'1:00:00\' + -partition val use \'SBATCH --partition=val directive\' for batch jobs + -constraint val use \'SBATCH --constraint=val directive\' for batch jobs + -db (debug mode) Do not clean work directory after running programs; + -dbh (debug hash) Show contents of hashes: \%IN and \%OUT + -v verbose mode + -h[elp] print usage message GRID IDENTIFIERS @@ -3896,27 +4104,36 @@ sub usage { ------------------ Cn, where n = {12, 24, 48, 90, 180, 360, 500, 720, 1000, 1440, 2000, 2880, 5760} - Ocean Horizontal Grids - ====================== + Data Ocean Horizontal Grids + =========================== c = 1-deg (360x180); e.g. Reynolds e = 1/4-deg (1440x720) ; e.g. MERRA-2 f = 1/8-deg (2880x1440); e.g. OSTIA CS = OSTIA regridded to cubed-sphere grid + Coupled Ocean Horizontal Grids + ============================== + aa = 5-deg (72x36) (MOM6 only) + cc = 1-deg (360x200) + dd = 1/2-deg (720x410) + ee = 1/4-deg (1440x1080) + TAGS Use GCM or DAS tag names with -tagin and -tagout flags Sample GCM tags --------------- - F14 : $F14[1] ............ $F14[-1] - F21 : $F21[1] ............ $F21[-1] - G10 : $G10[1] ............ $G10[-1] - G10p : $G10p[1] ......... $G10p[-1] - G20 : $G20[1] ............ $G20[-1] - G30 : $G30[1] ............ $G30[-1] - G40 : $G40[1] ............ $G40[-1] - ICA : $ICA[1] ................. $ICA[-1] - INL : $INL[1] .............. $INL[-1] + F14 : $F14[1] ........... $F14[-1] + F21 : $F21[1] ........... $F21[-1] + G10 : $G10[1] ........... $G10[-1] + G10p : $G10p[1] ........ $G10p[-1] + G20 : $G20[1] ........... $G20[-1] + G30 : $G30[1] ........... $G30[-1] + G40 : $G40[1] ........... $G40[-1] + ICA : $ICA[1] ................ $ICA[-1] + GITOL : $GITOL[1] .................. $GITOL[-1] + INL : $INL[1] ............. $INL[-1] + GITNL : $GITNL[1] ................. $GITNL[-1] Sample DAS tags --------------- @@ -3929,9 +4146,11 @@ sub usage { 5B0 : $D5B0[1] ..... $D5B0[-1] 512 : $D512[1] ........ $D512[-1] 517 : $D517[1] ........ $D517[-1] + 525 : $D525[1] ........ $D525[-1] AUTHOR Joe Stassi, SSAI (joe.stassi\@nasa.gov) + Matthew Thompson, SSAI (matthew.thompson\@nasa.gov) EOF ; diff --git a/GEOS_Util/post/stats.F90 b/GEOS_Util/post/stats.F90 index d66b9ea7..6b616b5e 100644 --- a/GEOS_Util/post/stats.F90 +++ b/GEOS_Util/post/stats.F90 @@ -1262,7 +1262,7 @@ end subroutine init_levs call timeend ('main') call timepri (6) - stop + call ESMF_Finalize() end SUBROUTINE BOUNDS (LAT1,LAT2,LONG1,LONG2, & @@ -1294,6 +1294,7 @@ SUBROUTINE BOUNDS (LAT1,LAT2,LONG1,LONG2, & subroutine read_clim_hdf ( nymd,nhms,fields_2d,fields_3d,n2d,n3d,idim,jdim,nl,zlev,cli_files,num,undef ) use stats_mod + use ESMF implicit none integer n2d,n3d type(fields) :: fields_2d(n2d) @@ -1393,7 +1394,7 @@ subroutine read_clim_hdf ( nymd,nhms,fields_2d,fields_3d,n2d,n3d,idim,jdim,nl,zl call gfio_open ( cli_files(n),1,id(n),rc ) if( rc.ne.0 ) then print *, 'Climatology File: ',trim(cli_files(n)),' NOT found!' - call exit(1) + call ESMF_Finalize() stop endif call gfio_diminquire ( id(n),im,jm,lm,ntime,nvars,ngatts,rc ) @@ -1401,6 +1402,7 @@ subroutine read_clim_hdf ( nymd,nhms,fields_2d,fields_3d,n2d,n3d,idim,jdim,nl,zl if( ntime.ne.12 ) then print *, 'Climatology data should consist of 12 monthly means' print *, 'Current file: ',trim(cli_files(n)),' contains ',ntime,' time periods!' + call ESMF_Finalize() stop endif @@ -1469,6 +1471,7 @@ subroutine read_clim_hdf ( nymd,nhms,fields_2d,fields_3d,n2d,n3d,idim,jdim,nl,zl enddo if( nid.eq.-999 ) then print *, 'Climatology Datasets do not have desired TOD: ',nhms + call ESMF_Finalize() stop endif endif @@ -2643,6 +2646,7 @@ subroutine init_levs( fname,lm,lev ) subroutine init_fcst( fname,nfiles,dates,ndates,timinc,undef,collections,ncoll ) use stats_mod + use ESMF implicit none integer ncoll @@ -2729,6 +2733,7 @@ subroutine init_fcst( fname,nfiles,dates,ndates,timinc,undef,collections,ncoll ) print * print *, 'Forecast Files have exceeded 1000 Time Periods!' print * + call ESMF_Finalize() stop endif @@ -2916,6 +2921,7 @@ subroutine read_fcst( fname,nfiles,dates,ndates,nymd,nhms,fields_2d,fields_3d,n2 subroutine read_syserr( fields_2d,fields_3d,n2d,n3d,idim,jdim,nl,zlev,efile,ndt,undef ) use stats_mod + use ESMF implicit none integer :: n2d,n3d @@ -2967,6 +2973,7 @@ subroutine read_syserr( fields_2d,fields_3d,n2d,n3d,idim,jdim,nl,zlev,efile,ndt, call gfio_open ( efile,1,id,rc ) if( rc.ne.0 ) then print *, 'Systematic Error File: ',trim(efile),' NOT found!' + call ESMF_Finalize() stop endif call gfio_diminquire ( id,im,jm,lm,ntime,nvars,ngatts,rc ) diff --git a/GEOS_Util/post/time_ave.rc b/GEOS_Util/post/time_ave.rc index d0467b21..d3adbc67 100644 --- a/GEOS_Util/post/time_ave.rc +++ b/GEOS_Util/post/time_ave.rc @@ -21,7 +21,11 @@ QUADRATICS: 'u' , 'v' , 'omega' , 'qi' , 'omega' , 'o3' , 'ustar' , 'vstar' , 'USVS' , + 'ustar' , 'tstar' , 'USTS' , + 'ustar' , 'wstar' , 'USWS' , + 'ustar' , 'qstar' , 'USQS' , 'vstar' , 'tstar' , 'VSTS' , + 'vstar' , 'wstar' , 'VSWS' , 'vstar' , 'qstar' , 'VSQS' , 'wstar' , 'tstar' , 'WSTS' , 'wstar' , 'qstar' , 'WSQS' , diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/CMIP_ice.ctl b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/CMIP_ice.ctl deleted file mode 100644 index 5bf30c87..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/CMIP_ice.ctl +++ /dev/null @@ -1,14 +0,0 @@ -DSET ^/discover/nobackup/sakella/GEOSadas-5_11_0_p1/GEOSadas/src/GMAO_Shared/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/new_code/merra2/src/before_1982/CMIP_clim_adj_ice_19770901.bin -UNDEF 1.0e15 -TITLE f -OPTIONS SEQUENTIAL -THEADER 56 -* -XDEF 1440 LINEAR -179.875 0.25 -YDEF 720 LINEAR -89.875 0.25 -ZDEF 1 LINEAR 1 1 -TDEF 1 LINEAR 1Jan1977 1dy -VARS 1 -ice 0 1 ice -ENDVARS - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/CMIP_sst.ctl b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/CMIP_sst.ctl deleted file mode 100644 index 622d6a5f..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/CMIP_sst.ctl +++ /dev/null @@ -1,13 +0,0 @@ -DSET ^/discover/nobackup/sakella/GEOSadas-5_11_0_p1/GEOSadas/src/GMAO_Shared/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/new_code/merra2/src/before_1982/CMIP_clim_adj_sst_19770901.bin -UNDEF 1.0e15 -TITLE f -OPTIONS SEQUENTIAL -THEADER 56 -XDEF 1440 LINEAR -179.875 0.25 -YDEF 720 LINEAR -89.875 0.25 -ZDEF 1 LINEAR 1 1 -TDEF 1 LINEAR 1Jan1977 1dy -VARS 1 -sst 0 1 sst -ENDVARS - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/plot_CMIP_processed.gs b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/plot_CMIP_processed.gs deleted file mode 100644 index 348dc4f6..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/plot_CMIP_processed.gs +++ /dev/null @@ -1,45 +0,0 @@ -************************************************ -'reinit' -'set display color white' -'clear' -'set grads off' -* -*SST -'open CMIP_sst.ctl' -'subplot 2 1 1' -'set mproj latlon' -'set lon -180 180' -'set lat -90 90' -'set gxout grfill' -'set clevs 275.0 280.0 285.0 290.0 295.0 297.5 300.0 302.5 305.0' -'display sst' -'run basemap L' -'draw title CMIP processed (1/4 deg) SST 01/01/1977' -'run cbar 0.6 1 9.1 6.2' -*................................................................ -'open CMIP_ice.ctl' -'set dfile 2' -*NH ICE -'subplot 2 2 3' -'set mproj nps' -'set lon -180 180' -'set lat 30 90' -'set gxout grfill' -'set clevs 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.80 0.90 1.0' -'display ice' -'run basemap L' -*SH -'subplot 2 2 4' -'set mproj sps' -'set lon -180 180' -'set lat -90 -30' -'set gxout grfill' -'set clevs 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.80 0.90 1.0' -'display ice' -'run basemap L' -* -'run cbar 0.5 1 5.4 2.1' -* -*'printim CMIP_processed_19770101.png x1000 y800' -* - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/yrly_animations/CMIP_ice.ctl b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/yrly_animations/CMIP_ice.ctl deleted file mode 100644 index 6db2f273..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/yrly_animations/CMIP_ice.ctl +++ /dev/null @@ -1,13 +0,0 @@ -DSET ^/archive/u/sakella/MERRA2/bc_data/1982/CMIP/ICE_CMIP_19820101_19821231.bin -UNDEF 1.0e15 -TITLE f -OPTIONS SEQUENTIAL -THEADER 56 -XDEF 1440 LINEAR -179.875 0.25 -YDEF 720 LINEAR -89.875 0.25 -ZDEF 1 LINEAR 1 1 -TDEF 366 LINEAR 1Jan1982 1dy -VARS 1 -ice 0 1 ice -ENDVARS - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/yrly_animations/CMIP_sst.ctl b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/yrly_animations/CMIP_sst.ctl deleted file mode 100644 index a939d116..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/yrly_animations/CMIP_sst.ctl +++ /dev/null @@ -1,13 +0,0 @@ -DSET ^/archive/u/sakella/MERRA2/bc_data/1982/CMIP/SST_CMIP_19820101_19821231.bin -UNDEF 1.0e15 -TITLE f -OPTIONS SEQUENTIAL -THEADER 56 -XDEF 1440 LINEAR -179.875 0.25 -YDEF 720 LINEAR -89.875 0.25 -ZDEF 1 LINEAR 1 1 -TDEF 366 LINEAR 1Jan1982 1dy -VARS 1 -sst 0 1 sst -ENDVARS - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/yrly_animations/make_daily_anim.csh b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/yrly_animations/make_daily_anim.csh deleted file mode 100755 index 384c3f95..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/yrly_animations/make_daily_anim.csh +++ /dev/null @@ -1,25 +0,0 @@ -#/bin/csh - -set ESMADIR = /discover/nobackup/sakella/GEOSadas-5_11_0_p1/ -set myLOC = $ESMADIR/GEOSadas/src/GMAO_Shared/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/new_code/merra2/src/before_1982/grads_util/yrly_animations - -# set grada env properly from Larry;'s pkg -cd /discover/nobackup/sakella/GEOSadas/src/GMAO_Shared/GEOS_Util/plots/ -configure -source .quickplotrc - -cd $myLOC - -# now make those plots -set YYYY = 1982 - -grads -blcx $myLOC/plot_CMIP.gs - -convert -delay 60 -loop 0 $myLOC/CMIP_*.gif CMIP_Jan${YYYY}_Dec${YYYY}.gif - -#mv $myLOC/Reynolds_Jan${YYYY}_Dec${YYYY}.gif $myLOC/done/ - -#rm -f Reynolds_*.gif -##rm -f $myLOC/Reynolds_*.gif -# - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/yrly_animations/plot_CMIP.gs b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/yrly_animations/plot_CMIP.gs deleted file mode 100755 index 0ab1d6a3..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/grads_util/yrly_animations/plot_CMIP.gs +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh -************************************************ -'reinit' -'set display color white' -'clear' -* -'open CMIP_sst.ctl' -'open CMIP_ice.ctl' -'set grads off' -* -timex = 1 - -while( timex <= 366) -*PLOT SST -'subplot 2 1 1' -'set mproj latlon' -'set lon -180 180' -'set lat -90 90' -'set gxout grfill' -'set clevs 275.0 280.0 285.0 290.0 295.0 297.5 300.0 302.5 305.0' -'set t ' timex -'display sst' -'run basemap L' -'query time' - -cctime=subwrd(result,3) -coln=substr(cctime,3,1) -if coln = ':' -dmy =substr(cctime,7,9) -else -* -YYYY = substr(cctime,9,12) -* -TEMPstr = substr(cctime,4,5) -DD = substr(TEMPstr,1,2) -MM = substr(TEMPstr,3,5) -endif -'draw title ' DD' ' MM' ' YYYY' ' -'run cbar 0.7 1 9.0 6.1' -* -*PLOT FRACI -*NH -'subplot 2 2 3' -'set lon -180 180' -'set gxout grfill' -'set clevs 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.80 0.90 1.0' -'set mproj nps' -'set lat 45 90' -'display ice.2' -'run basemap L' -*SH -'subplot 2 2 4' -'set clevs 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.80 0.90 1.0' -'set mproj sps' -'set lat -90 -45' -'display ice.2' -'run basemap L' -'run cbar 0.63 1 5.4 2.2' -* -***************************************** -if (timex<10) -'printim CMIP_00'timex'.gif x600 y400' -endif - -if (timex >= 10 & timex <100) -'printim CMIP_0'timex'.gif x600 y400' -endif - -if (timex >= 100) -'printim CMIP_'timex'.gif x600 y400' -endif - -timex = timex + 1 -'clear' -endwhile -** -***************************************** -*grads -blcx XX.gs -*convert -delay 60 -loop 0 CMIP_*.png CMIP_Jan1983_Dec1983.gif -*mv CMIP_Jan1983_Dec1983.gif /discover/nobackup/sakella/GEOSadas-5_11_0_p1/GEOSadas/src/GMAO_Shared/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/new_code/merra2/src/grads_util/yrly_animations/done/ -*rm -f CMIP_*.png -***************************************** - - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/proc_cmip_sst_fraci.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/proc_cmip_sst_fraci.py deleted file mode 100644 index e3357166..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/proc_cmip_sst_fraci.py +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/python -#----------------------------------------------------------------- -''' -this script writes out lower boundary conditions (sst & Sea Ice Concentration) based on: -1. CMIP daily data, 2. CMIP daily climatology, 3. Reynolds daily climatology. - -[1] was generated using: a. mid-month 1x1 deg files from PCMDII, b. interp to 0.25x0.25 MERRA res., and c. generated linearly interpolated daily bin files. -See /discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/FOR_CMIP/ - -[2] & [3] contain climatology for each day of the year based on daily CMIP & Reynolds respectively. -for [3], see /discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/ - -also see /archive/u/sakella/MERRA2/bc_data/ - -Santha Akella 14 AUG 2013. -''' -#----------------------------------------------------------------- -import os -import sys - -import pylab as pylab -import numpy as numpy -import time as time - -import matplotlib.dates as md -import matplotlib.pyplot as plt - -from datetime import datetime, timedelta - -sys.path.append('/discover/nobackup/sakella/GEOSadas-5_11_0_p1/GEOSadas/src/GMAO_Shared/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/new_code/merra2/src/before_1982/') -from read_bin import read_bin -import write_cmip_bin -#----------------------------------------------------------------- -data_path_cmip_daily = '/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/FOR_CMIP/RAW_YRLY/' # processed files -cmip_clim_path = '/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/FOR_CMIP/CLIM/' # full clim or add _1982/' for 1982 -reynolds_clim_path = '/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/CLIM/' # full clim or add _1982/' for 1982 -# -cmip_sst_file_pre = 'cmip_raw_sst_' # Processed files -cmip_sic_file_pre = 'cmip_raw_sic_' -# -cmip_clim_pre = 'cmip_clim_' # Daily Climatology file Prefix -reynolds_clim_pre = 'clim_' # Daily Climatology file Prefix -#----------------------------------------------------------------- -start_date = datetime(1982,01,01,00,0,0) -end_date = datetime(1982,12,31,00,0,0) - -iDebug = 0 # [1]: yes, [0]: none. plot fields and save them to files -#----------------------------------------------------------------- -date_proc = start_date -while( date_proc <= end_date): - - # form files names - # daily CMIP - fName_sst_cmip = data_path_cmip_daily + date_proc.strftime('%Y')+'/' + cmip_sst_file_pre + date_proc.strftime('%Y%m%d') + '.bin' - fName_sic_cmip = data_path_cmip_daily + date_proc.strftime('%Y')+'/' + cmip_sic_file_pre + date_proc.strftime('%Y%m%d') + '.bin' - # form CMIP daily climatology file names - fName_cmip_sst_clim = cmip_clim_path + cmip_clim_pre + 'sst_2052' + date_proc.strftime('%m%d') + '.bin' - fName_cmip_sic_clim = cmip_clim_path + cmip_clim_pre + 'sic_2052' + date_proc.strftime('%m%d') + '.bin' - # form Reynolds daily climatology file names - fName_reynolds_sst_clim = reynolds_clim_path + reynolds_clim_pre + 'sst_2052' + date_proc.strftime('%m%d') + '.bin' - fName_reynolds_sic_clim = reynolds_clim_path + reynolds_clim_pre + 'sic_2052' + date_proc.strftime('%m%d') + '.bin' - - print 'Processing date: [%s] Using:'%(date_proc.strftime('%Y%m%d')) - - # get cmip DAILY sst & sic - [nymd1, nhms1, nymd2, nhms2, NLON, NLAT, cmip_daily_sst] = read_bin(fName_sst_cmip) - [nymd1, nhms1, nymd2, nhms2, NLON, NLAT, cmip_daily_sic] = read_bin(fName_sic_cmip) - - # get cmip CLIM sst & sic - [nymd1, nhms1, nymd2, nhms2, NLON, NLAT, cmip_clim_sst] = read_bin(fName_cmip_sst_clim) - [nymd1, nhms1, nymd2, nhms2, NLON, NLAT, cmip_clim_sic] = read_bin(fName_cmip_sic_clim) - - # get Reynolds CLIM sst & sic - [nymd1, nhms1, nymd2, nhms2, NLON, NLAT, reynolds_clim_sst] = read_bin(fName_reynolds_sst_clim) - [nymd1, nhms1, nymd2, nhms2, NLON, NLAT, reynolds_clim_sic] = read_bin(fName_reynolds_sic_clim) - - SSTx = cmip_daily_sst - cmip_clim_sst + reynolds_clim_sst - SICx = cmip_daily_sic - cmip_clim_sic + reynolds_clim_sic - - # make Antarctic values same as cmip daily - iLand_sst = numpy.where(reynolds_clim_sst < 200.0) - iLand_sic = numpy.where(reynolds_clim_sic <= 1.e-6) - - SSTx[iLand_sst] = cmip_daily_sst[iLand_sst] - SICx[iLand_sic] = cmip_daily_sic[iLand_sic] - - # SANITY CHECKS... - SSTx[ SICx > 1.0] = 273.15 - SSTx[ SICx < 0.0] = 273.15 - - SICx[ SICx > 1.0] = 1.0 - SICx[ SICx < 0.0] = 0.0 - #----------------------------------------------------------------- - if( iDebug): - plt.close('all') - coastLineFile = '/discover/nobackup/sakella/Stuff/matlabStuff/coastLine.dat' - [x_coast, y_coast] = pylab.loadtxt(coastLineFile, unpack=True) - - dlon = 360.0/numpy.float32(NLON) - dlat = 180.0/numpy.float32(NLAT) - lon = numpy.linspace(-180.0+dlon/2, 180.0-dlon/2, NLON) - lat = numpy.linspace(-90.0 +dlat/2, 90.0-dlat/2, NLAT) - #.............................. - plt.figure(num=1) - - plt.subplot(241), plt.pcolormesh(lon, lat, numpy.transpose(cmip_clim_sst), vmin=285.0, vmax=305.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight'), plt.title(r'CMIP CLIM') - - plt.subplot(242), plt.pcolormesh(lon, lat, numpy.transpose(reynolds_clim_sst), vmin=285.0, vmax=305.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight'), plt.title(r'Reynolds CLIM') - - plt.subplot(243), plt.pcolormesh(lon, lat, numpy.transpose(cmip_daily_sst), vmin=285.0, vmax=305.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight'), plt.title(r'Raw CMIP') - - plt.subplot(244), plt.pcolormesh(lon, lat, numpy.transpose(SSTx), vmin=285.0, vmax=305.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight'), plt.title(r'Modified CMIP') - # - plt.subplot(245), plt.pcolormesh(lon, lat, numpy.transpose(cmip_clim_sic), vmin=0.0, vmax=1.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - - plt.subplot(246), plt.pcolormesh(lon, lat, numpy.transpose(reynolds_clim_sic), vmin=0.0, vmax=1.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - - plt.subplot(247), plt.pcolormesh(lon, lat, numpy.transpose(cmip_daily_sic), vmin=0.0, vmax=1.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - - plt.subplot(248), plt.pcolormesh(lon, lat, numpy.transpose(SICx), vmin=0.0, vmax=1.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - #.............................. - #plt.show() - fName_print_fig = 'for_mod_cmip_clim_' + date_proc.strftime('%Y%m%d') + '.png' - plt.savefig(fName_print_fig,pad_inches=0.5,bbox_inches='tight',dpi=100, format='png')# orientation='landscape') - #----------------------------------------------------------------- - tomr_proc = date_proc + timedelta(days=1) - - # write SST & SIC to a binary file- that GCM can read. - write_cmip_bin.write_bin(date_proc.strftime('%Y%m%d'), \ - numpy.float(date_proc.strftime('%Y')), numpy.float(date_proc.strftime('%m')), numpy.float(date_proc.strftime('%d')), \ - numpy.float(tomr_proc.strftime('%Y')), numpy.float(tomr_proc.strftime('%m')), numpy.float(tomr_proc.strftime('%d')), \ - SSTx, SICx) - #----------------------------------------------------------------- - print ' ' - date_proc = date_proc + timedelta(days=1) - - del cmip_daily_sst, cmip_daily_sic, cmip_clim_sst, cmip_clim_sic, reynolds_clim_sst, reynolds_clim_sic - del SSTx, SICx -#----------------------------------------------------------------- - - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/get_cmip_sst_sic.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/get_cmip_sst_sic.py deleted file mode 100644 index 95805e08..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/get_cmip_sst_sic.py +++ /dev/null @@ -1,92 +0,0 @@ - -''' -read in sst & sic from raw cmip files. fields are mid-month fields. -''' -import os -import sys - -import numpy as numpy -import pylab as pylab -import matplotlib.pyplot as plt -import matplotlib.dates as dates - -from datetime import datetime -from mpl_toolkits.basemap import Basemap - -sys.path.append('/home/sakella/python_docs/myStuff/') -from read_netCDF import read_netCDF as get_field_netCDF_file -#---------------------------------------------------------------- -def get_cmip_sst_sic(fName_sst, fName_sic, iDebug, verbose=False): - - lon1 = get_field_netCDF_file(fName_sst, "longitude") - lat = get_field_netCDF_file(fName_sst, "latitude") - time1 = get_field_netCDF_file(fName_sst, "time") - - sst1 = get_field_netCDF_file(fName_sst, "tosbcs") - sic1 = get_field_netCDF_file(fName_sic, "sicbcs")/100.0 # to get [0,1] concentration. - - #sst_fill = 1.0e+20 - #ice_fill = 1.0e+20 - - #if( iDebug): - # print 'Min/Max of input SST...[%f], [%f]'%(sst.flatten().min(), sst.flatten().max()) - # print 'Min/Max of input ICE...[%f], [%f]'%(sic.flatten().min(), sic.flatten().max()) - #---------------------------------------------------------------- - # data set start date: - date0 = datetime(1979,01,01,00,0,0) - timeX = time1 + dates.date2num(date0) # adjust time stamps - - sst1[sic1 > 1.0] = 273.15 - sst1[sic1 < 0.0] = 273.15 # not sure if this is okay! Jul 25, 2013. - - sic1[sic1 > 1.0] = 1.0 - sic1[sic1 < 0.0] = 0.0 - #---------------------------------------------------------------- - # lon is from [0.5, 359.5]. flip it to [-179.5 to 179.5]. - lon = lon1 - 180.0 - - sst = numpy.zeros([numpy.shape(sst1)[0], numpy.shape(sst1)[1], numpy.shape(sst1)[2]], dtype=numpy.float64, order = 'F') - sic = numpy.zeros([numpy.shape(sic1)[0], numpy.shape(sic1)[1], numpy.shape(sic1)[2]], dtype=numpy.float64, order = 'F') - - for iMon in range(0, numpy.shape(sst1)[0]): - sst[iMon,:,180:360] = numpy.squeeze(sst1[iMon,:, 0:180]) - sst[iMon,:, 0:180] = numpy.squeeze(sst1[iMon,:,180:360]) - - sic[iMon,:,180:360] = numpy.squeeze(sic1[iMon,:, 0:180]) - sic[iMon,:, 0:180] = numpy.squeeze(sic1[iMon,:,180:360]) - #---------------------------------------------------------------- - print 'Working on Year...[%s]'%(dates.num2date(timeX)[0].year) - if( iDebug): - iPlot_month = 8 - #print 'Working on Year...[%s]'%(dates.num2date(timeX)[iPlot_month].year) - print 'Min/Max of input SST...[%f], [%f]'%(sst.flatten().min(), sst.flatten().max()) - print 'Min/Max of input ICE...[%f], [%f]'%(sic.flatten().min(), sic.flatten().max()) - - coastLineFile = '/discover/nobackup/sakella/Stuff/matlabStuff/coastLine.dat' - [x_coast, y_coast] = pylab.loadtxt(coastLineFile, unpack=True) - # - plt.figure() - plt.subplot(211) - plt.pcolor(lon, lat, numpy.squeeze(sst[iPlot_month,:,:]), vmin=275.0, vmax=305.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'SST [%s/%s]'%(dates.num2date(timeX)[iPlot_month].month, dates.num2date(timeX)[iPlot_month].year)) - - plt.subplot(212) - plt.pcolor(lon, lat, numpy.squeeze(sic[iPlot_month,:,:]), vmin=0.0, vmax=1.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'SIC [%s/%s]'%(dates.num2date(timeX)[iPlot_month].month, dates.num2date(timeX)[iPlot_month].year)) - # - #plt.show() - print ' ' - fName_print = 'raw_cmip_' + '%s_%s'%(dates.num2date(timeX)[iPlot_month].month, dates.num2date(timeX)[iPlot_month].year) + '.png' - plt.savefig(fName_print, dpi=100, format='png') - plt.close('all') - #---------------------------------------------------------------- - return lon, lat, timeX, sst, sic -#---------------------------------------------------------------- -if __name__ == '__main__': - ''' - ??? asdasd sd d sd ??? - - ''' - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/get_ls_mask.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/get_ls_mask.py deleted file mode 100644 index b6048868..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/get_ls_mask.py +++ /dev/null @@ -1,116 +0,0 @@ -''' -Create a land-sea mask for CMIP data using 1/4 deg Reynolds -''' - -import os -import sys - -import numpy as numpy -import pylab as pylab -import matplotlib.pyplot as plt - -from mpl_toolkits.basemap import Basemap - -sys.path.append('/home/sakella/python_docs/myStuff/') -from read_netCDF import read_netCDF as get_field_netCDF_file -#---------------------------------------------------------------- -def get_ls_mask(fName_Reynolds, fName_CMIP, iDebug, verbose=False): - - #.................................................................................................... - # CMIP fields - lon_cmip = numpy.float64( get_field_netCDF_file(fName_CMIP, 'longitude')) - lat_cmip = numpy.float64( get_field_netCDF_file(fName_CMIP, 'latitude')) - - #sst_cmip = numpy.float64( get_field_netCDF_file(fName_CMIP, 'daily_CMIP_SST')) - sst_cmip = numpy.float64( get_field_netCDF_file(fName_CMIP, 'CMIP_SST_adjusted_Reynolds')) - - #sic_cmip = numpy.float64( get_field_netCDF_file(fName_CMIP, 'daily_CMIP_SIC')) - sic_cmip = numpy.float64( get_field_netCDF_file(fName_CMIP, 'CMIP_SIC_adjusted_Reynolds')) - #.................................................................................................... - # Reynolds fields - lon_Rey = numpy.float64( get_field_netCDF_file(fName_Reynolds, 'lon')) # Reynolds- remember, lon is between (0, 360). - lat_Rey = numpy.float64( get_field_netCDF_file(fName_Reynolds, 'lat')) - sst1 = numpy.float64( get_field_netCDF_file(fName_Reynolds, 'sst')) + 273.15 - sic1 = numpy.float64( get_field_netCDF_file(fName_Reynolds, 'ice')) - #.................................................................................................... - - # FLIP Reynolds lon to be (-180, 180) - lon_Rey = lon_Rey - 180.0 - - # This way... - #sst_Rey = numpy.zeros([numpy.shape(sst1)[0], numpy.shape(sst1)[1]], dtype=numpy.float64, order = 'F') - #sic_Rey = numpy.zeros([numpy.shape(sic1)[0], numpy.shape(sic1)[1]], dtype=numpy.float64, order = 'F') - #sst_Rey[numpy.isnan(sst1)] = sst1[numpy.isnan(sst1)] - #sic_Rey[numpy.isnan(sic1)] = sic1[numpy.isnan(sic1)] - # Does not work. - - # Do following way. If you want to copy arrays, use sst_Rey[:] = sst1 - sst_Rey = numpy.empty_like(sst1) - sic_Rey = numpy.empty_like(sic1) - - sst_Rey[:,720:1440] = numpy.squeeze(sst1[:, 0:720]) - sst_Rey[:, 0:720] = numpy.squeeze(sst1[:,720:1440]) - - sic_Rey[:,720:1440] = numpy.squeeze(sic1[:, 0:720]) - sic_Rey[:, 0:720] = numpy.squeeze(sic1[:,720:1440]) - # - # open ocean is = 1.0, land = 0.0 - mask1 = numpy.ones([numpy.shape(sst_Rey)[0], numpy.shape(sst_Rey)[1]], dtype=numpy.float64, order = 'F') - mask1[sst_Rey._mask] = 0.0 # sst_Rey._mask is bool array (with true/flase). this mask is false, set mask = 0.0 - - mask2 = numpy.ones([numpy.shape(sic_Rey)[0], numpy.shape(sic_Rey)[1]], dtype=numpy.float64, order = 'F') - mask2[sic_Rey._mask] = 0.0 - #.................................................................................................... - if( iDebug): - coastLineFile = '/discover/nobackup/sakella/Stuff/matlabStuff/coastLine.dat' - [x_coast, y_coast] = pylab.loadtxt(coastLineFile, unpack=True) - - plt.figure(num=1) - plt.subplot(231) - plt.pcolormesh(lon_cmip, lat_cmip, sst_cmip, vmin=275.0, vmax=305.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'CMIP SST orig') - - plt.subplot(232) - plt.pcolormesh(lon_Rey, lat_Rey, sst_Rey, vmin=275.0, vmax=305.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'Reynolds SST') - - #......... - sst_cmip_masked = sst_cmip - sst_cmip_masked[mask1==0.0] = numpy.nan - plt.subplot(233) - plt.pcolormesh(lon_cmip, lat_cmip, sst_cmip_masked, vmin=275.0, vmax=305.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'masked cmip sst') - # - plt.subplot(234) - plt.pcolormesh(lon_cmip, lat_cmip, sic_cmip, vmin=0.0, vmax=1.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'CMIP SIC') - - plt.subplot(235) - plt.pcolormesh(lon_Rey, lat_Rey, sic_Rey, vmin=0.0, vmax=1.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'Reynolds SIC') - - #......... - sic_cmip_masked = sic_cmip - sic_cmip_masked[mask2==0.0] = numpy.nan - plt.subplot(236) - plt.pcolormesh(lon_cmip, lat_cmip, sic_cmip_masked, vmin=0.0, vmax=1.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'masked cmip sic') - #............................................................................................ - - plt.show() - #.................................................................................................... - - return mask1, mask2 -#---------------------------------------------------------------- -if __name__ == '__main__': - ''' - ??? asdasd sd d sd ??? - - ''' - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/get_mean_sst_sic.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/get_mean_sst_sic.py deleted file mode 100644 index 1dba52c3..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/get_mean_sst_sic.py +++ /dev/null @@ -1,112 +0,0 @@ - -''' -subset fields [in fName] for different regions and return a mean value to be used for monthly mean computation. -''' - -import os -import sys - -import numpy as numpy -import pylab as pylab -import matplotlib.pyplot as plt - -from mpl_toolkits.basemap import Basemap - -sys.path.append('/home/sakella/python_docs/myStuff/') -from read_netCDF import read_netCDF as get_field_netCDF_file -#---------------------------------------------------------------- -def get_mean_sst_sic(fName, date_proc, lat_north, lat_south, sst_mask, sic_mask, iDebug, verbose=False): - - #.................................................................................................... - lon = numpy.float64( get_field_netCDF_file(fName, 'longitude')) - lat = numpy.float64( get_field_netCDF_file(fName, 'latitude')) - - #sst = numpy.float64( get_field_netCDF_file(fName, 'daily_CMIP_SST')) - sst = numpy.float64( get_field_netCDF_file(fName, 'CMIP_SST_adjusted_Reynolds')) - - #sic = numpy.float64( get_field_netCDF_file(fName, 'daily_CMIP_SIC')) - sic = numpy.float64( get_field_netCDF_file(fName, 'CMIP_SIC_adjusted_Reynolds')) - #.................................................................................................... - # Apply land-sea masks for SST & SIC - sst[sst_mask==0.0] = numpy.nan - sic[sic_mask==0.0] = numpy.nan - #.................................................................................................... - i_north = int( pylab.interp(lat_north, lat, pylab.linspace(0, len(lat)-1, len(lat)))) - i_south = int( pylab.interp(lat_south, lat, pylab.linspace(0, len(lat)-1, len(lat)))) - - sst1_north = sst[i_north+1: len(lat), :] - sst1_south = sst[0 : i_south+1, :] - sst1_trop = sst[i_south+2: i_north, :] - - sic1_north = sic[i_north+1: len(lat), :] - sic1_south = sic[0 : i_south+1, :] - sic1_trop = sic[i_south+2: i_north, :] - - sst2_north = sst1_north[ ~numpy.isnan(sst1_north)] - sst2_south = sst1_south[ ~numpy.isnan(sst1_south)] - sst2_trop = sst1_trop [ ~numpy.isnan(sst1_trop )] - - sic2_north = sic1_north[ (~numpy.isnan(sic1_north)) & (sic1_north > 1.0E-08)] - sic2_south = sic1_south[ (~numpy.isnan(sic1_south)) & (sic1_south > 1.0E-08)] - sic2_trop = sic1_trop [ (~numpy.isnan(sic1_trop )) & (sic1_trop > 1.0E-08)] - - sst_north_mean = numpy.mean( sst2_north, dtype=numpy.float64) - sst_south_mean = numpy.mean( sst2_south, dtype=numpy.float64) - sst_trop_mean = numpy.mean( sst2_trop , dtype=numpy.float64) - - if( len(sic2_north) > 0): - sic_north_mean = numpy.mean( sic2_north, dtype=numpy.float64) - else: - sic_north_mean = 0.0 - # - if( len(sic2_south) > 0): - sic_south_mean = numpy.mean( sic2_south, dtype=numpy.float64) - else: - sic_south_mean = 0.0 - # - if( len(sic2_trop) > 0): - sic_trop_mean = numpy.mean( sic2_trop , dtype=numpy.float64) - else: - sic_trop_mean = 0.0 - #.................................................................................................... - if( iDebug): - plt.subplot(211) - plt.pcolormesh(lon, lat, sst, vmin=280.0, vmax=305.0), plt.colorbar(), plt.axis('off') - plt.title(r'CMIP SST on [%s]'%(date_proc.strftime('%Y%m%d'))) - - plt.subplot(223) - nps = Basemap(projection='npstere',boundinglat=lat_north,lon_0=360.,resolution='l') - nps.drawcoastlines() - nps.fillcontinents(color='0.9') - nps.drawmeridians(numpy.arange(-180, 180, 30), color='0.5') - nps.drawparallels(numpy.arange(-90, 90, 30), color='0.5') - xn, yn = nps( *numpy.meshgrid(lon, lat)) - plt.hold(True) - nps.pcolormesh(xn, yn, sic, vmin=0.0, vmax=1.0,shading='flat') - plt.colorbar() - #------------------------------------------------------------------------------------------------ - plt.subplot(224) - sps = Basemap(projection='spstere',boundinglat=lat_south,lon_0=90,resolution='l') # lat_south = -40 - sps.drawcoastlines() - sps.fillcontinents(color='0.9') - sps.drawmeridians(numpy.arange(-180, 180, 30), color='0.5') - sps.drawparallels(numpy.arange(-90, 90, 30), color='0.5') - xs, ys = sps( *numpy.meshgrid(lon, lat)) - sps.pcolormesh(xs, ys, sic, vmin=0.0, vmax=1.0,shading='flat') - plt.colorbar() - #------------------------------------------------------------------------------------------------ - plt.show() - - fName_print_fig = 'cmip_' + date_proc.strftime('%Y%m%d') + '.png' - plt.savefig(fName_print_fig,pad_inches=0.5,bbox_inches='tight',dpi=80, format='png')# orientation='landscape') - #.................................................................................................... - - return sst_north_mean, sst_trop_mean, sst_south_mean, sic_north_mean, sic_trop_mean, sic_south_mean -#---------------------------------------------------------------- -if __name__ == '__main__': - ''' - ??? asdasd sd d sd ??? - - ''' - - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/get_mean_sst_sic_CLIM.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/get_mean_sst_sic_CLIM.py deleted file mode 100644 index 47de906e..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/get_mean_sst_sic_CLIM.py +++ /dev/null @@ -1,119 +0,0 @@ - -''' - to make a mean of sst, sic usingdata in files: fNames. -''' -import os -import sys - -import numpy as numpy -import pylab as pylab -import matplotlib.pyplot as plt - -#from netCDF4 import Dataset -from mpl_toolkits.basemap import Basemap - -sys.path.append('/home/sakella/python_docs/myStuff/') -from read_netCDF import read_netCDF as get_field_netCDF_file -#---------------------------------------------------------------- -def get_mean_sst_sic_CLIM(fNames, num_years, iDebug, verbose=False): - - if( num_years - fNames.__len__() != 0): - print 'ERROR! Num of years does not match number of input files' - print 'WRONG CLIMATOLOGY!!' - - #.................................................................................................... - if( iDebug): - print 'Working on...[%s]'%(fNames[0]) - # Initialize - lon = numpy.float64( get_field_netCDF_file(fNames[0], 'longitude')) - lat = numpy.float64( get_field_netCDF_file(fNames[0], 'latitude')) - - sum_sic = numpy.float64( get_field_netCDF_file(fNames[0], 'daily_CMIP_SIC')) - sum_sst = numpy.float64( get_field_netCDF_file(fNames[0], 'daily_CMIP_SST')) - #.................................................................................................... - # Accumulate sum for computing mean - for iYears in range(1, num_years): - if( iDebug): - print 'Working on...[%s]'%(fNames[iYears]) - - sum_sic = sum_sic + numpy.float64( get_field_netCDF_file(fNames[iYears], 'daily_CMIP_SIC')) - sum_sst = sum_sst + numpy.float64( get_field_netCDF_file(fNames[iYears], 'daily_CMIP_SST')) - #.................................................................................................... - mean_sst = sum_sst/num_years - mean_sic = sum_sic/num_years - - mean_sic[numpy.isnan(mean_sst)] = mean_sst[numpy.isnan(mean_sst)] - #.................................................................................................... - xx = fNames[0] - if( iDebug): - plt.subplot(211), plt.imshow(mean_sst, origin='lower', vmin=275.0, vmax=305.0), plt.colorbar(), plt.axis('off') - plt.title(r'Mean SST [%s/%s]'%(xx[len(xx)-7:len(xx)-5], xx[len(xx)-5:len(xx)-3])) - - # now plot SIC in polar stereo. - plt.subplot(223) - nps = Basemap(projection='npstere',boundinglat=45.0,lon_0=360.,resolution='l') - nps.drawcoastlines() - nps.fillcontinents(color='0.9') - nps.drawmeridians(numpy.arange(-180, 180, 30), color='0.5') - nps.drawparallels(numpy.arange(-90, 90, 30), color='0.5') - xn, yn = nps( *numpy.meshgrid(lon, lat)) - plt.hold(True) - nps.pcolormesh(xn, yn, mean_sic, vmin=0.0, vmax=1.0,shading='flat') - plt.colorbar() - plt.title(r'Mean NH-SIC') - #................. - plt.subplot(224) - sps = Basemap(projection='spstere',boundinglat=-40.0,lon_0=90,resolution='l') - sps.drawcoastlines() - sps.fillcontinents(color='0.9') - sps.drawmeridians(numpy.arange(-180, 180, 30), color='0.5') - sps.drawparallels(numpy.arange(-90, 90, 30), color='0.5') - xs, ys = sps( *numpy.meshgrid(lon, lat)) - sps.pcolormesh(xs, ys, mean_sic, vmin=0.0, vmax=1.0,shading='flat') - plt.colorbar() - plt.title(r'Mean SH-SIC') - - fName_print_fig = 'daily_mean_' + xx[len(xx)-7:len(xx)-3] + '.png' - plt.savefig(fName_print_fig,pad_inches=0.5,bbox_inches='tight',dpi=120, format='png')# orientation='landscape') - plt.close('all') - #.................................................................................................... - from netCDF4 import Dataset - # write mean sst & sic to a nc file - nc_fName = 'daily_mean_' + xx[len(xx)-7:len(xx)-3] + '.nc' - out_ncfile = Dataset( nc_fName, 'w') - - out_ncfile.createDimension('latitude', len(lat)) - out_ncfile.createDimension('longitude', len(lon)) - out_ncfile.createDimension('level', 1) - out_ncfile.createDimension('time', None) - - lats = out_ncfile.createVariable('latitude', numpy.dtype('float64').char, ('latitude', )) - lons = out_ncfile.createVariable('longitude', numpy.dtype('float64').char, ('longitude',)) - - lats.units = 'degrees_north' - lons.units = 'degrees_east' - - lats[:] = lat - lons[:] = lon - - SST = out_ncfile.createVariable('daily_mean_CMIP_SST',numpy.dtype('float64').char,('time','level','latitude','longitude')) - ICE = out_ncfile.createVariable('daily_mean_CMIP_SIC',numpy.dtype('float64').char,('time','level','latitude','longitude')) - - SST.units = 'deg_K' - ICE.units = 'none' - - SST[0,:,::] = mean_sst - ICE[0,:,::] = mean_sic - - out_ncfile.close() - #.................................................................................................... - del xx - - return mean_sst, mean_sic, lat, lon -#---------------------------------------------------------------- -if __name__ == '__main__': - ''' - ??? asdasd sd d sd ??? - - ''' - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/compute_mean_clim.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/compute_mean_clim.py deleted file mode 100644 index 1276451b..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/compute_mean_clim.py +++ /dev/null @@ -1,111 +0,0 @@ - -import os -import sys -import pylab as pylab -import numpy as numpy -import time as time -import matplotlib.pyplot as plt - -from mpl_toolkits.basemap import Basemap - -sys.path.append('/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/') -from read_bin import read_bin -#---------------------------------------------------------------- -def compute_mean_clim(iSST, fNames, num_years, iDebug, iPlot_polar_stereo, verbose=False): - - if( num_years - fNames.__len__() != 0): - print 'ERROR! Num of years does not match number of input files' - print 'WRONG CLIMATOLOGY!!' - - #.................................................................................................... - if( iDebug): - print 'Working on...[%s]'%(fNames[0]) - # Initialize - [nymd1, nhms1, nymd2, nhms2, NLON, NLAT, XX] = read_bin(fNames[0]) # X= SST/SIC - - SUM_X = XX - #.................................................................................................... - # Accumulate sum for computing mean - for iYears in range(1, num_years): - if( iDebug): - print 'Working on...[%s]'%(fNames[iYears]) - - [nymd1, nhms1, nymd2, nhms2, NLON, NLAT, X] = read_bin(fNames[iYears]) # X= SST/SIC - SUM_X = SUM_X + X - #.................................................................................................... - mean_X = SUM_X/numpy.float32(num_years) - - ff = fNames[0] - if( iDebug): - coastLineFile = '/discover/nobackup/sakella/Stuff/matlabStuff/coastLine.dat' - [x_coast, y_coast] = pylab.loadtxt(coastLineFile, unpack=True) - - dlon = 360.0/numpy.float32(NLON) - dlat = 180.0/numpy.float32(NLAT) - lon = numpy.linspace(-180.0+dlon/2, 180.0-dlon/2, NLON) - lat = numpy.linspace(-90.0 +dlat/2, 90.0-dlat/2, NLAT) - - if( iPlot_polar_stereo): - plt.subplot(121) - nps = Basemap(projection='npstere',boundinglat=45.0,lon_0=360.,resolution='l') - nps.drawcoastlines() - nps.fillcontinents(color='0.9') - nps.drawmeridians(numpy.arange(-180, 180, 30), color='0.5') - nps.drawparallels(numpy.arange(-90, 90, 30), color='0.5') - xn, yn = nps( *numpy.meshgrid(lon, lat)) - plt.hold(True) - #nps.pcolormesh(xn, yn, numpy.transpose(mean_X-XX), vmin=-1.0, vmax=1.0,shading='flat') - #plt.colorbar(), plt.title(r' NH Daily Anolmaly- [%s]'%(ff[len(ff)-8:len(ff)-4])) - if( iSST): - nps.pcolormesh(xn, yn, numpy.transpose(mean_X), vmin=280.0, vmax=305.0,shading='flat') - else: - nps.pcolormesh(xn, yn, numpy.transpose(mean_X), vmin=0.0, vmax=1.0,shading='flat') - - plt.colorbar(), plt.title(r' NH Daily CLIM- [%s]'%(ff[len(ff)-8:len(ff)-4])) - #...................................................................................... - plt.subplot(122) - sps = Basemap(projection='spstere',boundinglat=-40.0,lon_0=90,resolution='l') - sps.drawcoastlines() - sps.fillcontinents(color='0.9') - sps.drawmeridians(numpy.arange(-180, 180, 30), color='0.5') - sps.drawparallels(numpy.arange(-90, 90, 30), color='0.5') - xs, ys = sps( *numpy.meshgrid(lon, lat)) - #sps.pcolormesh(xs, ys, numpy.transpose(mean_X-XX), vmin=-1.0, vmax=1.0,shading='flat') - #plt.colorbar(), plt.title(r' SH Daily Anomaly- [%s]'%(ff[len(ff)-8:len(ff)-4])) - if( iSST): - sps.pcolormesh(xs, ys, numpy.transpose(mean_X), vmin=280.0, vmax=305.0,shading='flat') - else: - sps.pcolormesh(xs, ys, numpy.transpose(mean_X), vmin=0.0, vmax=1.0,shading='flat') - plt.colorbar(), plt.title(r' SH Daily CLIM- [%s]'%(ff[len(ff)-8:len(ff)-4])) - else: - plt.subplot(111) - #plt.pcolormesh(lon, lat, numpy.transpose(mean_X-XX), vmin=-1.0, vmax=1.0) - #plt.title(r' Daily Anomaly- [%s]'%(ff[len(ff)-8:len(ff)-4])) - if( iSST): - plt.pcolormesh(lon, lat, numpy.transpose(mean_X), vmin=280.0, vmax=305.0) - else: - plt.pcolormesh(lon, lat, numpy.transpose(mean_X), vmin=0.0, vmax=1.0) - plt.title(r' Daily CLIM- [%s]'%(ff[len(ff)-8:len(ff)-4])) - plt.colorbar(), plt.axis('off'), plt.axis('tight') - plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - #...................................................................................... - if( iSST): - #fName_print_fig = 'daily_SST_anom_' + ff[len(ff)-8:len(ff)-4] + '.png' - fName_print_fig = 'daily_SST_CLIM_' + ff[len(ff)-8:len(ff)-4] + '.png' - else: - #fName_print_fig = 'daily_SIC_anom_' + ff[len(ff)-8:len(ff)-4] + '.png' - fName_print_fig = 'daily_SIC_CLIM_' + ff[len(ff)-8:len(ff)-4] + '.png' - plt.savefig(fName_print_fig,pad_inches=0.5,bbox_inches='tight',dpi=120, format='png')# orientation='landscape') - plt.close('all') - #.................................................................................................... - return mean_X -#---------------------------------------------------------------- -if __name__ == '__main__': - ''' - ??? asdasd sd d sd ??? - - ''' - - - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/daily_mean_clim.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/daily_mean_clim.py deleted file mode 100644 index ec9d1853..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/daily_mean_clim.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/python -#----------------------------------------------------------------- -''' -make a mean of sst & sic for each day of the year (365 or 366) days. -''' -#---------------------------------------------------------------- -import os -import sys - -import pylab as pylab -import numpy as numpy -import time as time -import calendar as calendar - -import matplotlib.dates as md -import matplotlib.pyplot as plt - -from datetime import datetime, timedelta - -sys.path.append('/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/FOR_CMIP/') -from compute_mean_clim import compute_mean_clim -from write_bin import write_bin -#----------------------------------------------------------------- -iDebug = 0 -iPlot_polar_stereo = 0 - -#start_year = 1977 -start_year = 1982 -end_year = 1982 -#----------------------------------------------------------------- -cmip_data_path = '/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/FOR_CMIP/RAW_YRLY/' # processed files -cmip_file_sst = 'cmip_raw_sst_' -cmip_file_sic = 'cmip_raw_sic_' -cmip_file_suff = '.bin' -#----------------------------------------------------------------- -iDay = 1 -#----------------------------------------------------------------- -for iMon in range(1, 13): - start_date = datetime(start_year,iMon,01,00,0,0) - output_day = start_date.day - nDays_inThisMonth = calendar.monthrange(start_year, iMon)[1] - - while(output_day <= nDays_inThisMonth): - output_year = start_date.year - output_mon = start_date.month - - #INITIALIZE here. - nYears = 1 - fNames_sst = [ ] - fNames_sic = [ ] - while(output_year <= end_year): # Loop over same calendar day. From Start : End Year. - proc_year = output_year - proc_mon = output_mon - proc_day = output_day - proc_date = datetime(proc_year, proc_mon, proc_day) - clim_today = datetime(2052, proc_mon, proc_day) # to write a climatology file - #----------------------------------------------------------------- - # form file names - fName_sst = cmip_data_path + proc_date.strftime('%Y')+'/' + cmip_file_sst + proc_date.strftime('%Y%m%d') + cmip_file_suff - fName_sic = cmip_data_path + proc_date.strftime('%Y')+'/' + cmip_file_sic + proc_date.strftime('%Y%m%d') + cmip_file_suff - #xstat_dmget = os.system('dmget ' + fName_sst + ' ' + fName_sic) - #----------------------------------------------------------------- - fNames_sst.append(fName_sst) - fNames_sic.append(fName_sic) - print '[nYrs=%i, iDays=%i], Gathering...[%s]'%(nYears, iDay, fName_sst) - nYears = nYears + 1 - output_year = output_year + 1 - #----------------------------------------------------------------- - output_day = output_day + 1 - iDay = iDay + 1 - #print '[%s]'%(fNames_sst) - iSST = 1 - mean_sst = compute_mean_clim(iSST, fNames_sst, nYears-1, iDebug, iPlot_polar_stereo) - iSST = 0 - mean_sic = compute_mean_clim(iSST, fNames_sic, nYears-1, iDebug, iPlot_polar_stereo) - print 'Computed Mean over [%i] years for day [%i] of 365 days year.'%(nYears-1, iDay-1) - #write SST & SIC CLIM to a binary file- that GCM can read. - clim_tomr = clim_today + timedelta(days=1) - print 'CLIM...[%s] to [%s]'%(clim_today, clim_tomr) - write_bin(clim_today.strftime('%Y%m%d'), \ - numpy.float(clim_today.strftime('%Y')), numpy.float(clim_today.strftime('%m')), numpy.float(clim_today.strftime('%d')), \ - numpy.float(clim_tomr.strftime('%Y')), numpy.float(clim_tomr.strftime('%m')), numpy.float(clim_tomr.strftime('%d')), \ - mean_sst, mean_sic) - print '========================to next Day============================================' - print '========================to next Month==========================================' -# -#================================================================ -# NOW FEB 29TH. -#================================================================ - -start_year = 1980 -end_year = 1980 -start_date = datetime(start_year, 2, 29, 00, 0, 0) - -#INITIALIZE sum here. -nYears = 1 -fNames_sst = [ ] -fNames_sic = [ ] -#....................................... -output_year = start_date.year -output_mon = start_date.month -output_day = start_date.day -while(output_year <= end_year): - proc_date = datetime(output_year, output_mon, output_day) - clim_today = datetime(2052, output_mon, output_day) # to write a climatology file - #----------------------------------------------------------------- - # form file names - fName_sst = cmip_data_path + proc_date.strftime('%Y')+'/' + cmip_file_sst + proc_date.strftime('%Y%m%d') + cmip_file_suff - fName_sic = cmip_data_path + proc_date.strftime('%Y')+'/' + cmip_file_sic + proc_date.strftime('%Y%m%d') + cmip_file_suff - #xstat_dmget = os.system('dmget ' + fName_sst + ' ' + fName_sic) - #----------------------------------------------------------------- - fNames_sst.append(fName_sst) - fNames_sic.append(fName_sic) - print '[nYrs=%i], Gathering...[%s]'%(nYears, fName_sic) - nYears = nYears + 1 - output_year = output_year + 4 - #----------------------------------------------------------------- -iSST = 1 -mean_sst = compute_mean_clim(iSST, fNames_sst, nYears-1, iDebug, iPlot_polar_stereo) -iSST = 0 -mean_sic = compute_mean_clim(iSST, fNames_sic, nYears-1, iDebug, iPlot_polar_stereo) -print 'Computed Mean over [%i] years for Feb 29th'%(nYears-1) -#write SST & SIC CLIM to a binary file- that GCM can read. -clim_tomr = clim_today + timedelta(days=1) -print 'CLIM...[%s] to [%s]'%(clim_today, clim_tomr) -write_bin(clim_today.strftime('%Y%m%d'), \ - numpy.float(clim_today.strftime('%Y')), numpy.float(clim_today.strftime('%m')), numpy.float(clim_today.strftime('%d')), \ - numpy.float(clim_tomr.strftime('%Y')), numpy.float(clim_tomr.strftime('%m')), numpy.float(clim_tomr.strftime('%d')), \ - mean_sst, mean_sic) -#----------------------------------------------------------------- -# - - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/get_cmip_sst_sic.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/get_cmip_sst_sic.py deleted file mode 100644 index 95805e08..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/get_cmip_sst_sic.py +++ /dev/null @@ -1,92 +0,0 @@ - -''' -read in sst & sic from raw cmip files. fields are mid-month fields. -''' -import os -import sys - -import numpy as numpy -import pylab as pylab -import matplotlib.pyplot as plt -import matplotlib.dates as dates - -from datetime import datetime -from mpl_toolkits.basemap import Basemap - -sys.path.append('/home/sakella/python_docs/myStuff/') -from read_netCDF import read_netCDF as get_field_netCDF_file -#---------------------------------------------------------------- -def get_cmip_sst_sic(fName_sst, fName_sic, iDebug, verbose=False): - - lon1 = get_field_netCDF_file(fName_sst, "longitude") - lat = get_field_netCDF_file(fName_sst, "latitude") - time1 = get_field_netCDF_file(fName_sst, "time") - - sst1 = get_field_netCDF_file(fName_sst, "tosbcs") - sic1 = get_field_netCDF_file(fName_sic, "sicbcs")/100.0 # to get [0,1] concentration. - - #sst_fill = 1.0e+20 - #ice_fill = 1.0e+20 - - #if( iDebug): - # print 'Min/Max of input SST...[%f], [%f]'%(sst.flatten().min(), sst.flatten().max()) - # print 'Min/Max of input ICE...[%f], [%f]'%(sic.flatten().min(), sic.flatten().max()) - #---------------------------------------------------------------- - # data set start date: - date0 = datetime(1979,01,01,00,0,0) - timeX = time1 + dates.date2num(date0) # adjust time stamps - - sst1[sic1 > 1.0] = 273.15 - sst1[sic1 < 0.0] = 273.15 # not sure if this is okay! Jul 25, 2013. - - sic1[sic1 > 1.0] = 1.0 - sic1[sic1 < 0.0] = 0.0 - #---------------------------------------------------------------- - # lon is from [0.5, 359.5]. flip it to [-179.5 to 179.5]. - lon = lon1 - 180.0 - - sst = numpy.zeros([numpy.shape(sst1)[0], numpy.shape(sst1)[1], numpy.shape(sst1)[2]], dtype=numpy.float64, order = 'F') - sic = numpy.zeros([numpy.shape(sic1)[0], numpy.shape(sic1)[1], numpy.shape(sic1)[2]], dtype=numpy.float64, order = 'F') - - for iMon in range(0, numpy.shape(sst1)[0]): - sst[iMon,:,180:360] = numpy.squeeze(sst1[iMon,:, 0:180]) - sst[iMon,:, 0:180] = numpy.squeeze(sst1[iMon,:,180:360]) - - sic[iMon,:,180:360] = numpy.squeeze(sic1[iMon,:, 0:180]) - sic[iMon,:, 0:180] = numpy.squeeze(sic1[iMon,:,180:360]) - #---------------------------------------------------------------- - print 'Working on Year...[%s]'%(dates.num2date(timeX)[0].year) - if( iDebug): - iPlot_month = 8 - #print 'Working on Year...[%s]'%(dates.num2date(timeX)[iPlot_month].year) - print 'Min/Max of input SST...[%f], [%f]'%(sst.flatten().min(), sst.flatten().max()) - print 'Min/Max of input ICE...[%f], [%f]'%(sic.flatten().min(), sic.flatten().max()) - - coastLineFile = '/discover/nobackup/sakella/Stuff/matlabStuff/coastLine.dat' - [x_coast, y_coast] = pylab.loadtxt(coastLineFile, unpack=True) - # - plt.figure() - plt.subplot(211) - plt.pcolor(lon, lat, numpy.squeeze(sst[iPlot_month,:,:]), vmin=275.0, vmax=305.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'SST [%s/%s]'%(dates.num2date(timeX)[iPlot_month].month, dates.num2date(timeX)[iPlot_month].year)) - - plt.subplot(212) - plt.pcolor(lon, lat, numpy.squeeze(sic[iPlot_month,:,:]), vmin=0.0, vmax=1.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'SIC [%s/%s]'%(dates.num2date(timeX)[iPlot_month].month, dates.num2date(timeX)[iPlot_month].year)) - # - #plt.show() - print ' ' - fName_print = 'raw_cmip_' + '%s_%s'%(dates.num2date(timeX)[iPlot_month].month, dates.num2date(timeX)[iPlot_month].year) + '.png' - plt.savefig(fName_print, dpi=100, format='png') - plt.close('all') - #---------------------------------------------------------------- - return lon, lat, timeX, sst, sic -#---------------------------------------------------------------- -if __name__ == '__main__': - ''' - ??? asdasd sd d sd ??? - - ''' - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/grads_utils/cmip_raw_sic.ctl b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/grads_utils/cmip_raw_sic.ctl deleted file mode 100644 index 082c45fb..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/grads_utils/cmip_raw_sic.ctl +++ /dev/null @@ -1,13 +0,0 @@ -DSET ^/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/FOR_CMIP/cmip_clim_sic_20520101.bin -*DSET ^/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/FOR_CMIP/cmip_raw_sic_19820101.bin -UNDEF 1.0e15 -TITLE f -OPTIONS SEQUENTIAL -THEADER 56 -XDEF 1440 LINEAR -179.875 0.25 -YDEF 720 LINEAR -89.875 0.25 -ZDEF 1 LINEAR 1 1 -TDEF 1 LINEAR 1Jan2099 1dy -VARS 1 -ice 0 1 ice -ENDVARS diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/grads_utils/cmip_raw_sst.ctl b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/grads_utils/cmip_raw_sst.ctl deleted file mode 100644 index 2c62ca08..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/grads_utils/cmip_raw_sst.ctl +++ /dev/null @@ -1,14 +0,0 @@ -DSET ^/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/FOR_CMIP/cmip_clim_sst_20520101.bin -*DSET ^/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/FOR_CMIP/cmip_raw_sst_19820101.bin -UNDEF 1.0e15 -TITLE f -OPTIONS SEQUENTIAL -THEADER 56 -XDEF 1440 LINEAR -179.875 0.25 -YDEF 720 LINEAR -89.875 0.25 -ZDEF 1 LINEAR 1 1 -TDEF 1 LINEAR 1Jan2099 1dy -VARS 1 -sst 0 1 sst -ENDVARS - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/grads_utils/plot_cmip_raw.gs b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/grads_utils/plot_cmip_raw.gs deleted file mode 100644 index 43010c44..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/grads_utils/plot_cmip_raw.gs +++ /dev/null @@ -1,57 +0,0 @@ -************************************************ -'reinit' -'set display color white' -'clear' -'set grads off' -* -*SST -'open cmip_raw_sst.ctl' -'subplot 2 1 1' -'set mproj latlon' -'set lon -180 180' -'set lat -90 90' -'set gxout grfill' -'set clevs 280.0 282.5 285.0 287.5 290.0 292.5 295.0 297.5 300.0 302.5 305.0' -'display sst' -*'run basemap L' -'draw title CMIP RAW (1/4 deg) SST 01/01' -'run cbar 0.6 1 9.1 6.2' -*................................................................ -'open cmip_raw_sic.ctl' -'set dfile 2' -'subplot 2 1 2' -'set mproj latlon' -'set lon -180 180' -'set lat -90 90' -'set gxout grfill' -'set clevs 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.80 0.90 1.0' -'display ice' -*'run basemap L' -'run cbar 0.6 1 9.1 2.2' -*................................................................ -*NH ICE -*'subplot 2 2 3' -*'set mproj nps' -*'set lon -180 180' -*'set lat 30 90' -*'set gxout grfill' -*'set clevs 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.80 0.90 1.0' -*'display ice' -*'run basemap L' -*SH -*'subplot 2 2 4' -*'set mproj sps' -*'set lon -180 180' -*'set lat -90 -30' -*'set gxout grfill' -*'set clevs 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.80 0.90 1.0' -*'display ice' -*'run basemap L' -*'run cbar 0.5 1 5.4 2.1' -*................................................................ -*................................................................ -* -* -*'printim cmip_raw_0101.png x1000 y800' -* - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/make_cmip_daily.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/make_cmip_daily.py deleted file mode 100644 index 5128b7bc..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/make_cmip_daily.py +++ /dev/null @@ -1,169 +0,0 @@ -#!/usr/bin/python -#----------------------------------------------------------------- -''' -purpose is to : - read mid-monthly cmip sst & sic - create time interpolated (linearly) daily data files. -''' -#----------------------------------------------------------------- -import os -import sys - -import pylab as pylab -import numpy as numpy -import time as time - -import matplotlib.dates as dates -import matplotlib.pyplot as plt -from datetime import datetime, timedelta -from scipy import interpolate - -sys.path.append('/home/sakella/python_docs/myStuff/') -from read_netCDF import read_netCDF as get_field_netCDF_file - -sys.path.append('/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/FOR_CMIP/') -from get_cmip_sst_sic import get_cmip_sst_sic as get_cmip_sst_sic -from write_bin import write_bin - -coastLineFile = '/discover/nobackup/sakella/Stuff/matlabStuff/coastLine.dat' -[x_coast, y_coast] = pylab.loadtxt(coastLineFile, unpack=True) -#----------------------------------------------------------------- -start_day = datetime(1977,01,01,00,0,0) -end_day = datetime(1977,12,31,00,0,0) - -iDebug = 0 -iPlot = 8 # produce a plot of raw 1x1 deg. CMIP data for a certain month. -iPlot_polar_stereo = 0 # plot SIC in [1]: stereo polar. [0]: latlon projection -#----------------------------------------------------------------- -cmip_data_path = '/discover/nobackup/sakella/processData/MERRA2_27June2013/before_1982/CMIP/data/360x180/' -cmip_sst_pre = 'amipbc_sst_360x180_' -cmip_sic_pre = 'amipbc_sic_360x180_' -cmip_file_suff = '.nc' -# -#MERRA-2 GRID: 1/4 deg -nlon_merra = 1440 -nlat_merra = 720 -#----------------------------------------------------------------- -# Form files that need to be pulled in -#SST -sst_fName_before_yr = cmip_data_path + cmip_sst_pre + (start_day.year-1).__str__() + cmip_file_suff -sst_fName_proc_yr = cmip_data_path + cmip_sst_pre + start_day.year.__str__() + cmip_file_suff -sst_fName_next_yr = cmip_data_path + cmip_sst_pre + (start_day.year+1).__str__() + cmip_file_suff -#SIC -sic_fName_before_yr = cmip_data_path + cmip_sic_pre + (start_day.year-1).__str__() + cmip_file_suff -sic_fName_proc_yr = cmip_data_path + cmip_sic_pre + start_day.year.__str__() + cmip_file_suff -sic_fName_next_yr = cmip_data_path + cmip_sic_pre + (start_day.year+1).__str__() + cmip_file_suff -#============================================================================================================================ -# GET THE DATA FROM ALL 3 YEARS. -print 'You want to create daily files for [%s]. Gathering RAW CMIP DATA...'%(start_day.year) -[lon, lat, time_before_yr, sst_before_yr, sic_before_yr] = get_cmip_sst_sic(sst_fName_before_yr, sic_fName_before_yr, iDebug) -[lon, lat, time_proc_yr, sst_proc_yr, sic_proc_yr] = get_cmip_sst_sic(sst_fName_proc_yr, sic_fName_proc_yr, iDebug) -[lon, lat, time_next_yr, sst_next_yr, sic_next_yr] = get_cmip_sst_sic(sst_fName_next_yr, sic_fName_next_yr, iDebug) - -# rearrange for easier processing. -# start with time stamps -time_all = numpy.zeros([len(time_proc_yr)+2], dtype=numpy.float64, order = 'F') -time_all[0] = time_before_yr[11] -time_all[1:len(time_proc_yr)+1] = time_proc_yr -time_all[len(time_proc_yr)+1] = time_next_yr[0] -# SST -sst_all = numpy.zeros([numpy.shape(sst_proc_yr)[0]+2, numpy.shape(sst_proc_yr)[1], numpy.shape(sst_proc_yr)[2]], dtype=numpy.float64, order = 'F') -sst_all[0,::] = numpy.squeeze(sst_before_yr[11,::]) -sst_all[1:len(time_proc_yr)+1,::] = sst_proc_yr -sst_all[len(time_proc_yr)+1,::] = numpy.squeeze(sst_next_yr[11,::]) -# SIC -sic_all = numpy.zeros([numpy.shape(sic_proc_yr)[0]+2, numpy.shape(sic_proc_yr)[1], numpy.shape(sic_proc_yr)[2]], dtype=numpy.float64, order = 'F') -sic_all[0,::] = numpy.squeeze(sic_before_yr[11,::]) -sic_all[1:len(time_proc_yr)+1,::] = sic_proc_yr -sic_all[len(time_proc_yr)+1,::] = numpy.squeeze(sic_next_yr[11,::]) - -print ' ' -#----------------------------------------------------------------- -if( iDebug): - print 'time_all: [%s]'%(dates.num2date(time_all)) - - plt.figure() - plt.subplot(211) - plt.pcolor(lon, lat, numpy.squeeze(sst_all[iPlot,:,:]), vmin=275.0, vmax=305.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'SST [%s/%s]'%(dates.num2date(time_all)[iPlot].month, dates.num2date(time_all)[iPlot].year)) - - plt.subplot(212) - plt.pcolor(lon, lat, numpy.squeeze(sic_all[iPlot,:,:]), vmin=0.0, vmax=1.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'SIC [%s/%s]'%(dates.num2date(time_all)[iPlot].month, dates.num2date(time_all)[iPlot].year)) - # - plt.show() - #fName_print = 'raw_cmip_' + '%s_%s'%(dates.num2date(timeX)[iPlot_month].month, dates.num2date(timeX)[iPlot_month].year) + '.png' - #plt.savefig(fName_print, dpi=100, format='png') - #plt.close('all') - -del time_before_yr,time_proc_yr,time_next_yr, sst_before_yr,sst_proc_yr,sst_next_yr, sic_before_yr,sic_proc_yr,sic_next_yr -#============================================================================================================================ -# NOW INTERPOLATE TO 1/4x/1/4 deg grid for MERRA -print 'Interpolating RAW CMIP DATA to MERRA GRID...' - -dlon_merra = 360.0/nlon_merra -dlat_merra = 180.0/nlat_merra - -lon_merra = numpy.linspace(-180.0+dlon_merra/2, 180.0-dlon_merra/2, nlon_merra) -lat_merra = numpy.linspace( -90.0+dlat_merra/2, 90.0-dlat_merra/2, nlat_merra) - -#CMIP Grid -xx_in, yy_in = numpy.meshgrid(lon, lat) -#MERRA Grid -xx_out, yy_out = numpy.meshgrid(lon_merra, lat_merra) - -sst_all_merra_res = numpy.zeros([numpy.shape(sst_all)[0], nlat_merra, nlon_merra], dtype=numpy.float64, order = 'F') -sic_all_merra_res = numpy.zeros([numpy.shape(sic_all)[0], nlat_merra, nlon_merra], dtype=numpy.float64, order = 'F') -#----------------------------------------------------------------- -for iMon in range(0, numpy.shape(sst_all)[0]): - - X1 = numpy.squeeze(sst_all[iMon,::]) - Y1 = numpy.squeeze(sic_all[iMon,::]) - - X2 = interpolate.griddata( (xx_in.ravel(), yy_in.ravel()), X1.ravel(), (xx_out, yy_out), method='nearest')#, fill_value = sst_fill) - Y2 = interpolate.griddata( (xx_in.ravel(), yy_in.ravel()), Y1.ravel(), (xx_out, yy_out), method='nearest')#, fill_value = sst_fill) - - sst_all_merra_res[iMon,::] = X2 - sic_all_merra_res[iMon,::] = Y2 - - del X1, Y1, X2, Y2 -#============================================================================================================================ -iDebug = 0 # set/unset to debug- so that we get plots. -print ' ' -print 'Interpolating MID-MONTH DATA to DAILY DATA on MERRA GRID...' - -proc_day = start_day -while( proc_day <= end_day): - - tI = pylab.interp( dates.date2num(proc_day), time_all, numpy.linspace(0, len(time_all)-1, len(time_all))) - tL = int(numpy.floor(tI)) - tH = int(numpy.ceil (tI)) - - print 'Processing for [%s]; CMIP data is on [%s] AND [%s]'%(proc_day, dates.num2date(time_all[tL]), dates.num2date(time_all[tH])) - - dX = numpy.squeeze(sst_all_merra_res[tH,::]) - numpy.squeeze(sst_all_merra_res[tL,::]) # this calculation can be done once a month. I am being dumb here! - dY = numpy.squeeze(sic_all_merra_res[tH,::]) - numpy.squeeze(sic_all_merra_res[tL,::]) - dT = time_all[tH] - time_all[tL] - - if( dT > 0.0): - X = numpy.squeeze(sst_all_merra_res[tL,::]) + (dates.date2num(proc_day) - time_all[tL]) * dX/dT - Y = numpy.squeeze(sic_all_merra_res[tL,::]) + (dates.date2num(proc_day) - time_all[tL]) * dY/dT - else: # mid-month day - X = numpy.squeeze(sst_all_merra_res[tL,::]) - Y = numpy.squeeze(sic_all_merra_res[tL,::]) - - # dump interpolated SST(X) & SIC(Y) to a bin file- that GCM can read. - proc_tomr = proc_day + timedelta(days=1) - write_bin(proc_day.strftime('%Y%m%d'), \ - numpy.float(proc_day.strftime('%Y')), numpy.float(proc_day.strftime('%m')), numpy.float(proc_day.strftime('%d')), \ - numpy.float(proc_tomr.strftime('%Y')),numpy.float(proc_tomr.strftime('%m')),numpy.float(proc_tomr.strftime('%d')), \ - numpy.transpose(X), numpy.transpose(Y)) - - del tI, tL, tH, dX, dY, dT, X, Y - proc_day = proc_day + timedelta(days=1) -#============================================================================================================================ -print '...Finished!' -# - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/sst_sic_monthly_mean.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/sst_sic_monthly_mean.py deleted file mode 100644 index 147bc9ba..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_CLIM/sst_sic_monthly_mean.py +++ /dev/null @@ -1,190 +0,0 @@ -#!/usr/bin/python -#----------------------------------------------------------------- -''' -make a plot of monthly, regional mean sst & sic. for 1/4 deg daily CMIP. -''' -#----------------------------------------------------------------- -import os -import sys - -import pylab as pylab -import numpy as numpy -import time as time - -import matplotlib.dates as md -import matplotlib.pyplot as plt - -from datetime import datetime, timedelta -from calendar import monthrange - -sys.path.append('/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/') -from get_monthly_mean_sst_sic import get_monthly_mean_sst_sic -#----------------------------------------------------------------- -iDebug = 0 - -lat_north = 30.0 #45.0 -lat_south =-30.0 #-45.0 -#----------------------------------------------------------------- -reynolds_raw_path = '/gpfsm/dnb42/projects/p17/production/GEOS5odas-5.00/RC/OBS/REYN/' -cmip_data_path = '/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/FOR_CMIP/RAW_YRLY/' # processed files -cmip_clim_path = '/discover/nobackup/sakella/processData/MERRA2_27June2013/UTILS/FOR_CMIP/CLIM_1982/' -# -reynolds_raw_file_pre = 'avhrr-only-v2.' # Use AVHRR ONLY: for 1982 -cmip_sst_file_pre = 'cmip_raw_sst_' # Processed files -cmip_sic_file_pre = 'cmip_raw_sic_' -# -cmip_clim_pre = 'cmip_clim_' # Daily Climatology file Prefix -# -reynolds_file_suff = '.nc' -#----------------------------------------------------------------- -start_date = datetime(1980,01,01,00,0,0) -end_date = datetime(1980,12,31,00,0,0) -nMonths = (end_date.month-start_date.month) + 1 -# -nh_cmip_sst_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -tr_cmip_sst_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -sh_cmip_sst_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -# -nh_clim_sst_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -tr_clim_sst_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -sh_clim_sst_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -# -nh_cmip_sic_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -tr_cmip_sic_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -sh_cmip_sic_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -# -nh_clim_sic_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -tr_clim_sic_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -sh_clim_sic_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -#----------------------------------------------------------------- -date_proc = start_date - -for iMonth in range(1, nMonths+1): - - # SST - sum_cmip_NH_sst = 0.0 - sum_cmip_TR_sst = 0.0 - sum_cmip_SH_sst = 0.0 - - sum_Clim_NH_sst = 0.0 - sum_Clim_TR_sst = 0.0 - sum_Clim_SH_sst = 0.0 - # SIC - sum_cmip_NH_sic = 0.0 - sum_cmip_TR_sic = 0.0 - sum_cmip_SH_sic = 0.0 - - sum_Clim_NH_sic = 0.0 - sum_Clim_TR_sic = 0.0 - sum_Clim_SH_sic = 0.0 - #-------------------------------------------------------------------------------------------------------------------- - for iDay in range(1, monthrange(start_date.year, iMonth)[1]+1): - print 'Processing for...[%s], Month Num = [%i]'%(date_proc.strftime('%Y%m%d'), iMonth) - - #.................................................................................................................... - # form Reynolds RAW data file name - # 1982 below works fine. - #fName_Reynolds_raw = reynolds_raw_path + date_proc.strftime('%Y')+'/' + reynolds_raw_file_pre + date_proc.strftime('%Y%m%d') + reynolds_file_suff # avhrr-only - # 1977, '78, '79, '81- because there is no Reynolds file. use 1982 files. - #fName_Reynolds_raw = reynolds_raw_path + '1982/' + reynolds_raw_file_pre + '1982'+ date_proc.strftime('%m%d') + reynolds_file_suff # avhrr-only - #when doing 1980 use this line [closest leap yr from reynolds- 1984]. - fName_Reynolds_raw = reynolds_raw_path + '1984/' + reynolds_raw_file_pre + '1984'+ date_proc.strftime('%m%d') + reynolds_file_suff # avhrr-only - print'Raw File...[%s]'%(fName_Reynolds_raw) - #.................................................................................................................... - # form daily processed file names - fName_sst_proc = cmip_data_path + date_proc.strftime('%Y')+'/' + cmip_sst_file_pre + date_proc.strftime('%Y%m%d') + '.bin' - fName_sic_proc = cmip_data_path + date_proc.strftime('%Y')+'/' + cmip_sic_file_pre + date_proc.strftime('%Y%m%d') + '.bin' - print'Processed Files...[%s, %s]'%(fName_sst_proc, fName_sic_proc) - #.................................................................................................................... - # form daily climatology file names - fName_sst_clim = cmip_clim_path + cmip_clim_pre + 'sst_2052' + date_proc.strftime('%m%d') + '.bin' - fName_sic_clim = cmip_clim_path + cmip_clim_pre + 'sic_2052' + date_proc.strftime('%m%d') + '.bin' - print'Clim Files...[%s, %s]'%(fName_sst_clim, fName_sic_clim) - #.................................................................................................................... - - [Cmip_NH_sst, Cmip_TR_sst, Cmip_SH_sst, Cmip_NH_sic, Cmip_TR_sic, Cmip_SH_sic, \ - Clim_NH_sst, Clim_TR_sst, Clim_SH_sst, Clim_NH_sic, Clim_TR_sic, Clim_SH_sic] = \ - get_monthly_mean_sst_sic(fName_Reynolds_raw, fName_sst_proc, fName_sic_proc, fName_sst_clim, fName_sic_clim, date_proc, lat_north, lat_south, iDebug) - #-------------------------------------------------------------------------------------------------------------------- - sum_cmip_NH_sst = sum_cmip_NH_sst + Cmip_NH_sst - sum_cmip_TR_sst = sum_cmip_TR_sst + Cmip_TR_sst - sum_cmip_SH_sst = sum_cmip_SH_sst + Cmip_SH_sst - - sum_cmip_NH_sic = sum_cmip_NH_sic + Cmip_NH_sic - sum_cmip_TR_sic = sum_cmip_TR_sic + Cmip_TR_sic - sum_cmip_SH_sic = sum_cmip_SH_sic + Cmip_SH_sic - # - sum_Clim_NH_sst = sum_Clim_NH_sst + Clim_NH_sst - sum_Clim_TR_sst = sum_Clim_TR_sst + Clim_TR_sst - sum_Clim_SH_sst = sum_Clim_SH_sst + Clim_SH_sst - - sum_Clim_NH_sic = sum_Clim_NH_sic + Clim_NH_sic - sum_Clim_TR_sic = sum_Clim_TR_sic + Clim_TR_sic - sum_Clim_SH_sic = sum_Clim_SH_sic + Clim_SH_sic - # - date_proc = date_proc + timedelta(days=1) - #-------------------------------------------------------------------------------------------------------------------- - nh_cmip_sst_mean[iMonth-1] = sum_cmip_NH_sst/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - tr_cmip_sst_mean[iMonth-1] = sum_cmip_TR_sst/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - sh_cmip_sst_mean[iMonth-1] = sum_cmip_SH_sst/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - - nh_cmip_sic_mean[iMonth-1] = sum_cmip_NH_sic/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - tr_cmip_sic_mean[iMonth-1] = sum_cmip_TR_sic/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - sh_cmip_sic_mean[iMonth-1] = sum_cmip_SH_sic/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - # - nh_clim_sst_mean[iMonth-1] = sum_Clim_NH_sst/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - tr_clim_sst_mean[iMonth-1] = sum_Clim_TR_sst/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - sh_clim_sst_mean[iMonth-1] = sum_Clim_SH_sst/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - - nh_clim_sic_mean[iMonth-1] = sum_Clim_NH_sic/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - tr_clim_sic_mean[iMonth-1] = sum_Clim_TR_sic/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - sh_clim_sic_mean[iMonth-1] = sum_Clim_SH_sic/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - #-------------------------------------------------------------------------------------------------------------------- -#----------------------------------------------------------------- -for iMonth in range(0, nMonths): - print 'Mon Num...[%i], CMIP...SST means[NH, TR, SH]= %5.2f, %5.2f, %5.2f'%(iMonth+1, nh_cmip_sst_mean[iMonth], tr_cmip_sst_mean[iMonth], sh_cmip_sst_mean[iMonth]) - print 'Mon Num...[%i], CMIP...SIC means[NH, TR, SH]= %5.2f, %5.2f, %5.2f'%(iMonth+1, nh_cmip_sic_mean[iMonth], tr_cmip_sic_mean[iMonth], sh_cmip_sic_mean[iMonth]) -#----------------------------------------------------------------- -nh_file_sst_cmip = str(start_date.year) + '_nh_sst_cmip.txt' -pylab.savetxt(nh_file_sst_cmip, nh_cmip_sst_mean) - -tr_file_sst_cmip = str(start_date.year) + '_tr_sst_cmip.txt' -pylab.savetxt(tr_file_sst_cmip, tr_cmip_sst_mean) - -sh_file_sst_cmip = str(start_date.year) + '_sh_sst_cmip.txt' -pylab.savetxt(sh_file_sst_cmip, sh_cmip_sst_mean) -# -nh_file_sic_cmip = str(start_date.year) + '_nh_sic_cmip.txt' -pylab.savetxt(nh_file_sic_cmip, nh_cmip_sic_mean) - -tr_file_sic_cmip = str(start_date.year) + '_tr_sic_cmip.txt' -pylab.savetxt(tr_file_sic_cmip, tr_cmip_sic_mean) - -sh_file_sic_cmip = str(start_date.year) + '_sh_sic_cmip.txt' -pylab.savetxt(sh_file_sic_cmip, sh_cmip_sic_mean) -#............................................... -pylab.savetxt('nh_CMIP_clim_sst_mean.txt', nh_clim_sst_mean) -pylab.savetxt('tr_CMIP_clim_sst_mean.txt', tr_clim_sst_mean) -pylab.savetxt('sh_CMIP_clim_sst_mean.txt', sh_clim_sst_mean) - -pylab.savetxt('nh_CMIP_clim_sic_mean.txt', nh_clim_sic_mean) -pylab.savetxt('tr_CMIP_clim_sic_mean.txt', tr_clim_sic_mean) -pylab.savetxt('sh_CMIP_clim_sic_mean.txt', sh_clim_sic_mean) -#----------------------------------------------------------------- -plt.subplot(321), -plt.plot(nh_cmip_sst_mean, 'b.-', label=r'daily'), plt.hold('true'), plt.plot(nh_clim_sst_mean, 'kx-', label=r'clim'), plt.legend(loc=1), plt.ylabel(r'nh'), plt.title(r'SST') -plt.subplot(322), -plt.plot(nh_cmip_sic_mean, 'b.-', label=r'daily'), plt.hold('true'), plt.plot(nh_clim_sic_mean, 'kx-', label=r'clim'), plt.title(r'SIC') - -plt.subplot(323), -plt.plot(tr_cmip_sst_mean, 'b.-', label=r'daily'), plt.hold('true'), plt.plot(tr_clim_sst_mean, 'kx-', label=r'clim'), plt.ylabel(r'tr') -plt.subplot(324), -plt.plot(tr_cmip_sic_mean, 'b.-', label=r'daily'), plt.hold('true'), plt.plot(tr_clim_sic_mean, 'kx-', label=r'clim') - -plt.subplot(325), -plt.plot(sh_cmip_sst_mean, 'b.-', label=r'daily'), plt.hold('true'), plt.plot(sh_clim_sst_mean, 'kx-', label=r'clim'), plt.ylabel(r'sh') -plt.subplot(326), -plt.plot(sh_cmip_sic_mean, 'b.-', label=r'daily'), plt.hold('true'), plt.plot(sh_clim_sic_mean, 'kx-', label=r'clim') -plt.show() -#----------------------------------------------------------------- -#..... diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_cmip_daily.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_cmip_daily.py deleted file mode 100644 index 869c03f4..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_cmip_daily.py +++ /dev/null @@ -1,165 +0,0 @@ -#!/usr/bin/python -#----------------------------------------------------------------- -''' -purpose is to : - read mid-monthly cmip sst & sic - create time interpolated (linearly) daily data [as nc] files. -''' -#----------------------------------------------------------------- -import os -import sys - -import pylab as pylab -import numpy as numpy -import time as time - -import matplotlib.dates as dates -import matplotlib.pyplot as plt -from datetime import datetime, timedelta -from scipy import interpolate - -sys.path.append('/home/sakella/python_docs/myStuff/') -from read_netCDF import read_netCDF as get_field_netCDF_file - -sys.path.append('/discover/nobackup/sakella/processData/MERRA2_27June2013/before_1982/CMIP/') -from get_cmip_sst_sic import get_cmip_sst_sic as get_cmip_sst_sic -from write_cmip_daily import write_cmip_daily as write_cmip_daily - -coastLineFile = '/discover/nobackup/sakella/Stuff/matlabStuff/coastLine.dat' -[x_coast, y_coast] = pylab.loadtxt(coastLineFile, unpack=True) -#----------------------------------------------------------------- -start_day = datetime(1982,01,01,00,0,0) -end_day = datetime(1982,12,31,00,0,0) - -iDebug = 0 -iPlot = 8 # produce a plot of raw 1x1 deg. CMIP data for a certain month. -iPlot_polar_stereo = 0 # plot SIC in [1]: stereo polar. [0]: latlon projection -#----------------------------------------------------------------- -cmip_data_path = '/discover/nobackup/sakella/processData/MERRA2_27June2013/before_1982/CMIP/data/360x180/' -cmip_sst_pre = 'amipbc_sst_360x180_' -cmip_sic_pre = 'amipbc_sic_360x180_' -cmip_file_suff = '.nc' -# -#MERRA-2 GRID: 1/4 deg -nlon_merra = 1440 -nlat_merra = 720 -#----------------------------------------------------------------- -# Form files that need to be pulled in -#SST -sst_fName_before_yr = cmip_data_path + cmip_sst_pre + (start_day.year-1).__str__() + cmip_file_suff -sst_fName_proc_yr = cmip_data_path + cmip_sst_pre + start_day.year.__str__() + cmip_file_suff -sst_fName_next_yr = cmip_data_path + cmip_sst_pre + (start_day.year+1).__str__() + cmip_file_suff -#SIC -sic_fName_before_yr = cmip_data_path + cmip_sic_pre + (start_day.year-1).__str__() + cmip_file_suff -sic_fName_proc_yr = cmip_data_path + cmip_sic_pre + start_day.year.__str__() + cmip_file_suff -sic_fName_next_yr = cmip_data_path + cmip_sic_pre + (start_day.year+1).__str__() + cmip_file_suff -#============================================================================================================================ -# GET THE DATA FROM ALL 3 YEARS. -print 'You want to create daily files for [%s]. Gathering RAW CMIP DATA...'%(start_day.year) -[lon, lat, time_before_yr, sst_before_yr, sic_before_yr] = get_cmip_sst_sic(sst_fName_before_yr, sic_fName_before_yr, iDebug) -[lon, lat, time_proc_yr, sst_proc_yr, sic_proc_yr] = get_cmip_sst_sic(sst_fName_proc_yr, sic_fName_proc_yr, iDebug) -[lon, lat, time_next_yr, sst_next_yr, sic_next_yr] = get_cmip_sst_sic(sst_fName_next_yr, sic_fName_next_yr, iDebug) - -# rearrange for easier processing. -# start with time stamps -time_all = numpy.zeros([len(time_proc_yr)+2], dtype=numpy.float64, order = 'F') -time_all[0] = time_before_yr[11] -time_all[1:len(time_proc_yr)+1] = time_proc_yr -time_all[len(time_proc_yr)+1] = time_next_yr[0] -# SST -sst_all = numpy.zeros([numpy.shape(sst_proc_yr)[0]+2, numpy.shape(sst_proc_yr)[1], numpy.shape(sst_proc_yr)[2]], dtype=numpy.float64, order = 'F') -sst_all[0,::] = numpy.squeeze(sst_before_yr[11,::]) -sst_all[1:len(time_proc_yr)+1,::] = sst_proc_yr -sst_all[len(time_proc_yr)+1,::] = numpy.squeeze(sst_next_yr[11,::]) -# SIC -sic_all = numpy.zeros([numpy.shape(sic_proc_yr)[0]+2, numpy.shape(sic_proc_yr)[1], numpy.shape(sic_proc_yr)[2]], dtype=numpy.float64, order = 'F') -sic_all[0,::] = numpy.squeeze(sic_before_yr[11,::]) -sic_all[1:len(time_proc_yr)+1,::] = sic_proc_yr -sic_all[len(time_proc_yr)+1,::] = numpy.squeeze(sic_next_yr[11,::]) - -print ' ' -#----------------------------------------------------------------- -if( iDebug): - print 'time_all: [%s]'%(dates.num2date(time_all)) - - plt.figure() - plt.subplot(211) - plt.pcolor(lon, lat, numpy.squeeze(sst_all[iPlot,:,:]), vmin=275.0, vmax=305.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'SST [%s/%s]'%(dates.num2date(time_all)[iPlot].month, dates.num2date(time_all)[iPlot].year)) - - plt.subplot(212) - plt.pcolor(lon, lat, numpy.squeeze(sic_all[iPlot,:,:]), vmin=0.0, vmax=1.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'SIC [%s/%s]'%(dates.num2date(time_all)[iPlot].month, dates.num2date(time_all)[iPlot].year)) - # - plt.show() - #fName_print = 'raw_cmip_' + '%s_%s'%(dates.num2date(timeX)[iPlot_month].month, dates.num2date(timeX)[iPlot_month].year) + '.png' - #plt.savefig(fName_print, dpi=100, format='png') - #plt.close('all') - -del time_before_yr,time_proc_yr,time_next_yr, sst_before_yr,sst_proc_yr,sst_next_yr, sic_before_yr,sic_proc_yr,sic_next_yr -#============================================================================================================================ -# NOW INTERPOLATE TO 1/4x/1/4 deg grid for MERRA -print 'Interpolating RAW CMIP DATA to MERRA GRID...' - -dlon_merra = 360.0/nlon_merra -dlat_merra = 180.0/nlat_merra - -lon_merra = numpy.linspace(-180.0+dlon_merra/2, 180.0-dlon_merra/2, nlon_merra) -lat_merra = numpy.linspace( -90.0+dlat_merra/2, 90.0-dlat_merra/2, nlat_merra) - -#CMIP Grid -xx_in, yy_in = numpy.meshgrid(lon, lat) -#MERRA Grid -xx_out, yy_out = numpy.meshgrid(lon_merra, lat_merra) - -sst_all_merra_res = numpy.zeros([numpy.shape(sst_all)[0], nlat_merra, nlon_merra], dtype=numpy.float64, order = 'F') -sic_all_merra_res = numpy.zeros([numpy.shape(sic_all)[0], nlat_merra, nlon_merra], dtype=numpy.float64, order = 'F') -#----------------------------------------------------------------- -for iMon in range(0, numpy.shape(sst_all)[0]): - - X1 = numpy.squeeze(sst_all[iMon,::]) - Y1 = numpy.squeeze(sic_all[iMon,::]) - - X2 = interpolate.griddata( (xx_in.ravel(), yy_in.ravel()), X1.ravel(), (xx_out, yy_out), method='nearest')#, fill_value = sst_fill) - Y2 = interpolate.griddata( (xx_in.ravel(), yy_in.ravel()), Y1.ravel(), (xx_out, yy_out), method='nearest')#, fill_value = sst_fill) - - sst_all_merra_res[iMon,::] = X2 - sic_all_merra_res[iMon,::] = Y2 - - del X1, Y1, X2, Y2 -#============================================================================================================================ -iDebug = 0 # set/unset to debug- so that we get plots. -print ' ' -print 'Interpolating MID-MONTH DATA to DAILY DATA on MERRA GRID...' - -proc_day = start_day -while( proc_day <= end_day): - - tI = pylab.interp( dates.date2num(proc_day), time_all, numpy.linspace(0, len(time_all)-1, len(time_all))) - tL = int(numpy.floor(tI)) - tH = int(numpy.ceil (tI)) - - print 'Processing for [%s]; CMIP data is on [%s] AND [%s]'%(proc_day, dates.num2date(time_all[tL]), dates.num2date(time_all[tH])) - - dX = numpy.squeeze(sst_all_merra_res[tH,::]) - numpy.squeeze(sst_all_merra_res[tL,::]) # this calculation can be done once a month. I am being dumb here! - dY = numpy.squeeze(sic_all_merra_res[tH,::]) - numpy.squeeze(sic_all_merra_res[tL,::]) - dT = time_all[tH] - time_all[tL] - - if( dT > 0.0): - X = numpy.squeeze(sst_all_merra_res[tL,::]) + (dates.date2num(proc_day) - time_all[tL]) * dX/dT - Y = numpy.squeeze(sic_all_merra_res[tL,::]) + (dates.date2num(proc_day) - time_all[tL]) * dY/dT - else: # mid-month day - X = numpy.squeeze(sst_all_merra_res[tL,::]) - Y = numpy.squeeze(sic_all_merra_res[tL,::]) - - # dump interpolated SST(X) & SIC(Y) to a netCDF file - write_cmip_daily( proc_day, lon_merra, lat_merra, X, Y, iDebug, iPlot_polar_stereo) - - del tI, tL, tH, dX, dY, dT, X, Y - proc_day = proc_day + timedelta(days=1) -#============================================================================================================================ -print '...Finished!' -# - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_daily_mean.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_daily_mean.py deleted file mode 100644 index d9b24fe6..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/make_daily_mean.py +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/python -#----------------------------------------------------------------- -''' -make a mean- for each day of sst & sic, using data from 1977- 981 for CMIP SST & SIC. -We use ncfiles that have daily data. They were created using make_cmip_daily.py -''' -#---------------------------------------------------------------- -import os -import sys - -import pylab as pylab -import numpy as numpy -import time as time -import calendar as calendar - -import matplotlib.dates as md -import matplotlib.pyplot as plt - -from datetime import datetime, timedelta - -sys.path.append('/discover/nobackup/sakella/processData/MERRA2_27June2013/before_1982/CMIP/') -from get_mean_sst_sic_CLIM import get_mean_sst_sic_CLIM -#----------------------------------------------------------------- -iDebug = 0 - -nLAT = 720 # nLAT -nLON = 1440 # nLON -nDAYS = 365 # for now, just have 365, later we will deal with Feb 29th. See bottom of script. - -fNames = [ ] -#----------------------------------------------------------------- -data_path = '/archive/u/sakella/MERRA2/bc_data/' -file_pre = 'daily_CMIP_' -file_suff = '.nc' -#----------------------------------------------------------------- -start_year = 1977 -end_year = 1981 -#----------------------------------------------------------------- -iDay = 1 -#----------------------------------------------------------------- -for iMon in range(1, 13): - start_date = datetime(start_year,iMon,01,00,0,0) - output_day = start_date.day - nDays_inThisMonth = calendar.monthrange(start_year, iMon)[1] - - while(output_day <= nDays_inThisMonth): - output_year = start_date.year - output_mon = start_date.month - - #INITIALIZE sum here. - nYears = 1 - fNames = [ ] - while(output_year <= end_year): - proc_year = output_year - proc_mon = output_mon - proc_day = output_day - proc_date = datetime(proc_year, proc_mon, proc_day) - #----------------------------------------------------------------- - # form file name - fName = data_path + proc_date.strftime('%Y')+'/' + 'RAW/' + file_pre + proc_date.strftime('%Y%m%d') + file_suff - #----------------------------------------------------------------- - fNames.append(fName) - print '[nYrs=%i, iDays=%i], Gathering...[%s]'%(nYears, iDay, fName) - nYears = nYears + 1 - output_year = output_year + 1 - #----------------------------------------------------------------- - output_day = output_day + 1 - iDay = iDay + 1 - #print '[%s]'%(fNames) - [mean_sst, mean_sic, lat, lon] = get_mean_sst_sic_CLIM(fNames, nYears-1, iDebug) - print 'Computed Mean over [%i] years for day [%i] of 365 days year.'%(nYears-1, iDay-1) - print '========================to next Day============================================' - print '========================to next Month==========================================' -# -#================================================================ -# NOW FEB 29TH. -#================================================================ - -start_year = 1980 -end_year = 1981 -start_date = datetime(start_year, 2, 29, 00, 0, 0) - -#INITIALIZE sum here. -nYears = 1 -fNames = [ ] -#....................................... -output_year = start_date.year -output_mon = start_date.month -output_day = start_date.day -while(output_year <= end_year): - proc_date = datetime(output_year, output_mon, output_day) - #----------------------------------------------------------------- - #form file name - fName = data_path + proc_date.strftime('%Y')+'/' + 'RAW/' + file_pre + proc_date.strftime('%Y%m%d') + file_suff - #----------------------------------------------------------------- - fNames.append(fName) - print '[nYrs=%i], Gathering...[%s]'%(nYears, fName) - nYears = nYears + 1 - output_year = output_year + 4 - #----------------------------------------------------------------- - -[mean_sst, mean_sic, lat, lon] = get_mean_sst_sic_CLIM(fNames, nYears-1, iDebug) -print 'Computed Mean over [%i] years for Feb 29th'%(nYears-1) -#----------------------------------------------------------------- -# - - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/sst_sic_CMIP_mean.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/sst_sic_CMIP_mean.py deleted file mode 100644 index 0717337a..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/sst_sic_CMIP_mean.py +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/python -#----------------------------------------------------------------- -''' -make a plot of monthly, regional mean sst & sic. for 1/4 deg daily CMIP; See -make_cmip_daily.py: this was used to create daily nc files. -''' -#----------------------------------------------------------------- -import os -import sys - -import pylab as pylab -import numpy as numpy -import time as time - -import matplotlib.dates as md -import matplotlib.pyplot as plt - -from datetime import datetime, timedelta -from calendar import monthrange - -sys.path.append('/discover/nobackup/sakella/processData/MERRA2_27June2013/before_1982/CMIP/') -from get_mean_sst_sic import get_mean_sst_sic -from get_ls_mask import get_ls_mask -#----------------------------------------------------------------- -iDebug = 0 - -lat_north = 30.0 #45.0 -lat_south =-30.0 #-45.0 -#----------------------------------------------------------------- -data_path = '/archive/u/sakella/MERRA2/bc_data/' - -#file_pre = 'daily_CMIP_' -file_pre = 'CMIP_clim_adj_' - -file_suff = '.nc' -#----------------------------------------------------------------- -start_date = datetime(1977,01,01,00,0,0) -end_date = datetime(1977,12,31,00,0,0) - -nMonths = (end_date.month-start_date.month) + 1 -# -nh_sst_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -tr_sst_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -sh_sst_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') - -nh_sic_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -tr_sic_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -sh_sic_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -#----------------------------------------------------------------- -# Make up a land sea mask based on 1/4 deg Reynolds. -fName_Reynolds_19820101 = '/gpfsm/dnb42/projects/p17/production/GEOS5odas-5.00/RC/OBS/REYN/1982/avhrr-only-v2.19820101.nc' - -##fName_CMIP_19811231 = '/archive/u/sakella/MERRA2/bc_data/1981/RAW/daily_CMIP_19811231.nc' -#fName_CMIP_19811231 = '/archive/u/sakella/MERRA2/bc_data/1981/ncFiles/CMIP_clim_adj_19810101.nc' -fName_CMIP_19811231 = '/archive/u/sakella/MERRA2/bc_data/1977/ncFiles/CMIP_clim_adj_19770101.nc' - -[sst_mask, sic_mask] = get_ls_mask(fName_Reynolds_19820101, fName_CMIP_19811231, iDebug) -#----------------------------------------------------------------- -date_proc = start_date - -for iMonth in range(1, nMonths+1): - - # SST - sum_NH_sst = 0.0 - sum_TR_sst = 0.0 - sum_SH_sst = 0.0 - # SIC - sum_NH_sic = 0.0 - sum_TR_sic = 0.0 - sum_SH_sic = 0.0 - #-------------------------------------------------------------------------------------------------------------------- - for iDay in range(1, monthrange(start_date.year, iMonth)[1]+1): - - # form file name - #fName = data_path + date_proc.strftime('%Y')+'/' + 'RAW/' + file_pre + date_proc.strftime('%Y%m%d') + file_suff - fName = data_path + date_proc.strftime('%Y')+'/' + 'ncFiles/' + file_pre + date_proc.strftime('%Y%m%d') + file_suff - #-------------------------------------------------------------------------------------------------------------------- - print 'Processing for...[%s], Month Num = [%i], file:[%s]'%(date_proc.strftime('%Y%m%d'), iMonth, fName) - [NH_sst, TR_sst, SH_sst, NH_sic, TR_sic, SH_sic] = get_mean_sst_sic(fName, date_proc, lat_north, lat_south, sst_mask, sic_mask, iDebug) - #-------------------------------------------------------------------------------------------------------------------- - sum_NH_sst = sum_NH_sst + NH_sst - sum_TR_sst = sum_TR_sst + TR_sst - sum_SH_sst = sum_SH_sst + SH_sst - - sum_NH_sic = sum_NH_sic + NH_sic - sum_TR_sic = sum_TR_sic + TR_sic - sum_SH_sic = sum_SH_sic + SH_sic - # - date_proc = date_proc + timedelta(days=1) - #-------------------------------------------------------------------------------------------------------------------- - nh_sst_mean[iMonth-1] = sum_NH_sst/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - tr_sst_mean[iMonth-1] = sum_TR_sst/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - sh_sst_mean[iMonth-1] = sum_SH_sst/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - - nh_sic_mean[iMonth-1] = sum_NH_sic/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - tr_sic_mean[iMonth-1] = sum_TR_sic/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - sh_sic_mean[iMonth-1] = sum_SH_sic/(numpy.float64(monthrange(start_date.year, iMonth)[1])) - #-------------------------------------------------------------------------------------------------------------------- -#----------------------------------------------------------------- -for iMonth in range(0, nMonths): - print 'Mon Num...[%i], SST means[NH, TR, SH]= %5.2f, %5.2f, %5.2f'%(iMonth+ 1, nh_sst_mean[iMonth], tr_sst_mean[iMonth], sh_sst_mean[iMonth]) - print 'Mon Num...[%i], SIC means[NH, TR, SH]= %5.2f, %5.2f, %5.2f'%(iMonth+1, nh_sic_mean[iMonth], tr_sic_mean[iMonth], sh_sic_mean[iMonth]) -#----------------------------------------------------------------- -nh_file_sst = str(start_date.year) + '_nh_sst_cmip.txt' -pylab.savetxt(nh_file_sst, nh_sst_mean) - -tr_file_sst = str(start_date.year) + '_tr_sst_cmip.txt' -pylab.savetxt(tr_file_sst, tr_sst_mean) - -sh_file_sst = str(start_date.year) + '_sh_sst_cmip.txt' -pylab.savetxt(sh_file_sst, sh_sst_mean) -# -nh_file_sic = str(start_date.year) + '_nh_sic_cmip.txt' -pylab.savetxt(nh_file_sic, nh_sic_mean) - -tr_file_sic = str(start_date.year) + '_tr_sic_cmip.txt' -pylab.savetxt(tr_file_sic, tr_sic_mean) - -sh_file_sic = str(start_date.year) + '_sh_sic_cmip.txt' -pylab.savetxt(sh_file_sic, sh_sic_mean) -#----------------------------------------------------------------- -#..... diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/test_make_ls_mask.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/test_make_ls_mask.py deleted file mode 100644 index 48cd4410..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/test_make_ls_mask.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/python -#----------------------------------------------------------------- -''' -make a plot of monthly, regional mean sst & sic. for 1/4 deg daily CMIP; See -make_cmip_daily.py: this was used to create daily nc files. -''' -#----------------------------------------------------------------- -import os -import sys - -import pylab as pylab -import numpy as numpy -import time as time - -import matplotlib.dates as md -import matplotlib.pyplot as plt - -from datetime import datetime, timedelta -from calendar import monthrange - -sys.path.append('/discover/nobackup/sakella/processData/MERRA2_27June2013/before_1982/CMIP/') -from get_mean_sst_sic import get_mean_sst_sic -from get_ls_mask import get_ls_mask -#----------------------------------------------------------------- -iDebug = 0 - -lat_north = 30.0 #45.0 -lat_south =-30.0 #-45.0 -#----------------------------------------------------------------- -data_path = '/archive/u/sakella/MERRA2/bc_data/' -file_pre = 'daily_CMIP_' -file_suff = '.nc' -#----------------------------------------------------------------- -start_date = datetime(1977,01,01,00,0,0) -end_date = datetime(1977,12,31,00,0,0) - -nMonths = (end_date.month-start_date.month) + 1 -# -nh_sst_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -tr_sst_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -sh_sst_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') - -nh_sic_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -tr_sic_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -sh_sic_mean = numpy.empty([nMonths,1], dtype=numpy.float64, order = 'F') -#----------------------------------------------------------------- -# Make up a land sea mask based on 1/4 deg Reynolds. -fName_Reynolds_19820101 = '/gpfsm/dnb42/projects/p17/production/GEOS5odas-5.00/RC/OBS/REYN/1982/avhrr-only-v2.19820101.nc' -fName_CMIP_19811231 = '/archive/u/sakella/MERRA2/bc_data/1981/RAW/daily_CMIP_19811231.nc' -[sst_mask, sic_mask] = get_ls_mask(fName_Reynolds_19820101, fName_CMIP_19811231, iDebug) -#----------------------------------------------------------------- -date_proc = start_date -fName = data_path + date_proc.strftime('%Y')+'/' + 'RAW/' + file_pre + date_proc.strftime('%Y%m%d') + file_suff -iDebug = 1 -[NH_sst, TR_sst, SH_sst, NH_sic, TR_sic, SH_sic] = get_mean_sst_sic(fName, date_proc, lat_north, lat_south, sst_mask, sic_mask, iDebug) - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/write_cmip_daily.py b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/write_cmip_daily.py deleted file mode 100644 index 5aec22fd..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/process_cmip_raw/write_cmip_daily.py +++ /dev/null @@ -1,122 +0,0 @@ - -import pylab as pylab -import numpy as numpy -import time as time -import calendar as calendar - -import matplotlib.dates as dates -import matplotlib.pyplot as plt - -from datetime import datetime, timedelta -from netCDF4 import Dataset -from mpl_toolkits.basemap import Basemap -#---------------------------------------------------------------- -def write_cmip_daily(dump_day, lon, lat, sst, sic, iDebug, iPlot_polar_stereo, verbose=False): - - #........................................................ - nrecs = 1 - nlevs = 1 # 1 level - #........................................................ - - dump_day_str = (dump_day.year).__str__() + dump_day.strftime('%m') + dump_day.strftime('%d') - nc_fName = 'daily_CMIP_' + dump_day_str + '.nc' - #........................................................ - # http://www.unidata.ucar.edu/software/netcdf/examples/programs/pres_temp_4D_wr.py - - # open a new netCDF file for writing. - out_ncfile = Dataset( nc_fName, 'w') - - # create the lat and lon dimensions. - out_ncfile.createDimension('latitude', len(lat)) - out_ncfile.createDimension('longitude', len(lon)) - - # create level dimension. - out_ncfile.createDimension('level',nlevs) - - # create time dimension (record, or unlimited dimension) - out_ncfile.createDimension('time',None) - - # Define the coordinate variables. They will hold the coordinate - # information, that is, the latitudes and longitudes. - # Coordinate variables only given for lat and lon. - lats = out_ncfile.createVariable('latitude', numpy.dtype('float64').char, ('latitude', )) - lons = out_ncfile.createVariable('longitude', numpy.dtype('float64').char, ('longitude',)) - - # Assign units attributes to coordinate var data. This attaches a - # text attribute to each of the coordinate variables, containing the units. - lats.units = 'degrees_north' - lons.units = 'degrees_east' - - # write data to coordinate vars. - lats[:] = lat - lons[:] = lon - - # create the temperature & ice variables - SST = out_ncfile.createVariable('daily_CMIP_SST',numpy.dtype('float64').char,('time','level','latitude','longitude')) - ICE = out_ncfile.createVariable('daily_CMIP_SIC',numpy.dtype('float64').char,('time','level','latitude','longitude')) - - # set the units attribute. - SST.units = 'deg_K' - ICE.units = 'none' - - # write data to variables along record (unlimited) dimension. - # same data is written for each record. - for nrec in range(nrecs): - SST[nrec,:,::] = sst - ICE[nrec,:,::] = sic - - # close the file. - out_ncfile.close() - #........................................................ - print 'Written out fields to...[%s]'%(nc_fName) - - if( iDebug): - coastLineFile = '/discover/nobackup/sakella/Stuff/matlabStuff/coastLine.dat' - [x_coast, y_coast] = pylab.loadtxt(coastLineFile, unpack=True) - - plt.figure() - plt.subplot(211) - plt.pcolor(lon, lat, numpy.squeeze(sst[0,0,:,:]), vmin=275.0, vmax=305.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'SST [%s]'%(dump_day_str)) - #........................................................ - if( iPlot_polar_stereo): - plt.subplot(223) - nps = Basemap(projection='npstere',boundinglat=45.0,lon_0=360.,resolution='l') - nps.drawcoastlines() - nps.fillcontinents(color='0.9') - nps.drawmeridians(numpy.arange(-180, 180, 30), color='0.5') - nps.drawparallels(numpy.arange(-90, 90, 30), color='0.5') - xn, yn = nps( *numpy.meshgrid(lon, lat)) - plt.hold(True) - nps.pcolormesh(xn, yn, numpy.squeeze(sic[0,0,:,:]), vmin=0.0, vmax=1.0,shading='flat') - plt.colorbar() - plt.title(r'NH-SIC') - #................. - plt.subplot(224) - sps = Basemap(projection='spstere',boundinglat=-40.0,lon_0=90,resolution='l') - sps.drawcoastlines() - sps.fillcontinents(color='0.9') - sps.drawmeridians(numpy.arange(-180, 180, 30), color='0.5') - sps.drawparallels(numpy.arange(-90, 90, 30), color='0.5') - xs, ys = sps( *numpy.meshgrid(lon, lat)) - sps.pcolormesh(xs, ys, numpy.squeeze(sic[0,0,:,:]), vmin=0.0, vmax=1.0,shading='flat') - plt.colorbar() - plt.title(r'SH-SIC') - else: - plt.subplot(212) - plt.pcolor(lon, lat, numpy.squeeze(sic[0,0,:,:]), vmin=0.0, vmax=1.0), plt.colorbar(), plt.axis('off'), plt.hold('true') - plt.plot(x_coast, y_coast, 'k-'),plt.axis('tight') - plt.title(r'SIC [%s]'%(dump_day_str)) - #................. - fName_print_fig = 'daily_cmip_' + dump_day_str + '.png' - plt.savefig(fName_print_fig,pad_inches=0.5,bbox_inches='tight',dpi=100, format='png')# orientation='landscape') - - plt.close('all') -#---------------------------------------------------------------- -if __name__ == '__main__': - ''' - ??? asdasd sd d sd ??? - - ''' - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/read_bin.f90 b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/read_bin.f90 deleted file mode 100644 index adc90753..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/read_bin.f90 +++ /dev/null @@ -1,55 +0,0 @@ -! -! to create a python usable module: -! f2py -c -m .f90 -! to create a signature file: -! f2py -h .pyf .f90 -! ..................................................................... - SUBROUTINE read_bin( fileName, & - nymd1, nhms1, nymd2, nhms2, NLON, NLAT, SST) - IMPLICIT NONE - - CHARACTER (LEN = 200), INTENT(IN) :: fileName - - INTEGER, INTENT(OUT) :: nymd1, nhms1 - INTEGER, INTENT(OUT) :: nymd2, nhms2 - - INTEGER, INTENT(OUT) :: NLON - INTEGER, INTENT(OUT) :: NLAT - - REAL, INTENT(OUT) :: SST(1440, 720) - -! LOCAL VARS - real year1,month1,day1,hour1,min1,sec1 - real year2,month2,day2,hour2,min2,sec2 - real dum1,dum2 - integer rc -! .................................................................... - open (10,file=fileName,form='unformatted',access='sequential', STATUS = 'old') -! .................................................................... - rc = 0 - do while (rc.eq.0) - read (10,iostat=rc) year1,month1,day1,hour1,min1,sec1, & - year2,month2,day2,hour2,min2,sec2,dum1,dum2 - if( rc.eq.0 ) then - nymd1 = nint( year1*10000 ) + nint (month1*100) + nint( day1 ) - nhms1 = nint( hour1*10000 ) + nint ( min1*100) + nint( sec1 ) - nymd2 = nint( year2*10000 ) + nint (month2*100) + nint( day2 ) - nhms2 = nint( hour2*10000 ) + nint ( min2*100) + nint( sec2 ) - NLON = nint(dum1) - NLAT = nint(dum2) - - IF( NLON /= 1440) PRINT *, 'ERROR in LON dimension in file: ', fileName - IF( NLAT /= 720) PRINT *, 'ERROR in LAT dimension in file: ', fileName - read (10,iostat=rc) SST - end if - end do - close(10) - - print *, year1,month1,day1,hour1,min1,sec1 - print *, year2,month2,day2,hour2,min2,sec2,dum1,dum2 - print *, 'rc = ', rc -!--------------------------------------------------------------------------- - END SUBROUTINE read_bin -! ..................................................................... -! - diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/write_cmip_bin.f90 b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/write_cmip_bin.f90 deleted file mode 100644 index 4888d870..00000000 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMIP_1977_1982/write_cmip_bin.f90 +++ /dev/null @@ -1,64 +0,0 @@ -! -! to create a python usable module: -! f2py -c -m write_cmip_bin write_cmip_bin.f90 -! to create a signature file: -! f2py -h write_cmip_bin.pyf write_cmip_bin.f90 -! ..................................................................... - SUBROUTINE write_bin( today_str, & - today_yr, today_mon, today_day, & - tomrw_yr, tomrw_mon, tomrw_day, & - SST, ICE) - - IMPLICIT NONE - - CHARACTER (LEN = 8), INTENT(IN) :: today_str - - REAL, INTENT(IN) :: today_yr - REAL, INTENT(IN) :: tomrw_yr - REAL, INTENT(IN) :: today_mon - REAL, INTENT(IN) :: tomrw_mon - REAL, INTENT(IN) :: today_day - REAL, INTENT(IN) :: tomrw_day - -! INTEGER, INTENT(IN) :: NLON -! INTEGER, INTENT(IN) :: NLAT - - REAL, INTENT(IN) :: SST(1440, 720) - REAL, INTENT(IN) :: ICE(1440, 720) - -! LOCAL VARS - REAL :: HEADER(14) - CHARACTER (LEN = 40) :: fileName_SST, fileName_ICE -! .................................................................... -! Header info. Start & end dates: format: YYYYMMDDHHMMSS; Hour,min,Sec are set to zero. - - HEADER(1) = today_yr - HEADER(2) = today_mon - HEADER(3) = today_day - HEADER(4:6) = 0.0 - - HEADER(7) = tomrw_yr - HEADER(8) = tomrw_mon - HEADER(9) = tomrw_day - HEADER(10:12) = 0.0 - HEADER(13) = 1440.0 - HEADER(14) = 720.0 -!--------------------------------------------------------------------------- -! Write out binary files for GCM to read - fileName_SST = 'CMIP_clim_adj_sst_' // today_str //'.bin' - fileName_ICE = 'CMIP_clim_adj_ice_' // today_str//'.bin' - - OPEN (UNIT = 991, FILE = fileName_SST, FORM = 'unformatted', STATUS = 'new') - OPEN (UNIT = 992, FILE = fileName_ICE, FORM = 'unformatted', STATUS = 'new') - - WRITE(991) HEADER - WRITE(991) SST - CLOSE(991) - - WRITE(992) HEADER - WRITE(992) ICE - CLOSE(992) -!--------------------------------------------------------------------------- - END SUBROUTINE write_bin -! ..................................................................... -! diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMakeLists.txt b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMakeLists.txt index 211d2fc5..a69d91b2 100644 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMakeLists.txt +++ b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/CMakeLists.txt @@ -21,36 +21,44 @@ ecbuild_add_executable ( TARGET regrid_forcing.x SOURCES regrid_forcing.F90 LIBS ${this}) +set_target_properties(regrid_forcing.x PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}}) ecbuild_add_executable ( TARGET regrid_forcing_esmf.x SOURCES regrid_forcing_esmf.F90 LIBS ${this}) +set_target_properties(regrid_forcing_esmf.x PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}}) ecbuild_add_executable ( TARGET sst_sic_EIGTHdeg.x SOURCES proc_SST_FRACI.F90 LIBS ${this}) +set_target_properties(sst_sic_EIGTHdeg.x PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}}) ecbuild_add_executable ( TARGET sst_sic_QUARTdeg.x SOURCES proc_SST_FRACI_ostia_quart.F90 LIBS ${this}) +set_target_properties(sst_sic_QUARTdeg.x PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}}) ecbuild_add_executable ( TARGET lake_sst_sic_EIGTHdeg.x SOURCES lake_data_EIGTHdeg.F90 LIBS ${this}) +set_target_properties(lake_sst_sic_EIGTHdeg.x PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}}) -if (F2PY_FOUND) - add_f2py_module(read_ops_bcs - SOURCES read_bin.f90 - DESTINATION bin - INCLUDEDIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/lib ${include_${this}} - ) - add_dependencies(read_ops_bcs ${this}) -endif (F2PY_FOUND) - -file(GLOB cshscripts *.csh) -file(GLOB perlscripts *.pl) +if (USE_F2PY) + find_package(F2PY2) + if (F2PY2_FOUND) + esma_add_f2py2_module(read_ops_bcs + SOURCES read_bin.f90 + DESTINATION bin + INCLUDEDIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/lib ${include_${this}} + ) + add_dependencies(read_ops_bcs ${this}) + endif () +endif () + +file(GLOB cshscripts CONFIGURE_DEPENDS *.csh) +file(GLOB perlscripts CONFIGURE_DEPENDS *.pl) install(PROGRAMS ${cshscripts} ${perlscripts} DESTINATION bin) diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/cube_BCs.pl b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/cube_BCs.pl index 69bad304..1dc7807c 100755 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/cube_BCs.pl +++ b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/cube_BCs.pl @@ -155,7 +155,8 @@ sub write_and_submit_jobfile { unlink $jobfile if -e $jobfile; unlink $jobfile if -e $logfile; - if ( -e "/etc/os-release" ) { + my $npn = `facter processorcount`; chomp($npn); + if ( $npn == 40 ) { $mynodes = "sky"; } else { $mynodes = "hasw"; diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/regrid_forcing.F90 b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/regrid_forcing.F90 index c8ca27ec..e9a41762 100644 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/regrid_forcing.F90 +++ b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/regrid_forcing.F90 @@ -565,6 +565,7 @@ end Program regrid_forcing Subroutine do_regrid_forcing(rc) use ESMF use MAPL + use MPI use GenGridCompMod, only : Root_SetServices => SetServices @@ -613,13 +614,14 @@ Subroutine do_regrid_forcing(rc) type(ESMF_Config) :: cf_root type(ESMF_Config) :: cf_hist character(len=ESMF_MAXSTR), parameter :: CF_FILE='REGRID_FORCING.rc' - logical :: frwd ! ----- ! Initialize framework ! -------------------- call ESMF_Initialize(vm=vm, logKindFlag=ESMF_LOGKIND_NONE,rc=STATUS) VERIFY_(STATUS) + call MAPL_Initialize(rc=status) + VERIFY_(status) ! Setup config ! ------------ @@ -670,6 +672,8 @@ Subroutine do_regrid_forcing(rc) ! Finalize ! -------- + call MAPL_Finalize(rc=status) + VERIFY_(status) call ESMF_Finalize(rc=STATUS) VERIFY_(STATUS) diff --git a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/regrid_forcing_esmf.F90 b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/regrid_forcing_esmf.F90 index 23214eee..6b6ae02b 100644 --- a/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/regrid_forcing_esmf.F90 +++ b/GEOS_Util/pre/NSIDC-OSTIA_SST-ICE_blend/regrid_forcing_esmf.F90 @@ -34,6 +34,7 @@ module GenESMFGridCompMod type(ESMF_Time) :: start_time type(ESMF_Time) :: end_time logical :: select_time + logical :: fix_fraction end type T_PrivateState type :: T_PrivateState_Wrap @@ -220,6 +221,8 @@ subroutine Initialize ( GC, IMPORT, EXPORT, CLOCK, RC ) call ESMF_TimeSet(privateState%end_time,yy=yy,mm=mm,dd=dd,rc=status) VERIFY_(STATUS) end if + call ESMF_ConfigGetAttribute(cf,privateState%fix_fraction,label='FIX_FRACTION: ',default=.false.,rc=status) + VERIFY_(STATUS) privateState%select_time = ( (stat1 == ESMF_SUCCESS) .and. (stat2 == ESMF_SUCCESS) ) ! Create grid for this component @@ -484,6 +487,10 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC ) ! transform data from ocean (tripolar or Reynolds) to mit-cubed call privateState%regridder%regrid(odata,pdata,rc=status) VERIFY_(status) + if (privateState%fix_fraction) then + where(pdata > 1.0) pdata = 1.0 + where(pdata < 0.0) pdata = 0.0 + end if ! write(unit_w) pdata if (doWrite) then call MAPL_VarWrite(unit_w, grid=pgrid, a=pdata, rc=status) @@ -523,6 +530,7 @@ end Program regrid_forcing Subroutine do_regrid_forcing(rc) use ESMF use MAPL + use MPI use GenESMFGridCompMod, only : Root_SetServices => SetServices @@ -571,13 +579,15 @@ Subroutine do_regrid_forcing(rc) type(ESMF_Config) :: cf_root type(ESMF_Config) :: cf_hist character(len=ESMF_MAXSTR), parameter :: CF_FILE='REGRID_FORCING.rc' - logical :: frwd + ! ----- ! Initialize framework ! -------------------- call ESMF_Initialize(vm=vm, logKindFlag=ESMF_LOGKIND_NONE,rc=STATUS) VERIFY_(STATUS) + call MAPL_Initialize(rc=status) + VERIFY_(status) ! Setup config ! ------------ @@ -592,6 +602,7 @@ Subroutine do_regrid_forcing(rc) call MAPL_Set(MAPLOBJ, CF=CF_ROOT, RC=STATUS) VERIFY_(STATUS) + ROOT = MAPL_AddChild ( MAPLOBJ, & name = "INPUT", & SS = ROOT_SetServices, & @@ -628,6 +639,8 @@ Subroutine do_regrid_forcing(rc) ! Finalize ! -------- + call MAPL_Finalize(rc=status) + VERIFY_(status) call ESMF_Finalize(rc=STATUS) VERIFY_(STATUS) diff --git a/GMAO_etc/CMakeLists.txt b/GMAO_etc/CMakeLists.txt index 08c98b81..ed462b18 100644 --- a/GMAO_etc/CMakeLists.txt +++ b/GMAO_etc/CMakeLists.txt @@ -50,15 +50,15 @@ ecbuild_add_executable ( ## bin ## -file(GLOB perl_files *.pl) +file(GLOB perl_files CONFIGURE_DEPENDS *.pl) # We must remove two files because of DASPERL list(REMOVE_ITEM perl_files ${CMAKE_CURRENT_SOURCE_DIR}/Err_Log.pl ${CMAKE_CURRENT_SOURCE_DIR}/fndate.pl ) -file(GLOB perl_packages *.pm) -file(GLOB python_files *.py) +file(GLOB perl_packages CONFIGURE_DEPENDS *.pm) +file(GLOB python_files CONFIGURE_DEPENDS *.py) set(perlscripts acquire @@ -86,6 +86,7 @@ set(perlscripts set(otherbin Functions.csh pyrob + pyrob_CF RmShmKeys_sshmpi.csh rmshmkeyhere.sh protex @@ -116,8 +117,8 @@ endforeach () ## etc ## -file(GLOB obsys_rc obsys*.rc) -file(GLOB templates *.tmpl) +file(GLOB obsys_rc CONFIGURE_DEPENDS obsys*.rc) +file(GLOB templates CONFIGURE_DEPENDS *.tmpl) install ( FILES ${obsys_rc} ${templates} pesto.arc PUBLICTAG diff --git a/GMAO_etc/Extract_config.pm b/GMAO_etc/Extract_config.pm index 9589e64d..fc0c55f0 100755 --- a/GMAO_etc/Extract_config.pm +++ b/GMAO_etc/Extract_config.pm @@ -91,7 +91,7 @@ use File::Basename; $param_value = ""; while ( ) { chop; - if ( m/$requested_param/ ) { $param_value = ( split( /=/ ) )[1]; } + if ( m/$requested_param/ ) { $param_value = ( split( /=/, $_, 2 ) )[1]; } } close( CFILE ); diff --git a/GMAO_etc/GMAO_utils.pm b/GMAO_etc/GMAO_utils.pm index 2372fc36..1367eef1 100644 --- a/GMAO_etc/GMAO_utils.pm +++ b/GMAO_etc/GMAO_utils.pm @@ -58,6 +58,7 @@ sub get_siteID { else { $siteID = "nas" } } $siteID = "nas" if $site =~ /^r\d+i\d+n\d+/; + $siteID = "nas" if $site =~ /^r\d+c\d+t\d+n\d+/; # NCCS sites #----------- diff --git a/GMAO_etc/PUBLICTAG b/GMAO_etc/PUBLICTAG index 26d78a3e..a51b87c1 100644 --- a/GMAO_etc/PUBLICTAG +++ b/GMAO_etc/PUBLICTAG @@ -1 +1 @@ -GEOS-5.25.1 +GEOS-5.29.3 diff --git a/GMAO_etc/Recd_State.pm b/GMAO_etc/Recd_State.pm new file mode 100755 index 00000000..f51d3282 --- /dev/null +++ b/GMAO_etc/Recd_State.pm @@ -0,0 +1,93 @@ +package Recd_State; +use Exporter; +@ISA = ('Exporter'); +@EXPORT = (recd_state); + +# ***************** Record job status to file ************** +# +# The included modules handle past data from job, format data +# and call scheduler utility - status to write status record to +# file task_status. +# +# Inputs: +# @pramt - array of strings. Some of them will be written in file: +# [0] -- job name; +# [1] -- job status (FAILED or COMPLETE); +# [2] -- part of record in status file that are: +# sched_cnfg, sched_id, sched_synp, sched_c_dt +# [3] -- scheduler's top dir; +# [4] -- schedule file local or temprary dir. It would be used when +# job status was COMPLETE and write to status file false; +# +# Output: +# Call scheduler utility "status" with these variables: +# $pramt[0] $pramt[1] $pramt[2] $pramt[3] +# +# Example: +# +# recd_state( "get_ssmi.pl", +# "FAILED", +# "FLK, GET-SSMI-01, 06:00, 2004-12-07", +# "/home/dao_ops/Scheduler", +# "/home/dao_ops" ) +# +# Author: Xiaochuan Huang +# +# History: Initial code 12/14/04 +# +# ***************************************************** + +sub recd_state { + + my ($jb, $state, $keys, $sch_dir, $local_dir) = @_; + + # $keys carry 4 data of strings. It will be write in task_status + # file that request data should be seperated by comma and white + # space like "FLK, TOP-FLK-DAS, 12:00, 2004-12-10". Count comma + # and space for checking. If there was no space between strings, + # add it to. + ## + $cnt_space = $keys =~ tr/ //; + $cnt_cama = $keys =~ tr/,//; + if( $cnt_space < $cnt_cama ) + { + print "\n!!! add space in."; + + # Add white space after camma. + ## + $keys =~ s/\,/, /g; + } + + $comd_wrt = "$sch_dir/utility/status"; + $args = "$jb $state $keys $sch_dir"; + print "\n args ==$args"; + + $signal = system "$comd_wrt $args"; + print "\nwrite status to schedule file signal = $signal"; + + # If it was false in writing table information to the status file, + # write the table information to a local or temporary file. + + if ( $signal != 0 && $state =~ "COMP" ) + { + my $stat_dt_tm = `date -u +%Y-%m-%d-%H:%M`; + chomp( $stat_dt_tm ); + $tmp_stat = "$keys, $state, $stat_dt_tm, task $jb"; + + # if local file dir is not existe, create it. + ## + my $lis_dir = `ls -l $local_dir`; + if ( $lis_dir eq "" || $! =~ "No" ) + { + print "\n>>>> make local dir. tmp_stat =$tmp_stat"; + `mkdir $local_dir`; + `chmod 777 $local_dir`; + } + $stat_fl = "$local_dir/task_status"; + `echo "$tmp_stat" >>$stat_fl`; + `chmod -R 666 $stat_fl`; + } + +} +# end recd_state + diff --git a/GMAO_etc/Remote_utils.pm b/GMAO_etc/Remote_utils.pm index 2ff33b0f..56241801 100755 --- a/GMAO_etc/Remote_utils.pm +++ b/GMAO_etc/Remote_utils.pm @@ -35,7 +35,7 @@ require Exporter; $DEFAULT_RSH = "/usr/bin/ssh"; $DEFAULT_RCP = "/usr/bin/scp"; -$DEFAULT_WGET = "/usr/local/other/SLES11.3/wget/1.18/bin/wget --no-check-certificate"; +$DEFAULT_WGET = "wget --no-check-certificate"; #===================== Global Variables =============================# @@ -1892,7 +1892,7 @@ sub rflist { if ( $remote_machine eq "http" || $remote_machine eq "https" ) { # Reconstruct URL without extra : characters. - $url = "http:${remote_file}${extra}"; + $url = "${remote_machine}:${remote_file}${extra}"; $dir = dirname ("$url"); $regex_raw = basename ("$url"); $regex_raw =~s/\*/\.\*/g; diff --git a/GMAO_etc/RmShmKeys_sshmpi.csh b/GMAO_etc/RmShmKeys_sshmpi.csh index c04214de..09c3879d 100755 --- a/GMAO_etc/RmShmKeys_sshmpi.csh +++ b/GMAO_etc/RmShmKeys_sshmpi.csh @@ -36,7 +36,7 @@ if( $?PBS_NODEFILE ) then else if ( $SITE == NAS ) then echo "Found site ${SITE}: using pdsh" - pdsh -f 128 -aF $PBS_NODEFILE $pathname/rmshmkeyhere.sh + pdsh -f 128 -w `/u/scicon/tools/bin/pbs_nodes $PBS_JOBID` $pathname/rmshmkeyhere.sh else diff --git a/GMAO_etc/ana4dupd.pl b/GMAO_etc/ana4dupd.pl index 6e3d5b20..33859d23 100755 --- a/GMAO_etc/ana4dupd.pl +++ b/GMAO_etc/ana4dupd.pl @@ -15,6 +15,7 @@ # 21Sep2015 Todling Add a version of an incremental update machinery # 26Apr2016 Todling Add option to update initial time restarts (4d-only) # 20Feb2017 Todling Parallel upd; opt to calc only initial tendency +# 12Feb2020 Todling Update extension of RST filenames # # !TO DO: # @@ -477,9 +478,9 @@ sub rst0upd { die ">>> ERROR <<< cannot find file $species ; likely lnbcs has not been executed" if ( $errcode ); } - my $adynsfx = "bin"; - my $moistsfx = "bin"; - my $pchemsfx = "bin"; + my $adynsfx = "nc4"; + my $moistsfx = "nc4"; + my $pchemsfx = "nc4"; # if ( $do_iupd && $iter > 0 ) { # $gcmfile = "$expid.fvcore_internal_rst.$timetagz.iter0.$dynsfx"; diff --git a/GMAO_etc/arbitrary.pl b/GMAO_etc/arbitrary.pl new file mode 100755 index 00000000..2e40c81f --- /dev/null +++ b/GMAO_etc/arbitrary.pl @@ -0,0 +1,39 @@ +#!/usr/bin/env perl +# Lay out task in given node +# e.g., arbitray.pl 4,1 +# lays out 4 tasks in first node and 1 task in second. +# From: https://slurm.schedmd.com/faq.html +# By: R. Todling, 02Jun2020 +my @tasks = split(',', $ARGV[0]); +my ($layout); + +$layout = arbitrary(@tasks); +print join("\n", split(/,/,$layout));print("\n"); + +sub arbitrary { + +my @tasks = @_; +my @nodes = `scontrol show hostnames $SLURM_JOB_NODELIST`; +my $node_cnt = $#nodes + 1; +my $task_cnt = $#tasks + 1; + +if ($node_cnt < $task_cnt) { + print STDERR "ERROR: You only have $node_cnt nodes, but requested layout on $task_cnt nodes.\n"; + $task_cnt = $node_cnt; + exit(1); +} + +my $cnt = 0; +my $layout; +foreach my $task (@tasks) { + my $node = $nodes[$cnt]; + last if !$node; + chomp($node); + for(my $i=0; $i < $task; $i++) { + $layout .= "," if $layout; + $layout .= "$node"; + } + $cnt++; +} +return $layout; +} diff --git a/GMAO_etc/check_obsysrc.py b/GMAO_etc/check_obsysrc.py index 6b692b3f..996451f7 100755 --- a/GMAO_etc/check_obsysrc.py +++ b/GMAO_etc/check_obsysrc.py @@ -3,7 +3,7 @@ from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser from glob import glob -from os.path import abspath, basename +from os.path import abspath, basename, exists, getsize from re import compile from sys import stdout from time import strftime @@ -57,6 +57,7 @@ def check(filename="obsys.rc", indefinite = "21001231_1800" misfile_list = [] + zfile_list = [] # open output files #------------------ @@ -175,7 +176,7 @@ def check(filename="obsys.rc", # get list of datetimes for data (plus other info) #------------------------------------------------- - (datetime_list, hhmm_list, misfiles) = get_data_info(template) + (datetime_list, hhmm_list, misfiles, zfiles) = get_data_info(template) got_data_info[template] = 1 if hhmm_list == {}: @@ -185,6 +186,7 @@ def check(filename="obsys.rc", continue misfile_list.extend(misfiles) + zfile_list.extend(zfiles) # determine actual data interval #------------------------------- @@ -369,13 +371,23 @@ def check(filename="obsys.rc", # write misfile info to errfile #------------------------------ if misfiles: - msg = " # MISFILES\n" + msg = " # MISLABELED, MISPLACED, and BROKEN-LINK files\n" errfl.write(border2+msg+border1) misfiles.sort() for mis in misfiles: errfl.write(" #"+mis+"\n") errfl.write(border1+"\n") + # write zero length file info to errfile + #--------------------------------------- + if zfiles: + msg = " # ZERO-LENGTH FILES\n" + errfl.write(border2+msg+border1) + zfiles.sort() + for zf in zfiles: + errfl.write(" #"+zf+"\n") + errfl.write(border1+"\n") + # write zeros for templates which found no data #---------------------------------------------- for (template, interval) in nodata_list: @@ -396,13 +408,23 @@ def check(filename="obsys.rc", # write misfile summary to stdout #-------------------------------- if misfile_list: - msg = "\n# MISLABELED and MISPLACED files\n" \ - + "#-------------------------------\n" + msg = "\n# MISLABELED, MISPLACED, and BROKEN-LINK files\n" \ + + "#---------------------------------------------\n" stdout.write(msg) misfile_list.sort() for mis in misfile_list: stdout.write(mis+"\n") + # write zero length file summary to stdout + #----------------------------------------- + if zfile_list: + msg = "\n# ZERO-LENGTH files\n" \ + + "#------------------\n" + stdout.write(msg) + zfile_list.sort() + for zf in zfile_list: + stdout.write(zf+"\n") + #....................................................................... def get_data_info(template): """ @@ -435,6 +457,7 @@ def get_data_info(template): hhmm_list = {} datetime_list = [] misfiles = [] + zfiles = [] if filepath_list: for fpath in filepath_list: @@ -490,6 +513,15 @@ def get_data_info(template): msg = "Cannot extract date/time from filename in fpath: {0}" raise Exception(msg.format(fpath)) + # check for broken-link and zero-length files + #-------------------------------------------- + if not exists(fpath): + misfiles.append("(BROKEN-LINK) "+fpath) + continue + + if getsize(fpath) == 0: + zfiles.append("(ZERO-LENGTH) "+fpath) + # check for misplaced or mislabeled files #---------------------------------------- if pattern["YYYY_JJJ"].search(fpath): @@ -544,7 +576,7 @@ def get_data_info(template): else: datetime_list = [zeros] - return (datetime_list, hhmm_list, misfiles) + return (datetime_list, hhmm_list, misfiles, zfiles) #....................................................................... def get_start_stop_tuples(datetime_list, intervalMins): diff --git a/GMAO_etc/cmpdir.pl b/GMAO_etc/cmpdir.pl index 20f7421e..c8863e12 100755 --- a/GMAO_etc/cmpdir.pl +++ b/GMAO_etc/cmpdir.pl @@ -18,24 +18,22 @@ use File::Basename qw(basename dirname); use File::Copy qw(copy); use File::Path qw(mkpath rmtree); -use Getopt::Long; - use FindBin qw($Bin); -use lib "$FindBin::Bin"; -use Query qw(query yes); +use Getopt::Long; # global variables #----------------- my ($bindiff, $bwiFLG, $debug, $cdoX, $delim, $diffFLGs, $dir1, $dir2); my ($dirA, $dirB, $dirL1, $dirL2, $dmgetX, $filemode, $first, $follow); my ($ignoreFLG, $ignoreFile, $list, $listx, $quiet, $recurse, $sortFLG); -my ($subdir, $tmpdir, $verbose); +my ($subdir, $tarfile_dirA, $tarfile_dirB, $tdirfile, $tmpdir, $verbose); my (%different, %diffsBIN, %diffsTXT, %dir_display, %filesize, %found); my (%identical, %ignore, %opts, %patterns, %vopts); -my (@exclude, @extINC, @fileIDs, @files, @files1, @files2); +my (@exclude, @extEXCL, @extINC, @fileIDs, @files, @files1, @files2); my (@p1, @p2, @subdirs, @unmatched1, @unmatched2); $delim = "="; # character to use when defining diffs to ignore +$tdirfile = "tarfile_directory_locationXXX"; # used when comparing tarfiles # main program #------------- @@ -58,12 +56,14 @@ # purpose - get input parameters and initialize global variables #======================================================================= sub init { - my ($etcflg, $fcstflg, $help, $rsflg, $runflg); + my ($binX, $etcflg, $fcstflg, $help, $rsflg, $runflg); my ($arrAddr, $val, @values, @vlist); # get runtime flags #------------------ - GetOptions("db|debug" => \$debug, + GetOptions("binX" => \$binX, + "db|debug" => \$debug, + "extX=s" => \@extEXCL, "ext=s" => \@extINC, "etc" => \$etcflg, "fcst" => \$fcstflg, @@ -93,6 +93,7 @@ sub init { #------------------------------------------- push @exclude, "."; push @exclude, ".."; + push @exclude, $tdirfile; # verbose option in %opts, if verbose mode #----------------------------------------- @@ -105,7 +106,7 @@ sub init { # extract comma-separated option values #-------------------------------------- - foreach $arrAddr (\@exclude, \@extINC, \@fileIDs, \@p1, \@p2) { + foreach $arrAddr (\@exclude, \@extEXCL, \@extINC, \@fileIDs, \@p1, \@p2) { @vlist = (); foreach (@$arrAddr) { @values = split ',', $_; @@ -113,7 +114,8 @@ sub init { foreach $val (@values) { # remove leading '.' from extension - if ($arrAddr == \@extINC) { + #---------------------------------- + if ($arrAddr == \@extEXCL or $arrAddr == \@extINC) { while (index($val, ".") == 0) { $val = substr($val, 1) } } push @vlist, $val if $val; @@ -122,6 +124,14 @@ sub init { @$arrAddr = @vlist; } + # extensions to exclude with -binX flag + #-------------------------------------- + if ($binX) { + foreach (qw(a d mod o pyc so x )) { + push @extEXCL, $_; + } + } + # shortcuts for checking etc, fcst, run, or rs directory #------------------------------------------------------- if ($etcflg) { $subdir = "etc"; $recurse = 1 } @@ -256,8 +266,8 @@ sub init_dirmode { @files1 = (); @files2 = (); - get_filelist($dir1, \@files1); - get_filelist($dir2, \@files2); + $tarfile_dirA = get_filelist($dir1, \@files1); + $tarfile_dirB = get_filelist($dir2, \@files2); if ($list) { cmp_lists(); return } show_file_counts(1); @@ -400,7 +410,7 @@ sub cdo_diff { #======================================================================= sub get_filelist { my ($dirname, $flAddr); - my (@dirs, $dir, @names, $name); + my (@dirs, $dir, @names, $name, $tardirfile, $tarfile_dir); $dirname = shift @_; $flAddr = shift @_; @@ -408,6 +418,10 @@ sub get_filelist { die "Error. $dirname is not a directory;" unless -d abs_path($dirname); die "Error. file list array address not given;" unless $flAddr; + $tarfile_dir = ""; + $tardirfile = "$dirname/$tdirfile"; + chomp($tarfile_dir = `cat $tardirfile`) if -e $tardirfile; + push @$flAddr, $dirname if $list; @dirs = (); @@ -420,6 +434,7 @@ sub get_filelist { if ($recurse) { foreach $dir (sort(@dirs)) { get_filelist($dir, $flAddr) } } + return $tarfile_dir; } #======================================================================= @@ -686,7 +701,8 @@ sub show_binary_diffs { while ($dflt) { unless ( $diffs{$dflt} ) { $dflt = 0; last } - last if $diffs{$dflt} =~ /\.tar$/; + last if $diffs{$dflt} =~ /\.tar$/ + or $diffs{$dflt} =~ /\.png$/; if ($cdoX) { last if $diffs{$dflt} =~ /\.hdf$/ @@ -741,6 +757,16 @@ sub show_binary_diffs { $show_menu = 1; } + # display Portable Network Graphic files + #--------------------------------------- + if ($ext1 eq "png" and $ext2 eq "png") { + system("display $file1 &"); + sleep(1); + system("display $file2 &"); + $num++; + $show_menu = 1; + } + # compare binary files #--------------------- else { cmp_binary_files($num, $file1, $file2) } @@ -784,11 +810,14 @@ sub cmp_binary_files { # purpose - recursively call cmpdir.pl to compare contents of tarfiles #======================================================================= sub cmp_tarfiles { - my (@tarfile, @tmptardir); + my (@tarfile, @tmptardir, @tdir, $tardirfile); $tarfile[1] = shift @_; $tarfile[2] = shift @_; + $tdir[1] = "$dirA\n"; + $tdir[2] = "$dirB\n"; + # untar into temporary directories #--------------------------------- foreach (1..2) { @@ -798,6 +827,13 @@ sub cmp_tarfiles { system_("tar xf $tarfile[$_] -C $tmptardir[$_]") && die "Error untarring $tmptardir[$_];"; + + # write tarfile directory location to file in tmpdir + #--------------------------------------------------- + $tardirfile = "$tmptardir[$_]/$tdirfile"; + open tD, "> $tardirfile" or die "Error opening $tardirfile;"; + print tD $tdir[$_]; + close tD; } # use cmpdir.pl to compare temporary directories @@ -816,7 +852,7 @@ sub cmp_tarfiles { #======================================================================= sub show_text_diffs { my (%diffs, @tempArr, $max, $fmt0, $fmt1, $fmtT, $num); - my ($file1, $base1, $base2, $dflt, $sel); + my ($file1, $base1, $base2, $dflt, $sel, $ncount); if (@_) { %diffs = @_ } else { %diffs = %diffsTXT } @@ -854,8 +890,16 @@ sub show_text_diffs { print "\n"; printf $fmt1, "0", "previous menu\n"; if (keys %diffs > 1) { - printf $fmt0, "a", "cycle thru all"; + printf $fmt0, "a", "cycle thru all diffs"; if ($dflt) { print " (starting from $dflt)\n" } else { print "\n" } + + unless ($ignoreFLG or $sortFLG) { + printf $fmt0, "A", "display all diffs at once"; + if ($dflt) { print " (starting from $dflt)\n" } else { print "\n" } + + printf $fmt1, "nN", "display next N (int value) differences"; + } + print "\n"; } if ($diffFLGs) { printf $fmt1, "b", "turn OFF -bwi diff flag" } else { printf $fmt1, "b", "turn ON -bwi diff flag" } @@ -865,9 +909,10 @@ sub show_text_diffs { if ($ignoreFLG) { printf $fmt1, "i", "turn OFF ignore diffs" } else { printf $fmt1, "i", "turn ON ignore diffs " } - if ($sortFLG) { printf $fmt1, "s", "turn OFF sorted diff\n" } - else { printf $fmt1, "s", "turn ON sorted diff\n" } + if ($sortFLG) { printf $fmt1, "s", "turn OFF sorted diff" } + else { printf $fmt1, "s", "turn ON sorted diff" } + print "\n"; print "Make Selection: [$dflt] "; chomp($sel = ); $sel =~ s/\s//g; @@ -875,23 +920,26 @@ sub show_text_diffs { return if $sel eq "0"; - # show differences for all remaining files starting with current index - #----------------------------------------------------------------------- - # *** unadvertised "A" option will display all at once *** - # Change "A" option to "a" if either $ignoreFLG or $sortFLG is on. + # show multiple diffs starting with current index + #------------------------------------------------ + # Change "A" or "n$m" to "a" if either $ignoreFLG or $sortFLG is on. #----------------------------------------------------------------- # Use $diffs{"wait"} to signal not to display all at once if $sel eq "a". #----------------------------------------------------------------------- - if ($sel eq "a" or $sel eq "A") { + if ($sel eq "a" or $sel eq "A" or $sel =~ m/^n(\d*)$/) { + $ncount = $1; + $ncount = 1 if $sel eq "n"; $sel = "a" if $ignoreFLG or $sortFLG; $diffs{"wait"} = 1 if $sel eq "a"; $num = 1 unless $diffs{$num}; while ($diffs{$num}) { display_text_diffs($num, %diffs); + last if $ncount and --$ncount <= 0; $num++; } delete $diffs{"wait"} if $diffs{"wait"}; - $num = -1; next; + $num = -1 if lc($sel) eq "a"; + next; } # toggle diff -bwi flag @@ -1446,6 +1494,10 @@ sub show_file_counts { $fmt = "%s: %-${max}s (%d files)\n"; underline("Directory file counts"); + if ($tarfile_dirA and $tarfile_dirB) { + print "dirA: $tarfile_dirA\n"; + print "dirB: $tarfile_dirB\n\n"; + } printf $fmt, "dir1", $dir1, scalar(@files1); printf $fmt, "dir2", $dir2, scalar(@files2); print "\n"; @@ -1458,7 +1510,7 @@ sub show_file_counts { # purpose - display list of files in the two directories being compared #======================================================================= sub list_files { - my ($fmt, $num, $base); + my ($fmt, $cnt, $num, $base); $fmt = "%2d. %s\n"; @@ -1466,9 +1518,15 @@ sub list_files { #------------------------ if (@files1) { underline("dir1: " .$dir1); + print "$tarfile_dirA\n" if $tarfile_dirA; + $cnt = 0; $num = 0; foreach (sort @files1) { printf $fmt, ++$num, branch($_, "1"); + if (++$cnt == 50) { + pause(); + $cnt = 0; + } } } else { print "\nNo files in dir1: $dir1\n"; @@ -1479,9 +1537,15 @@ sub list_files { #------------------------ if (@files2) { underline("dir2: " .$dir2); + print "$tarfile_dirB\n" if $tarfile_dirB; + $cnt = 0; $num = 0; foreach (sort @files2) { printf $fmt, ++$num, branch($_, "2"); + if (++$cnt == 50) { + pause(); + $cnt = 0; + } } } else { print "\nNo files in dir2: $dir2\n"; @@ -2052,15 +2116,104 @@ sub underline { # => 1 : do not include $name #======================================================================= sub Xcluded { - my ($name, $xname); + my ($name, $ext, $xname); $name = shift @_; + foreach $ext (@extEXCL) { + return 1 if (split(/\./, $name))[-1] eq $ext; + } foreach $xname (@exclude) { return 1 if basename($name) eq $xname; } return 0; } +#======================================================================= +# name - query +# purpose - query user for a response and return the response +# +# input parameters +# => $str: use this line to prompt for a response +# => $dflt: (optional) default value to use for response +# +#======================================================================= +sub query { + my ($str, $dflt, $prompt, $ans); + + $str = shift @_; + $dflt = shift @_; + + # prepare prompt + #--------------- + $prompt = "$str "; + $prompt .= "[$dflt] " unless blank($dflt); + + # get user response + #------------------ + print $prompt; + chomp($ans = ); + $ans =~ s/^\s+|\s+$//g; # remove leading/trailing blanks from response + $ans = expand_EnvVars($ans); + if ( blank($ans) ) { $ans = $dflt unless blank($dflt) } + + return $ans; +} + +#======================================================================= +# name - expand_EnvVars +# purpose - expand Environment Variables within a string +#======================================================================= +sub expand_EnvVars { + my ($string, $cnt, $var, $name); + + $string = shift @_; + $cnt = 0; + + # look for ${var} format + #----------------------- + while ($string =~ m/(\${(\w+)})/) { + $var = $1; $name = $2; + $var =~ s/\$/\\\$/; + $string =~ s/$var/$ENV{$name}/; + die "Error. Infinite loop condition;" if ++$cnt > 100; + } + + # look for $var format + #--------------------- + while ($string =~ m/(\$\b(\w+)\b)/) { + $var = $1; $name = $2; + $var =~ s/\$/\\\$/; + $string =~ s/$var/$ENV{$name}/; + die "Error. Infinite loop condition;" if ++$cnt > 200; + } + return $string; +} + +#======================================================================= +sub yes { + my $str; + $str = shift @_; + $str = lc $str; # make lowercase + $str =~ s/^\s*|\s*$//g; # remove leading/trailing blanks + return 1 if $str eq "y" or $str eq "yes" +} + +#======================================================================= +sub neg { + my $str; + $str = shift @_; + $str = lc $str; # make lowercase + $str =~ s/^\s*|\s*$//g; # remove leading/trailing blanks + return 1 if $str eq "n" or $str eq "no" +} + +#======================================================================= +sub blank { + my $str; + $str = shift @_; + return 1 if $str =~ /^\s*$/; +} + #======================================================================= # name - usage # purpose - print script usage information @@ -2088,6 +2241,8 @@ sub usage { dir2 = second directory being compared options + -binX exclude extensions: a, d, mod, o, pyc, so, x + -extX extension exclude all files with this extension (see Note 1) -ext extension compare all files with this extension (see Note 1) -etc shortcut for "-subdir etc -r" -fcst shortcut for "-subdir fcst -r" @@ -2113,9 +2268,9 @@ sub usage { -p pattern1=pattern2 Notes: -1. Multiple values can be given for extension (-ext), fileID (-id), pattern1 (-p1), - pattern2 (-p2), and str (-X) by separating values with a comma (no space) or by - multiple use of the option flag. +1. Multiple values can be given for extension (-ext, -extX), fileID (-id), + pattern1 (-p1), pattern2 (-p2), and str (-X) by separating values with + a comma (no space) or by multiple use of the option flag. 2. Multiple pattern1=pattern2 values can be given by multiple uses of the -p flag 3. There must be a matching pattern2 for each pattern1, and vice versa. diff --git a/GMAO_etc/esma_mpirun b/GMAO_etc/esma_mpirun index e83fe38d..181a3fb0 100755 --- a/GMAO_etc/esma_mpirun +++ b/GMAO_etc/esma_mpirun @@ -220,7 +220,7 @@ sub which_mpi_cmd { # For now use mpirun_rsh. At NCCS this should be # srun -n but as -np is *external* to esma_mpirun # this requires wholesale script changes - chomp($mpicmd = `which mpirun_rsh`); + chomp($mpicmd = `which mpiexec.mpirun_rsh`); } else { # Used by both Intel MPI and Open MPI chomp($mpicmd = `which mpirun`); @@ -251,7 +251,7 @@ sub get_xtraflags { # flags needed for mvapich2 mpi #------------------------------ - $xtraflags .= "-export -hostfile \$PBS_NODEFILE" if $mpi_type eq "mvapich2"; + $xtraflags .= "-export" if $mpi_type eq "mvapich2"; # flags needed for intel mpi #--------------------------- diff --git a/GMAO_etc/getsponsor.pm b/GMAO_etc/getsponsor.pm index 57b92ea7..5fb884fb 100644 --- a/GMAO_etc/getsponsor.pm +++ b/GMAO_etc/getsponsor.pm @@ -361,7 +361,7 @@ sub defaultID { # as last resort, pick last value in @GID as default #--------------------------------------------------- unless ($dflt) { - if (@GID) { $dflt = $GID[-1] } + if (@GID) { $dflt = $GID[0] } } return $dflt; } diff --git a/GMAO_etc/idcheck.pl b/GMAO_etc/idcheck.pl index 3e663718..ae9f2d3b 100755 --- a/GMAO_etc/idcheck.pl +++ b/GMAO_etc/idcheck.pl @@ -23,7 +23,9 @@ { init(); check_semperpy_dbs() if $DBcheck; - check_plots_dir() if $PLcheck; + unless ($status == 1) { + check_plots_dir() if $PLcheck; + } exit $status; } @@ -76,16 +78,17 @@ sub check_semperpy_dbs { # load SemperPy module #--------------------- $SHARE = "/discover/nobackup/projects/gmao/share"; - $modsDIR = "$SHARE/dasilva/lib/python/gmaopy/modules"; + $modsDIR = "/home/dao_ops/gmao_packages/modules"; unless (-e $modsDIR) { - myprint("Warning: Unable to check SemperPy DB info"); + myprint("Warning: Unable to check SemperPy DB info: $modsDIR;"); $status = 99 unless $status == 1; return; } $ENV{"MODULEPATH"} .= ":${modsDIR}"; do "/usr/share/modules/init/perl"; - module ("load semperpy/1.90"); + module ("load gpy/sles12-v1.1.0"); + $ENV{"SEMPERPY_CONFIG"} = "/home/dao_ops/gmao_packages/o2h/o2h/config"; # write .pgpass, if it does not already exist #--------------------------------------------- @@ -94,7 +97,7 @@ sub check_semperpy_dbs { unless (-e $pgpass) { myprint("Writing temporary password file: $pgpass"); open $PGP, "> $pgpass" or die "Error. Unable to write $pgpass\n"; - print $PGP "dpdb:*:*:$user:hemperUI9#\n"; + print $PGP "edb1:*:*:$user:hemperUI9#\n"; close $PGP; system "chmod 600 $pgpass"; $removeAfterCheck = 1; @@ -103,17 +106,22 @@ sub check_semperpy_dbs { # find SemperPy bin directory #---------------------------- chomp($spy_sql = `which spy_sql`); + unless ($spy_sql) { + warn "Cannot find spy_sql. Exiting ... ;"; + exit; + } chomp($bindir = `dirname $spy_sql`); # look for expid in each logical database #---------------------------------------- @ldb_found = (); - foreach $logical_db qw( fc_exp fc_ops im_exp im_ops ) { + foreach $logical_db (qw( fc_exp fc_ops im_exp im_ops )) { chomp($which_pdb = `python $bindir/whichdb.py $logical_db`); $physical_db = (split /\s+/, $which_pdb)[0]; + next unless $physical_db; $cmd = "select distinct expver from $logical_db.stats"; - $psql_cmd = "psql -w -q -U $user -h dpdb $physical_db -c \"$cmd\""; + $psql_cmd = "psql -w -q -U $user -h edb1 $physical_db -c \"$cmd\""; print "$psql_cmd\n" if $verbose; $select_results = `$psql_cmd`; @@ -265,7 +273,7 @@ sub usage { =1 => check SemperPy databases =2 => check geos5 modeling Intranet plot directory =3 => check both (default) - -rem Remote account to use for accessing Intranet plot directory + -rem acct Remote account to use for accessing Intranet plot directory default: $ENV{"USER"}\@train (remote machine must be either "polar" or "train") -np Take default for \$rem_acct if not provided; Otherwise, diff --git a/GMAO_etc/jobIDfilter b/GMAO_etc/jobIDfilter index 76f9cd77..34b01588 100755 --- a/GMAO_etc/jobIDfilter +++ b/GMAO_etc/jobIDfilter @@ -31,7 +31,8 @@ my ($colons, $wait, %ids, $qstat); while (1) { # get qstat output #----------------- - $qstatStr = `qstat -u $ENV{"USER"}`; + #--$qstatStr = `qstat -u $ENV{"USER"}`; + $qstatStr = `squeue -u $ENV{"USER"}`; # which IDs are found in qstat output #------------------------------------ @@ -101,7 +102,8 @@ sub init { # get qstat command #------------------ - $qstat = `which qstat` or exit 1; + #--$qstat = `which qstat` or exit 1; + $qstat = `which squeue` or exit 1; } #======================================================================= diff --git a/GMAO_etc/mptfix.pl b/GMAO_etc/mptfix.pl index 26973503..14629a06 100755 --- a/GMAO_etc/mptfix.pl +++ b/GMAO_etc/mptfix.pl @@ -5,6 +5,7 @@ # 11May2016 Thompson Adaptations for using MPT # 24Jun2016 Thompson Changes that use the machinefile to calculate number of # tasks per node. No longer requires that as an input +# 04Jun2020 Todling Allow for parallelizaton of serial calls # #----------------------------------------------------------------------------------------------------- @@ -60,6 +61,7 @@ sub main { my ($modulo, $nodelist); my (@joblines, $fragment, $command); my (%counts, $test_for_equal_nodes); + my ($fvroot); if ( $#ARGV < 2 ) { print STDERR " Missing arguments; see usage:\n"; @@ -72,7 +74,7 @@ sub main { # FVROOT is where the binaries have been installed # ------------------------------------------------ - + $fvroot = $ENV{FVROOT}; if ( $queue eq "datamove" ) { $ntasks = 1; @@ -158,8 +160,15 @@ sub main { foreach $command (@joblines) { + if ( $command =~ /mpirun/ ) { + if ($debug) { + print "command before: $command\n"; + } $fragment = substr $command, index($command, 'mpirun'), 6, "mpiexec -machinefile"; + if ($debug) { + print "command after: $command\n"; + } } if ( $command =~ /mpiexec_mpt/ ) { @@ -185,6 +194,19 @@ sub main { print "command after: $command\n"; } } + + if ( $command =~ /serial_run/ ) { + if ($debug) { + print "command before: $command\n"; + } + + $fragment = substr $command, index($command, 'serial_run'), 10, "ssh -nf $nodelist source $fvroot/bin/g5_modules; "; + + if ($debug) { + print "command after: $command\n"; + } + } + print JOBOUTPUT $command; } diff --git a/GMAO_etc/obsys-nccs-arc.rc b/GMAO_etc/obsys-nccs-arc.rc new file mode 100755 index 00000000..62996b2c --- /dev/null +++ b/GMAO_etc/obsys-nccs-arc.rc @@ -0,0 +1,744 @@ +# NCCS Specific Version +# +# This observation system resource file database will track +# the whereabout of observation files. +# It will be used by scripts require_obsys (hard check the +# existence of observation files) +# and acquire_obsys (will call acquire to get files). +# +# Syntax: +# ------- +# BEGIN observation_file_class => StandardName +# startYYYYMMDD_HHz-endYYYYMMDD_HHz incrementHHMMSS remote_file_name_template +# END +# Note: set "endYYYYMMDD_HHz" as "present" if new files added to system daily. +# Note: replacing "present" (see note above) with future date, 21001231_18z +# +# Modification History: +# --------------------- +# 2002.08.01 da Silva NCCS specific version +# 2002.09.13 E. Yeh Set the starting date of DAOTOVS l1c llk as 2001.12.19 +# 2002.10.07 E. Yeh Set SSMI/TPW generic name as obsys.ssmi_tpw.f%c%c.%y4%m2%d2.ods +# 2002.10.31 E. Yeh Updated qscat +# 2003.03.31 D. Kokron Add ERS1, ECMWF, and other obs from dao_it repository and ozone +# 2003.04.01 D. Kokron Add ssmi_speed_llk class +# 2003.04.01 D. Kokron Extend ssmi_wentz_tpw and ssmi_tpw_llk classes with v5 tpw +# 2003.04.01 D. Kokron Add f15 to ssmi_wentz_tpw class +# 2003.04.01 D. Kokron Correct qscat class to account for missing data on 20021119 +# 2003.04.02 D. Kokron Add conv_ncep class +# 2003.04.02 D. Kokron Split conv_ncep and conv_ecmwf each into two classes +# 2003.04.03 D. Kokron Create ssmi_tpw_v5_v4, ssmi_speed_v5_v4 classes +# 2003.04.03 D. Kokron Split qscat class into jpl and llk specific classes +# 2003.07.09 Todling Added pointers to llk GADS observations +# 2003.07.23 C. Cruz Added NCEP observational data +# 2003.08.19 Todling Split NCEP classes into classes that need to be reblocked +# 2003.12.05 Todling Added ref to ODS files for Terra MODIS Winds +# 2004.04.30 Todling Added classes for latest NCEP data files +# 2004.07.14 Todling Added location of NCEP's operational observations under Karki's dir +# 2004.09.24 Todling/daSilva Added SABER Level 2B data +# 2004.11.24 Todling Added NCEP historic data files for G5DAS validation (200011-200112) +# 2005.03.22 Todling GSI-NCEP data coming from /input/dao_ops +# 2005.04.12 Todling Added reference to Emily Liu's version of AIRS (until OPS has them) +# 2006.01.05 Todling Started adding the MERRA observing system +# 2006.01.21 E. Liu Added SSU location for MERRA +# 2006.02.23 Todling Added SBUV-8 for MERRA +# 2006.03.17 Meta/RT Added individual obs files for MERRA for period before 20010101 +# 2006.05.17 Todling Added gprof and tmi data; updated spssmi location +# 2006.05.30 Todling Added sfcbog; fixed initial dates for adpupa and sfcship; loc of GMAO/AIRS +# 2006.06.05 Todling Added tcvitals +# 2006.06.21 Meta/RT Fixes to final date of avail MERRA SSM/I radiance files +# 2006.06.22 Todling Updates to SBUV-8 (MERRA) per Rob and Ivanka +# 2006.12.13 Todling Renamed local cp of gmao airs files; "fix" to spssmi; fix to ssmit filename +# 2007.01.16 Lucchesi/JCS Corrected SSMI wind speed entry +# 2007.02.01 Lucchesi/JCS Added missing pointer for merra_ers1 data; corrected dates on trmm tmi +# data; commented out tmi2 data +# 2007.02.05 Lucchesi/JCS Modified SBUV usage for MERRA so that there is no satellite overlap +# 2007.03.30 Meta/JCS Removed "prep-qc." from goesnd name +# 2007.07.17 Stassi Change /input -> /archive/input, /output/{user} -> /archive/u/{user} +# 2007.07.19 Lucchesi/JCS Changes for MERRA validation runs, e.g. CDAS replaced with "runh" data +# 2007.10.19 Lucchesi/JCS New SBUV-8 block +# 2008.02.12 Lucchesi Set transition dates from MERRA data to operational data (2006 timeframe) +# 2008.05.20 Lucchesi Ran Meta's program to QC out the data in the CDAS "runh" data +# 2009.16.09 Todling - Fix range of MSU +# - Add MHS, HIRS4, NCEP-AIRS, AMSRE, GOESIMR, GEOSFV, GOME, GPSIPW, GPSRO, MTIASI +# 2009.07.24 Meta Added SBUV in version 8 bufr format; +# Update merra conventional types for realtime processing +# 2012.05.30 Todling - Add temporary locations for ATM, CrIS, and SatWnd +# 2012.12.03 Wargan/Guo - Add MLS/OMI entries in BUFR and text data. +# 2013.01.15 Guo - Add aura_omieff_bufr entry +# 2013.01.18 Wargan/Guo - replaced aura_omieff_text with aura_omieff_nc +# 2013.08.15 Wargan Added mls_nc (for near real time MLS) +# 2013.09.28 Todling Remove reference to all ods/oms files (so-called validation obs) +# 2013.11.06 Todling Rename all pre-qc merra classes for consistency w/ tag (fvsetup) +# 2013.12.04 Sienkiewicz Change SBUV class names to be consistent with NAS obsys.rc and with OPS +# - old V6 format now ncep_osbuv8_6_bufr +# - current V8 format now ncep_osbuv_bufr +# 2015.05.06 McCarty Add entry for ISS-RapidScat +# 2015.06.16 Wargn Add entry for OMPS-LP +# 2015.07.28 Sienkiewicz End date for ncep_sptrmm_bufr +# 2017.07.06 RT/for/Sienkiewicz Add ncep_acftpfl_bufr +# 2020.02.13 RT/for/JJin Add gmao_amsr2_bufr +# +#+BEGIN obclass data set description +#+ upabufr_val: NCEP Upper Air BUFR +#+ upabufr_llk: NCEP Upper Air BUFR (Late Look) +#+ ncep_osbuv_bufr: NCEP SBUV Data in bufr format +#+ gmao_osbuv_bufr: GMAO SBUV Data in bufr format +#+ ncep_spssmi_bufr: NCEP SSMI Data in bufr format +#+ ncep_sptrmm_bufr: NCEP TRMM Data in bufr format +#+ ncep_1bamua_bufr: NCEP Satellite AMSUA Data (bufr) +#+ ncep_1bamub_bufr: NCEP Satellite AMSUB Data (bufr) +#+ ncep_1bhrs2_bufr: NCEP Satellite HIRS2 Data (bufr) +#+ ncep_1bhrs3_bufr: NCEP Satellite HIRS3 Data (bufr) +#+ ncep_1bmsu_bufr: NCEP Satellite MSU Data (bufr) +#+ ncep_ssmit_bufr: NCEP Satellite SSM/I Data (bufr) +#+ ncep_prep_bufr: NCEP Conventional Data in bufr format (ops) +#+ gmao_airs_bufr: GMAO Version of NESDIS AMSU-A AIRS +#+ ncep_tcvitals: NCEP Vital files for Tropical Storms +#+ ncep_mls_bufr: NCEP MLS +#+ ncep_1bhrs4_bufr: NCEP Satellite HIRS4 Data (bufr) +#+ ncep_aura_omi_bufr: OMI Ozone from AURA in BUFR +#+ merra_ers1: ERS-1 scatterometer for MERRA +#+ merra_ers2: ERS-2 scatterometer for MERRA +#+ merra_wspd_bufr: MERRA Wentz Speeds +#+ merra_gprofp13_bufr: MERRA GPROF F13 Precip +#+ merra_gprofp14_bufr: MERRA GPROF F14 Precip +#+ merra_tmi2l_bufr: MERRA TRMM Land Precip (full resol.) +#+ merra_tmi2o_bufr: MERRA TRMM Ocean Precip (full resol.) +#+ merra_tmil_bufr: MERRA TRMM Land Precip +#+ merra_tmio_bufr: MERRA TRMM Ocean Precip +#+ merra_1bamua_bufr: MERRA - Satellite AMSUA Data (bufr) +#+ merra_1bamub_bufr: MERRA - Satellite AMSUB Data (bufr) +#+ merra_1bhrs2_bufr: MERRA - Satellite HIRS2 Data (bufr) +#+ merra_1bhrs3_bufr: MERRA - Satellite HIRS3 Data (bufr) +#+ merra_1bmsu_bufr: MERRA - Satellite MSU Data (bufr) +#+ merra_1bssu_bufr: MERRA - Satellite SSU Data (bufr) +#+ merra_wssmi_bufr: MERRA - Superobbed Wentz SSM/I Rain Rate +#+ merra_ssmit08_bufr: MERRA - F08 Wentz SSM/I brightness temperatures +#+ merra_ssmit10_bufr: MERRA - F10 Wentz SSM/I brightness temperatures +#+ merra_ssmit11_bufr: MERRA - F11 Wentz SSM/I brightness temperatures +#+ merra_ssmit13_bufr: MERRA - F13 Wentz SSM/I brightness temperatures +#+ merra_ssmit14_bufr: MERRA - F14 Wentz SSM/I brightness temperatures +#+ merra_ssmit15_bufr: MERRA - F15 Wentz SSM/I brightness temperatures +#+ merra_nmodis_prep_bufr: MERRA - NESDIS MODIS winds +#+ merra_prof_prep_bufr: MERRA - Profilers +#+ merra_cdas_prep_bufr: NCEP Conventional Data in bufr format (ops) +#+ merra_qscat_jpl: QuickScat from JPL +#+ merra_sbuv_prep_bufr: SBUV Version 8 +#+ merra_airs_bufr: MERRA Version of NESDIS AMSU-A AIRS +#+ merra_sfcland_prep_bufr: MERRA Surf Land Conv Obs +#+ merra_upa_prep_bufr: MERRA Upper-Air Conv Obs +#+ merra_acars_prep_bufr: MERRA ACARS Conv Obs +#+ merra_aircft_prep_bufr: MERRA AirCraft Conv Obs +#+ merra_satwnd_prep_bufr: MERRA Sat Winds Conv Obs +#+ merra_sfcship_prep_bufr: MERRA Ship Conv Obs +#+ merra_sfcbog_prep_bufr: MERRA Boggus Obs +#+ aura_mlsoz_bufr: MLS standard (not near-realtime) Ozone from AURA in BUFR ("o3lev") +#+ aura_mlsoz_text: MLS standard (not near-realtime) Ozone from AURA in text ("o3lev") +#+ aura_mlst_bufr: EOSMLSt level 2b temperature from AURA in BUFR +#+ gmao_mlst_bufr: EOSMLSt level 2b temperature from AURA in BUFR, the same as aura_mlst_bufr +#+ aura_omieff_bufr: OMI Ozone from AURA with efficiency factors in BUFR ("omieff") +#+ aura_omieff_nc: OMI Ozone from AURA with efficiency factors in NetCDF ("omieff") +#+ nim07_tomseff_nc: Ozone from NIMBUS-07 TOMS in NetCDF ("tomseff") +#+ ep_tomseff_nc: Ozone from Earth-Probe TOMS in NetCDF ("tomseff") +#+ rscat_bufr: RapidScat sfc winds from instrument onboard ISS +#+ ompslp_nc: Ozone from OMPS-Limb Profiler ("ompslp") +#+ npp_ompsnm_bufr: Ozone from OMPS ("ompsnm") +#+ npp_ompsnp_bufr: Ozone from OMPS ("ompspm") +#+ ncep_acftpfl_bufr: Metadata for GSI Aircraft Bias Correction +#+ ncep_cris_bufr: CrIS NPP +#+ ncep_crisfsr_bufr: CrIS NOAA-20 +#+ gmao_amsr2_bufr: AMSR2 +#+END +# + +# Upper-air BUFR from NCEP (UPABFR) +# --------------------------------- +#BEGIN upabufr_val => obsys.upabufr.obs.%y4%m2%d2%h2z.bfr +# 19971214_00z-19980201_18z 060000 /archive/input/dao_it/val/default/conv+tovs/bufr/upa/Y%y4/M%m2/upa%y4%m2%d2.%h2z.bufr_d +# 19980601_00z-19980801_18z 060000 /archive/input/dao_it/val/default/conv+tovs/bufr/upa/Y%y4/M%m2/upa%y4%m2%d2.%h2z.bufr_d +#END + +BEGIN upabufr_llk => obsys.upabufr.obs.%y4%m2%d2%h2z.bfr + 19991218_00z-19991219_18z 060000 /archive/input/dao_ops/obs/llk/conv+tovs/bufr/upa/Y%y4/M%m2/upa%y4%m2%d2.%h2z.bufr_d + 19991226_00z-20000507_18z 060000 /archive/input/dao_ops/obs/llk/conv+tovs/bufr/upa/Y%y4/M%m2/upa%y4%m2%d2.%h2z.bufr_d + 20000508_00z-20050513_18z 060000 /archive/input/dao_ops/obs/llk/conv+tovs/bufr/upa/Y%y4/M%m2/upa%y4%m2%d2.arc.%h2z.bufr_d +# 20010101_00z-21001231_18z 060000 /archive/input/dao_ops/obs/llk/conv+tovs/bufr/upa/Y%y4/M%m2/upa%y4%m2%d2.arc.%h2z.bufr_d +END + +# GMAO reprocessed SBUV OZ (SBUV-8) +# --------------------------------- +BEGIN gmao_osbuv8_bufr => gdas1.%y4%m2%d2.t%h2z.osbuv.tm00.bufr_d.ublk + 19781031_00z-20111231_18z 060000 /archive/input/gmao_ops/ops/merra/sbuv8r6/bufr/Y%y4/M%m2/gmao.sbuv8r6.%y4%m2%d2.%h2z.bufr +END + +# NCEP unconventional observational data +# --------------------------------------- +BEGIN ncep_osbuv8_6_bufr => gdas1.%y4%m2%d2.t%h2z.osbuv.tm00.bufr_d.ublk +# 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.osbuv.tm00.bufr_d +# 20040615_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv.tm00.bufr_d +# Use merra_sbuv_prep_bufr prior to 20071001 + 20071001_00z-20080204_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv.tm00.bufr_d + 20080205_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8_6.tm00.bufr_d +# 20071215_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8_6.tm00.bufr_d +END +BEGIN ncep_osbuv_bufr => gdas1.%y4%m2%d2.t%h2z.osbuv.tm00.bufr_d.ublk + 20071215_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8.tm00.bufr_d +# 20080205_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8.tm00.bufr_d +END +BEGIN ncep_spssmi_bufr => gdas1.%y4%m2%d2.t%h2z.spssmi.tm00.bufr_d.ublk +# 20040416_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ssmi_nesdis/bufr/wind/Y%y4/M%m2/smi%y2%m2%d2.%h2z.bufr_d +# Use merra_gprofpXX for precip data prior to 20060401. + 20060401_00z-20091119_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SPSSMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.spssmi.tm00.bufr_d +END +BEGIN ncep_ssmis_bufr => gdas1.%y2%m2%d2.t%h2z.ssmisu.tm00.bufr_d.ublk + 20110228_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_gps/bufr/SSMISU/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.ssmisu.tm00.bufr_d +# 20110228_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SSMISU/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.ssmisu.tm00.bufr_d +END +BEGIN ncep_sptrmm_bufr => gdas1.%y4%m2%d2.t%h2z.sptrmm.tm00.bufr_d.ublk +# 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.sptrmm.tm00.bufr_d +# 20040714_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/TRMM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.sptrmm.tm00.bufr_d +# Use merra_tmio_bufr & merra_tmil_bufr prior to 20060101 + 20060101_00z-20150114_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/TRMM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.sptrmm.tm00.bufr_d +END + +# NCEP Operational (satellite) data +# --------------------------------- +BEGIN ncep_1bamua_bufr => gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d.ublk + 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.1bamua.tm00.bufr_d + 20041001_00z-20041017_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d + 20041019_00z-20041031_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d + 20050201_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d +# 20040615_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d +END +BEGIN ncep_1bamub_bufr => gdas1.%y2%m2%d2.t%h2z.1bamub.tm00.bufr_d.ublk + 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.1bamub.tm00.bufr_d + 20050201_00z-20140606_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUB/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamub.tm00.bufr_d +# 20040615_00z-20140606_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUB/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamub.tm00.bufr_d +END +BEGIN ncep_1bhrs2_bufr => gdas1.%y2%m2%d2.t%h2z.1bhrs2.tm00.bufr_d.ublk + 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.1bhrs2.tm00.bufr_d + 20050201_00z-20060926_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/HIRS2/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs2.tm00.bufr_d +# 20040615_00z-20060926_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/HIRS2/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs2.tm00.bufr_d +END +BEGIN ncep_1bhrs3_bufr => gdas1.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr_d.ublk + 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.1bhrs3.tm00.bufr_d + 20050201_00z-20140606_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/HIRS3/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr_d +# 20040615_00z-20140606_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/HIRS3/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr_d +END +BEGIN ncep_1bmsu_bufr => gdas1.%y2%m2%d2.t%h2z.1bmsu.tm00.bufr_d.ublk + 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.1bmsu.tm00.bufr_d + 20050201_00z-20060926_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/MSU/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmsu.tm00.bufr_d +END +BEGIN ncep_ssmit_bufr => gdas1.%y2%m2%d2.t%h2z.ssmitbufr.tm00.bufr_d.ublk +# 20060216_12z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SSMIT/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.ssmit.tm00.bufr_d +# data available from 20060216, but we only use from 20060726 when merra_smmit ends. + 20060726_00z-20091119_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SSMIT/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.ssmit.tm00.bufr_d +END + +# NCEP Prep-bufr conventional data +# ------------------------------- +BEGIN ncep_prep_bufr => gdas1.%y4%m2%d2.t%h2z.prepbufr.ublk +# 20020307_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/PREPBUFR/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.prepbufr +# data available from 2002, but we only use from 2006 after merra data ends. + 20060101_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/PREPBUFR/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.prepbufr +# 20050301_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/PREPBUFR/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.prepbufr +END +# NESDIS/GMAO AIRS/AMSU-A data +# ---------------------------- +BEGIN gmao_airs_bufr => gmaoairs.%y4%m2%d2.t%h2z.bufr.ublk +# 20021216_00z-20040428_18z 060000 /archive/input/dao_ops/obs/merra/airs/bufr/Y%y4/M%m2/airs.%y4%m2%d2.t%h2z.bufr +# 20040429_00z-20040723_18z 060000 /archive/input/dao_ops/ops/merra/airs_ncep/bufr/Y%y4/M%m2/gdas1.d%y4%m2%d2.t%h2z.airs.tm00.bufr_d +# 20040724_00z-21001231_18z 060000 /archive/input/dao_ops/obs/merra/airs/bufr/Y%y4/M%m2/airs.%y4%m2%d2.t%h2z.bufr +# Prior to 20060907, use merra_airs_bufr. + 20060907_00z-20070903_18z 060000 /archive/input/dao_ops/ops/flk/airs/bufr/C0300/Y%y4/M%m2/airs.%y4%m2%d2.t%h2z.bufr + 20070904_00z-20070904_18z 060000 /archive/input/dao_ops/ops/flk/airs/bufr/C0300/Y%y4/M%m2/airs_fix.%y4%m2%d2.t%h2z.bufr + 20070905_00z-20130903_00z 060000 /archive/input/dao_ops/ops/flk/airs/bufr/C0300/Y%y4/M%m2/airs.%y4%m2%d2.t%h2z.bufr +END + +############################################################################################################### +############################################################################################################### +# Modern Era Reanalysis Observing System +############################################################################################################### +############################################################################################################### + +# MERRA ERS-1 Scatterometer +# -------------------------- +BEGIN merra_ers1_pre-qc => obsys.ers1.pre-qc.%y4%m2%d2.t%h2z.ublk + 19910805_00z-19911022_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19911024_00z-19911103_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19911105_00z-19911209_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19911212_00z-19911213_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19911222_00z-19920108_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19920110_00z-19920112_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19920120_00z-19920201_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19920301_00z-19920331_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19920414_00z-19920625_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19920629_00z-19920719_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19920724_00z-19920902_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19920904_00z-19940101_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19940103_00z-19940131_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19940406_00z-19940426_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr + 19940428_00z-19960525_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr +END + +# Satellite Observational Data for MERRA +# --------------------------------------- +BEGIN merra_1bamua_bufr => gmao.%y2%m2%d2.t%h2z.1bamua.tm00.bufr.ublk + 19981102_00z-20170429_18z 060000 /archive/input/dao_ops/obs/merra/tovs/AMSUA/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.1bamua.tm00.bufr +END +BEGIN merra_1bamub_bufr => gmao.%y2%m2%d2.t%h2z.1bamub.tm00.bufr.ublk + 19981102_00z-20140606_18z 060000 /archive/input/dao_ops/obs/merra/tovs/AMSUB/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.1bamub.tm00.bufr +END +BEGIN merra_1bhrs2_bufr => gmao.%y2%m2%d2.t%h2z.1bhrs2.tm00.bufr.ublk + 19781101_00z-20060930_18z 060000 /archive/input/dao_ops/obs/merra/tovs/HIRS2/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.1bhrs2.tm00.bufr +END +BEGIN merra_1bhrs3_bufr => gmao.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr.ublk + 19980721_00z-20140606_18z 060000 /archive/input/dao_ops/obs/merra/tovs/HIRS3/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr +END +BEGIN merra_1bmsu_bufr => gmao.%y2%m2%d2.t%h2z.1bmsu.tm00.bufr.ublk + 19781101_00z-19861031_18z 060000 /archive/input/dao_ops/obs/merra/tovs/MSU/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.1bmsu.tm00.bufr + 19861101_00z-20061010_18z 060000 /archive/input/dao_ops/obs/merra/tovs/MSU_RECALIBRATED/Y%y4/M%m2/ncep.%y2%m2%d2.t%h2z.1bmsu.tm00.bufr +END +BEGIN merra_1bssu_bufr => gmao.%y2%m2%d2.t%h2z.1bssu.tm00.bufr.ublk + 19781101_00z-20060505_18z 060000 /archive/input/dao_ops/obs/merra/tovs/SSU/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.1bssu.tm00.bufr +END +BEGIN merra_ssmit08_bufr => wentz.ssmit08.%y4%m2%d2%h2.bfr.ublk + 19870709_00z-19911230_18z 060000 /archive/input/dao_ops/ops/merra/SSMIRad/bufr_v6/F08/Y%y4/M%m2/wssmi.f08.%y4%m2%d2%h2.bfr +END +BEGIN merra_ssmit10_bufr => wentz.ssmit10.%y4%m2%d2%h2.bfr.ublk + 19901208_18z-19971112_18z 060000 /archive/input/dao_ops/ops/merra/SSMIRad/bufr_v6/F10/Y%y4/M%m2/wssmi.f10.%y4%m2%d2%h2.bfr +END +BEGIN merra_ssmit11_bufr => wentz.ssmit11.%y4%m2%d2%h2.bfr.ublk + 19911204_00z-20000515_18z 060000 /archive/input/dao_ops/ops/merra/SSMIRad/bufr_v6/F11/Y%y4/M%m2/wssmi.f11.%y4%m2%d2%h2.bfr +END +BEGIN merra_ssmit13_bufr => wentz.ssmit13.%y4%m2%d2%h2.bfr.ublk + 19950503_18z-20080922_18z 060000 /archive/input/dao_ops/ops/merra/SSMIRad/bufr_v6/F13/Y%y4/M%m2/wssmi.f13.%y4%m2%d2%h2.bfr + 20080923_00z-20091119_00z 060000 /archive/input/dao_ops/ops/llk/ssmirad/bfr/F13/Y%y4/M%m2/ssmirad.f13.%y4%m2%d2%h2.bfr +END +BEGIN merra_ssmit14_bufr => wentz.ssmit14.%y4%m2%d2%h2.bfr.ublk + 19970508_00z-20080731_18z 060000 /archive/input/dao_ops/ops/merra/SSMIRad/bufr_v6/F14/Y%y4/M%m2/wssmi.f14.%y4%m2%d2%h2.bfr + 20080801_00z-20080823_18z 060000 /archive/input/dao_ops/ops/llk/ssmirad/bfr/F14/Y%y4/M%m2/ssmirad.f14.%y4%m2%d2%h2.bfr +END +BEGIN merra_ssmit15_bufr => wentz.ssmit15.%y4%m2%d2%h2.bfr.ublk + 19991218_00z-20080731_18z 060000 /archive/input/dao_ops/ops/merra/SSMIRad/bufr_v6/F15/Y%y4/M%m2/wssmi.f15.%y4%m2%d2%h2.bfr + 20080801_00z-20140929_18z 060000 /archive/input/dao_ops/ops/llk/ssmirad/bfr/F15/Y%y4/M%m2/ssmirad.f15.%y4%m2%d2%h2.bfr +END + +# Superobbed SSM/I rain rate +# -------------------------- +#BEGIN merra_wssmi_bufr => wentz_rr.spssmi.%y4%m2%d2.%h2z.bfr.ublk +# 19870701_00z-20041231_18z 060000 /archive/input/dao_ops/ops/merra/ssmi_rain/prepbufr/Y%y4/M%m2/wentz_rr.%y4%m2%d2.%h2z.bfr +#END + +# NCEP Pre-bufr conventional data +# ------------------------------- +BEGIN merra_cdas_pre-qc_bufr => cdas.%y4%m2%d2.t%h2z.pre-qc.ublk + 20010101_00z-20040915_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 + 20040916_00z-20040916_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_gaps_filled_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 + 20040917_00z-20050624_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 + 20050625_00z-20050625_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_gaps_filled_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 + 20050626_00z-20050714_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 + 20050715_00z-20050721_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_gaps_filled_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 + 20050722_00z-20051231_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 + 20060101_00z-20081231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/runha/Y%y4/M%m2/prepbufr.gdas_red.%y4%m2%d2%h2 + 20090101_00z-21001231_18z 060000 /archive/input/dao_ops/ops/llk/conv/prepbufr/runha/Y%y4/M%m2/reanalysis.prepbufr.gdas_red.%y4%m2%d2%h2 +END +# +BEGIN merra_goesnd_prep_bufr => goesnd.%y4%m2%d2.t%h2z.ublk + 20010424_00z-20011231_18z 060000 /archive/input/dao_ops/ops/merra/GOES_sounder/prepbufr/Y%y4/M%m2/goesnd.d%y4%m2%d2.t%h2z.bfr + 20020101_00z-20020306_18z 060000 /archive/input/dao_ops/ops/merra/GOES_sounder/prepbufr/Y%y4/M%m2/goesnd.%y4%m2%d2.%h2z.bfr + 20020306_00z-20040429_18z 060000 /archive/input/dao_ops/ops/merra/GOES_sounder/prepbufr/Y%y4/M%m2/goesnd.d%y4%m2%d2.t%h2z.bfr + 20040601_00z-20051231_18z 060000 /archive/input/dao_ops/ops/merra/GOES_sounder/prepbufr/Y%y4/M%m2/goesnd.d%y4%m2%d2.t%h2z.bfr +END +# +BEGIN merra_nmodis_pre-qc_bufr => modis.%y4%m2%d2.t%h2z.pre-qc.ublk +# 20040623_00z-20051231_18z 060000 /archive/input/dao_ops/ops/merra/modisw/prepbufr/Y%y4/M%m2/modisw.%y4%m2%d2.t%h2z.bfr + 20020701_00z-20040708_18z 060000 /archive/input/dao_ops/ops/merra/modisw_combined_runh/prepbufr/Y%y4/M%m2/modisw_c.%y4%m2%d2.t%h2z.bfr + 20040709_00z-20040930_18z 060000 /archive/input/dao_ops/ops/merra/modisw_runh/prepbufr/Y%y4/M%m2/modisw.%y4%m2%d2.t%h2z.bfr +END +# +BEGIN merra_prof_pre-qc_bufr => prof.%y4%m2%d2.t%h2z.pre-qc.ublk + 19920510_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/profiler/prepbfr/Y%y4/M%m2/profil.%y4%m2%d2.%h2.bfr + 20010101_00z-20080731_18z 060000 /archive/input/dao_ops/ops/merra/profiler_runh/prepbfr/Y%y4/M%m2/profil.%y4%m2%d2.%h2.bfr +END +# +BEGIN ncep_tcvitals => tcvitals.%y4%m2%d2%h2 + 20040101_00z-20041231_18z 060000 /archive/input/dao_ops/ops/merra/tcvitals/txt/Y%y4/M%m2/syndat_tcvitals.%y4%m2%d2.t%h2z.txt + 20060401_00z-21001231_18z 060000 /archive/input/dao_ops/obs/flk/tcvitals/text/TCVITALS/Y%y4/M%m2/gfs.%y2%m2%d2.t%h2z.syndata.tcvitals +# 20060217_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/tcvitals/text/TCVITALS/Y%y4/M%m2/gfs.%y2%m2%d2.t%h2z.syndata.tcvitals +END + +# MERRA ERS-2 Scatterometer +# ------------------------- +BEGIN merra_ers2_pre-qc => obsys.ers2.pre-qc.%y4%m2%d2.t%h2z.ublk + 19970925_00z-19980603_12z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr + 19980606_18z-19990307_00z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr + 19990309_06z-19991231_12z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr + 20000102_18z-20000207_06z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr + 20000210_18z-20000630_06z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr + 20000705_18z-20001007_18z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr + 20001010_18z-20001231_18z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr + 20010101_00z-20010117_18z 060000 /archive/input/dao_ops/obs/merra/ers2_runh/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr +END + +# MERRA SSMI Wentz Speed +# ---------------------- +BEGIN merra_wspd_bufr => wentzspd.%y4%m2%d2.t%h2z.bufr.ublk +#19870709_00z-20060831_18z 060000 /archive/input/dao_ops/obs/merra/ssmi_wind_wentz/prepbufr_v6/Y%y4/M%m2/ssmi_wind.%y4%m2%d2.%h2z.bfr +# even though we have this data into 2006, switch to ncep_prep_bufr on 20060101 when the other conv data switches + 19870709_00z-20071231_18z 060000 /archive/input/dao_ops/obs/merra/ssmi_wind_wentz/prepbufr_v6/Y%y4/M%m2/ssmi_wind.%y4%m2%d2.%h2z.bfr + 20080101_00z-20130802_18z 060000 /archive/input/dao_ops/ops/llk/ssmi_wind_wentz/prepbufr_v6/ssmi_wind_wentz/Y%y4/M%m2/ssmiwnd.%y4%m2%d2.%h2z.bfr +END + +# MERRA GPROF Precipitation +# -------------------------- +BEGIN merra_gprofp08_bufr => gprofp08.%y4%m2%d2.t%h2z.bufr.ublk + 19870709_00z-19900226_18z 060000 /archive/input/dao_ops/obs/merra/gprof/bufr/Y%y4/M%m2/gprof.F08.%y4%m2%d2.%h2z.bufr +END +BEGIN merra_gprofp10_bufr => gprofp10.%y4%m2%d2.t%h2z.bufr.ublk + 19910105_00z-19971115_18z 060000 /archive/input/dao_ops/obs/merra/gprof/bufr/Y%y4/M%m2/gprof.F10.%y4%m2%d2.%h2z.bufr +END +BEGIN merra_gprofp11_bufr => gprofp11.%y4%m2%d2.t%h2z.bufr.ublk + 19920101_00z-19961130_18z 060000 /archive/input/dao_ops/obs/merra/gprof/bufr/Y%y4/M%m2/gprof.F11.%y4%m2%d2.%h2z.bufr +END +BEGIN merra_gprofp13_bufr => gprofp13.%y4%m2%d2.t%h2z.bufr.ublk + 19950503_00z-20060331_18z 060000 /archive/input/dao_ops/obs/merra/gprof/bufr/Y%y4/M%m2/gprof.F13.%y4%m2%d2.%h2z.bufr +END +BEGIN merra_gprofp14_bufr => gprofp14.%y4%m2%d2.t%h2z.bufr.ublk + 19970508_00z-20060331_18z 060000 /archive/input/dao_ops/obs/merra/gprof/bufr/Y%y4/M%m2/gprof.F14.%y4%m2%d2.%h2z.bufr +END +#BEGIN merra_gprofp15_bufr => gprofp15.%y4%m2%d2.t%h2z.bufr.ublk +# 00000000_00z-00000000_00z 060000 /archive/input/dao_ops/obs/merra/gprof/bufr/Y%y4/M%m2/gprof.F15.%y4%m2%d2.%h2z.bufr +#END + +#BEGIN merra_tmi2l_bufr => tmi2l.%y4%m2%d2.%h2z.bufr.ublk +# 00000000_00z-00000000_00z 060000 /archive/input/dao_ops/obs/merra/trmm/bufr/Y%y4/M%m2/tmi2.land.%y4%m2%d2.%h2z.bufr +#END +#BEGIN merra_tmi2o_bufr => tmi2o.%y4%m2%d2.%h2z.bufr.ublk +# 00000000_00z-00000000_00z 060000 /archive/input/dao_ops/obs/merra/trmm/bufr/Y%y4/M%m2/tmi2.ocean.%y4%m2%d2.%h2z.bufr +#END + +# MERRA reduced-resolution TRMM TMI +#---------------------------------- +BEGIN merra_tmil_bufr => tmil.%y4%m2%d2.%h2z.bufr.ublk + 19980101_00z-20051231_18z 060000 /archive/input/dao_ops/obs/merra/trmm/bufr/Y%y4/M%m2/tmi.land.%y4%m2%d2.%h2z.bufr +END +BEGIN merra_tmio_bufr => tmio.%y4%m2%d2.%h2z.bufr.ublk + 19980101_00z-20051231_18z 060000 /archive/input/dao_ops/obs/merra/trmm/bufr/Y%y4/M%m2/tmi.ocean.%y4%m2%d2.%h2z.bufr +END + +# MERRA Quick SCAT Data (ms - added 2003,2004) +# --------------- +BEGIN merra_qscat_jpl_pre-qc => obsys.qscat.pre-qc.%y4%m2%d2.t%h2z.ublk + 19990719_00z-19991117_18z 060000 /archive/input/dao_ops/obs/merra/qscat/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr + 19991119_00z-20000101_18z 060000 /archive/input/dao_ops/obs/merra/qscat/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr + 20000103_00z-20001116_18z 060000 /archive/input/dao_ops/obs/merra/qscat/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr + 20001118_00z-20001231_18z 060000 /archive/input/dao_ops/obs/merra/qscat/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr + 20010101_00z-20010511_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr + 20010514_00z-20010707_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr + 20010709_00z-20011117_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr + 20011119_00z-20020319_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr + 20020321_00z-20021118_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr + 20021120_00z-20021231_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr + 20030101_00z-20030519_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr + 20030520_00z-20031231_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr + 20040101_00z-20081029_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr + 20081030_00z-20091122_18z 060000 /archive/input/dao_ops/ops/llk/jplqscat/bfr/jplqscat/Y%y4/M%m2/jplqscat.%y4%m2%d2%h2.bfr +END + +# MERRA SBUV-8 +# ------------ +BEGIN merra_sbuv_prep_bufr => gmao.sbuv8.%y4%m2%d2.%h2z.bufr.ublk + 19781101_00z-19891231_18z 060000 /archive/input/dao_ops/ops/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n07.%y4%m2%d2.%h2z.bufr + 19900101_00z-19950228_18z 060000 /archive/input/dao_ops/ops/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n11.%y4%m2%d2.%h2z.bufr + 19950301_00z-19970630_18z 060000 /archive/input/dao_ops/ops/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n09.%y4%m2%d2.%h2z.bufr + 19970701_00z-20001231_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n11.%y4%m2%d2.%h2z.bufr +# 20010101_00z-20010127_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16.%y4%m2%d2.%h2z.bufr + 20010101_00z-20010127_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16_p1d.%y4%m2%d2.%h2z.bufr + 20010128_00z-20010129_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n11.%y4%m2%d2.%h2z.bufr +# 20010130_00z-20010216_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16.%y4%m2%d2.%h2z.bufr + 20010130_00z-20010216_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16_p1d.%y4%m2%d2.%h2z.bufr + 20010217_00z-20010218_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n11.%y4%m2%d2.%h2z.bufr +# 20010219_00z-20021116_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16.%y4%m2%d2.%h2z.bufr + 20010219_00z-20021116_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16_p1d.%y4%m2%d2.%h2z.bufr + 20021117_00z-20021118_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n17.%y4%m2%d2.%h2z.bufr +# 20021119_00z-20030725_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16.%y4%m2%d2.%h2z.bufr + 20021119_00z-20030725_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16_p1d.%y4%m2%d2.%h2z.bufr + 20030726_00z-20030727_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n17.%y4%m2%d2.%h2z.bufr +# 20030728_00z-20051231_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16.%y4%m2%d2.%h2z.bufr + 20030728_00z-20051231_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16_p1d.%y4%m2%d2.%h2z.bufr + 20060101_00z-20070930_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n17.%y4%m2%d2.%h2z.bufr +END + +BEGIN merra_airs_bufr => airs.%y4%m2%d2.t%h2z.bufr.ublk + 20021216_00z-20040428_18z 060000 /archive/input/dao_ops/obs/merra/airs/bufr/Y%y4/M%m2/airs.%y4%m2%d2.t%h2z.bufr + 20040429_00z-20040723_18z 060000 /archive/input/dao_ops/ops/merra/airs_ncep/bufr/Y%y4/M%m2/gdas1.d%y4%m2%d2.t%h2z.airs.tm00.bufr_d + 20040724_00z-20060906_18z 060000 /archive/input/dao_ops/obs/merra/airs/bufr/Y%y4/M%m2/airs.%y4%m2%d2.t%h2z.bufr +END + +BEGIN ncep_mhs_bufr => gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d.ublk + 20081021_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d +# 20081021_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d +END + +BEGIN ncep_1bhrs4_bufr => gdas1.%y2%m2%d2.t%h2z.1bhrs4.tm00.bufr_d.ublk + 20090129_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BHRS4/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs4.tm00.bufr_d +# 20090129_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BHRS4/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs4.tm00.bufr_d +END + +BEGIN ncep_airs_bufr => gdas1.%y2%m2%d2.t%h2z.airsev.tm00.bufr_d.ublk + 20081007_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/AIRS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.airsev.tm00.bufr_d +END + +BEGIN ncep_amsre_bufr => gdas1.%y2%m2%d2.t%h2z.amsre.tm00.bufr_d.ublk + 20090129_00z-20111006_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSRE/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.amsre.tm00.bufr_d +END + +BEGIN ncep_geoimr_bufr => gdas1.%y2%m2%d2.t%h2z.geoimr.tm00.bufr_d.ublk + 20080904_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/GEOIMR/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.geoimr.tm00.bufr_d +END + +BEGIN ncep_goesfv_bufr => gdas1.%y2%m2%d2.t%h2z.goesfv.tm00.bufr_d.ublk + 20070222_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/GOESFV/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.goesfv.tm00.bufr_d +# 20080904_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/GOESFV/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.goesfv.tm00.bufr_d +END + +BEGIN ncep_gome_bufr => gdas1.%y2%m2%d2.t%h2z.gome.tm00.bufr_d.ublk + 20090129_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/GOME/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gome.tm00.bufr_d +END + +BEGIN ncep_gpsipw_bufr => gdas1.%y2%m2%d2.t%h2z.gpsipw.tm00.bufr_d.ublk + 20080811_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/GPSIPW/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gpsipw.tm00.bufr_d +END + +BEGIN ncep_gpsro_bufr => gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d.ublk + 20080811_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/GPSRO/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d +# 20080811_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/GPSRO/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d +END + +BEGIN ncep_mtiasi_bufr => gdas1.%y2%m2%d2.t%h2z.mtiasi.tm00.bufr_d.ublk + 20090129_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/MTIASI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.mtiasi.tm00.bufr_d +# 20090129_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/MTIASI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.mtiasi.tm00.bufr_d +END + +BEGIN ncep_atms_bufr => gdas1.%y4%m2%d2.t%h2z.atms.tm00.bufr_d.ublk + 20120213_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/ATMS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.atms.tm00.bufr_d +# 20111116_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/ATMS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.atms.tm00.bufr_d +END +BEGIN ncep_cris_bufr => gdas1.%y4%m2%d2.t%h2z.cris.tm00.bufr_d.ublk + 20120107_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/CRIS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.cris.tm00.bufr_d +# 20120107_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/CRIS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.cris.tm00.bufr_d +END +BEGIN ncep_crisfsr_bufr => gdas1.%y4%m2%d2.t%h2z.crisfsr.tm00.bufr_d.ublk + 20171020_00z-20180930_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/CRISF4/Y%y4/M%m2/crisf4.gdas.%y4%m2%d2%h2 + 20181001_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/CRISF4/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.crisf4.tm00.bufr_d +# 20171020_00z-20180930_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/crisf4/bufr/CRISF4/Y%y4/M%m2/crisf4.gdas.%y4%m2%d2%h2 +# 20181001_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/crisf4/bufr/CRISF4/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.crisf4.tm00.bufr_d +END +BEGIN ncep_satwnd_bufr => gdas1.%y4%m2%d2.t%h2z.satwnd.tm00.bufr_d.ublk + 20100701_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/SATWND/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.satwnd.tm00.bufr_d +# 20120201_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SATWND/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.satwnd.tm00.bufr_d +END +BEGIN ncep_sevcsr_bufr => gdas1.%y4%m2%d2.t%h2z.sevcsr.tm00.bufr_d.ublk + 20120502_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SEVCSR/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.sevcsr.tm00.bufr_d +# 20111116_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SEVCSR/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.sevcsr.tm00.bufr_d +END +BEGIN ncep_avcsam_bufr => gdas1.%y2%m2%d2.t%h2z.avcsam.tm00.bufr_d.ublk + 20120207_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/AVCSAM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcsam.tm00.bufr_d +# 20120207_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AVCSAM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcsam.tm00.bufr_d +END +BEGIN ncep_avcspm_bufr => gdas1.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d.ublk + 20120207_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/AVCSPM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d +# 20120207_00z-20140731_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AVCSPM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d +# 20140801_00z-20160226_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AVCSPM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d +# 20160228_06z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AVCSPM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d +END +BEGIN ncep_mls_bufr => gdas1.%y2%m2%d2.t%h2z.mls.tm00.bufr_d.ublk + 20120502_00z-20170201_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/MLS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.mls.tm00.bufr_d +END +BEGIN ncep_aura_omi_bufr => gdas1.%y4%m2%d2.t%h2z.omi.tm00.bufr_d.ublk +# 20120201_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/OMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.omi.tm00.bufr_d + 20091212_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/OMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.omi.tm00.bufr_d +END + + +# New Aqua data from DISC NRT server +#----------------------------------- +BEGIN disc_airs_bufr => airs.%y4%m2%d2.t%h2z.bufr + 20100801_00z-20100818_18z 060000 /archive/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airs_disc.%y4%m2%d2.t%h2z.bufr + 20100819_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr +# 20100819_00z-20131001_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr +# 20131002_00z-20131011_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airs_disc_final.%y4%m2%d2.t%h2z.bufr +# 20131012_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr +END +BEGIN disc_amsua_bufr => eos_amsua.%y4%m2%d2.t%h2z.bufr + 20100801_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr +# 20100815_00z-20131001_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr +# 20131002_00z-20131011_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc_final.%y4%m2%d2.t%h2z.bufr +# 20131012_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr +END + +# MERRA CONV OBS (IN PIECES) +# ------------------------- +BEGIN merra_sfcland_pre-qc_bufr => adpsfc.%y4%m2%d2.t%h2z.pre-qc.ublk + 19480101_00z-19971231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/adpsfc/Y%y4/M%m2/MERG_ADPSFC_prepbufr_%y4%m2%d2%h2 + 19980101_00z-19991231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/adpsfc_gaps_filled_plus_METAR/Y%y4/M%m2/MERG_ADPSFC_prepbufr_%y4%m2%d2%h2 + 20000101_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/adpsfc/Y%y4/M%m2/MERG_ADPSFC_prepbufr_%y4%m2%d2%h2 +END + +BEGIN merra_upa_pre-qc_bufr => adpupa.%y4%m2%d2.t%h2z.pre-qc.ublk + 19700101_00z-19721231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/adpupa/Y%y4/M%m2/MERG_ADPUPA_prepbufr_%y4%m2%d2%h2 + 19730101_00z-19841231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/adpupa_with_stationID/Y%y4/M%m2/MERG_ADPUPA_prepbufr_%y4%m2%d2%h2 + 19850101_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/adpupa_fixvai/Y%y4/M%m2/MERG_ADPUPA_prepbufr_%y4%m2%d2%h2 +END + +BEGIN merra_acars_pre-qc_bufr => aircar.%y4%m2%d2.t%h2z.pre-qc.ublk + 19910417_06z-19970531_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 + 19970601_00z-19970831_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar_gaps_filled/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 + 19970901_00z-19980930_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 + 19981001_00z-19981031_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar_gaps_filled/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 + 19981101_00z-19981231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 + 19990101_00z-19990131_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar_gaps_filled/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 + 19990201_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 +END + +BEGIN merra_aircft_pre-qc_bufr => aircft.%y4%m2%d2.t%h2z.pre-qc.ublk + 19710101_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircft/Y%y4/M%m2/MERG_AIRCFT_prepbufr_%y4%m2%d2%h2 +END + +BEGIN merra_satwnd_pre-qc_bufr => satwnd.%y4%m2%d2.t%h2z.pre-qc.ublk + 19850912_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/satwnd/Y%y4/M%m2/MERG_SATWND_prepbufr_%y4%m2%d2%h2 +END +BEGIN merra_satwnd00_pre-qc_bufr => satwnd.%y4%m2%d2.t00z.pre-qc.ublk + 19770101_00z-19850911_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/satwnd/Y%y4/M%m2/MERG_SATWND_prepbufr_%y4%m2%d200 +END +BEGIN merra_satwnd12_pre-qc_bufr => satwnd.%y4%m2%d2.t12z.pre-qc.ublk + 19770101_00z-19850911_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/satwnd/Y%y4/M%m2/MERG_SATWND_prepbufr_%y4%m2%d212 +END +BEGIN merra_satwnd18_pre-qc_bufr => satwnd.%y4%m2%d2.t18z.pre-qc.ublk + 19770101_00z-19850911_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/satwnd/Y%y4/M%m2/MERG_SATWND_prepbufr_%y4%m2%d218 +END + +BEGIN merra_sfcship_pre-qc_bufr => sfcshp.%y4%m2%d2.t%h2z.pre-qc.ublk + 19700101_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcshp_gaps_filled/Y%y4/M%m2/COAD_SFCSHP_prepbufr_%y4%m2%d2%h2 +END + +BEGIN merra_sfcbog00_pre-qc_bufr => sfcbog.%y4%m2%d2.t00z.pre-qc.ublk + 19781001_00z-19841231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_no_land/Y%y4/M%m2/REAN_SFCBOG_prepbufr_%y4%m2%d200 + 19850101_00z-19931231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_jaob/Y%y4/M%m2/JAOB_SFCBOG_prepbufr_%y4%m2%d200 + 19940101_00z-19941231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_jaob/Y%y4/M%m2/ER40_SFCBOG_prepbufr_%y4%m2%d200 + 19950101_00z-20001231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_jaob/Y%y4/M%m2/JAOB_SFCBOG_prepbufr_%y4%m2%d200 +END + +BEGIN merra_sfcbog12_pre-qc_bufr => sfcbog.%y4%m2%d2.t12z.pre-qc.ublk + 19781001_00z-19841231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_no_land/Y%y4/M%m2/REAN_SFCBOG_prepbufr_%y4%m2%d212 + 19850101_00z-19931231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_jaob/Y%y4/M%m2/JAOB_SFCBOG_prepbufr_%y4%m2%d212 + 19940101_00z-19941231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_jaob/Y%y4/M%m2/ER40_SFCBOG_prepbufr_%y4%m2%d212 + 19950101_00z-20001231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_jaob/Y%y4/M%m2/JAOB_SFCBOG_prepbufr_%y4%m2%d212 +END + +#MLS ozone BUFR data +#------------------------- +BEGIN aura_mlsoz_bufr => mlsoz.%y4%m2%d2.t%h2z.bufr + 20040813_00z-20040831_18z 060000 /gpfsm/dnb31/jjin3/obs_data/mlso3lev_bufr/Y%y4/M%m2/MLSo3lev.%y4%m2%d2.t%h2z.bufr +END + +#MLS ozone text +#------------------------- +#BEGIN mls12_oenew_text => mlsoz.%y4%m2%d2.t%h2z.txt +# This is an old name for aura_mlsoz_text, for backward reference purpose only. +# 00000000_00z-00000000_00z 060000 /archive/u/kwargan/data/MLSv3.3/aver/Y%y4/M%m2/MLSoz.%y4%m2%d2.t%h2z.txt +#END +#BEGIN aura_mlsoz_text => mlsoz.%y4%m2%d2.t%h2z.txt +# Note the difference between v2.2 and v3.3. +# 00000000_00z-00000000_00z 060000 /archive/u/kwargan/data/MLSv3.3/aver/Y%y4/M%m2/MLSoz.%y4%m2%d2.t%h2z.txt +# 00000000_00z-00000000_00z 060000 /archive/u/kwargan/data/MLSv2.2/txt/aver/Y%y4/M%m2/MLSoz.%y4%m2%d2.t%h2z.txt +#END + +# EOSMLSt level 2b in BUFR +# -------------- +#BEGIN aura_mlst_bufr => MLSt.%y4%m2%d2.t%h2z.bufr +# Note this is the same data as in gmao_mlst_bufr +# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/gmao_mls_bufr/te_v3_bufr/Y%y4/M%m2/MLSt.%y4%m2%d2.t%h2z.ublk +#END +#BEGIN gmao_mlst_bufr => MLSt.%y4%m2%d2.t%h2z +# Note this is the same data as in aura_mlst_bufr +# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/gmao_mls_bufr/te_v3_bufr/Y%y4/M%m2/MLSt.%y4%m2%d2.t%h2z.ublk +#END + +#AURA OMI totoz+eff., NetCDF data +#------------------------- +BEGIN aura_omieff_nc => omieff.%y4%m2%d2.t%h2z.nc + 20041231_18z-20111231_18z 060000 /archive/input/dao_ops/obs/reanalysis/omi_eff/netcdf/Y%y4/M%m2/OMIeff.%y4%m2%d2_%h2z.nc +END + +#Nimbus-07 TOMS +#BEGIN nim07_tomseff_nc => tomseff.%y4%m2%d2.t%h2z.nc +# 00000000_00z-00000000_00z 060000 /archive/u/kwargan/data/TOMS/NETCDF/Y%y4/M%m2/TOMSeff.%y4%m2%d2_%h2z.nc +#END +#Earth-Probe TOMS +#BEGIN ep_tomseff_nc => tomseff.%y4%m2%d2.t%h2z.nc +# 00000000_00z-00000000_00z 060000 /archive/u/kwargan/data/EPTOMS/NETCDF/Y%y4/M%m2/TOMSeff.%y4%m2%d2_%h2z.nc +#END + +# AURA MLS near real time +BEGIN mls_nrt_nc => mlsnc.%y4%m2%d2.t%h2z.nc +# 20140723_00z-20180331_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRToz.%y4%m2%d2_%h2z.nc +# 20180401_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRT-v4.2-oz.%y4%m2%d2_%h2z.nc + 20140723_00z-20140815_18z 060000 /archive/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRToz.%y4%m2%d2_%h2z.nc + 20140818_00z-20180331_18z 060000 /archive/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRToz.%y4%m2%d2_%h2z.nc + 20180401_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRT-v4.2-oz.%y4%m2%d2_%h2z.nc +END + +# TRMM TMI 1B11 brightness temperature +#------------------------- +#BEGIN tmi_bufr => tmi.%y4%m2%d2.t%h2z.bufr +# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/obs_data/tmi/tmi_bufr/Y%y4/M%m2/tmi.%y4%m2%d2.t%h2z.bufr +#END + +# GPM GMI 1B brightness temperature +#------------------------- +#BEGIN gmis1_bufr => gmis1.%y4%m2%d2.t%h2z.bufr +# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/obs_data/gmi/gmi_bufr_data/V01D/1B/Y%y4/M%m2/gmi_nrt_L1B_S1.%y4%m2%d2.t%h2z.bufr +# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/obs_data/gmi/gmi_bufr_data/V02A/1B/Y%y4/M%m2/gmi_nrt_L1B_S1.%y4%m2%d2.t%h2z.bufr +#END +#BEGIN gmis2_bufr => gmis2.%y4%m2%d2.t%h2z.bufr +# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/obs_data/gmi/gmi_bufr_data/V01D/1B/Y%y4/M%m2/gmi_nrt_L1B_S2.%y4%m2%d2.t%h2z.bufr +# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/obs_data/gmi/gmi_bufr_data/V02A/1B/Y%y4/M%m2/gmi_nrt_L1B_S2.%y4%m2%d2.t%h2z.bufr +#END +# GPM GMI 1CR brightness temperature +#------------------------- +BEGIN gmao_gmi_bufr => gmi.%y4%m2%d2.t%h2z.bufr +# V03A + 20140304_18z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/gmi/bufr/gmi/Y%y4/M%m2/gmi_L1CR.%y4%m2%d2.t%h2z.bufr +END + +# RapidScat Scatterometer Surface Winds onboard ISS +#------------------------- +BEGIN rscat_bufr => rscat.%y4%m2%d2.t%h2z.bufr_d.ublk + 20150501_00z-20170501_12z 060000 /archive/input/dao_ops/ops/flk/rapidscat/bufr/rapidscat/Y%y4/M%m2/rscat.%y4%m2%d2.%h2z.bufr +END + +# Suomi NPP OMPS-Limb Profiler near real time +BEGIN ompslp_nc => ompslpnc.%y4%m2%d2.t%h2z.nc + 20120101_00z-20160930_18z 060000 /archive/u/kwargan/data/OMPS-LP/NetCDF_error_x_1.5/Y%y4/M%m2/OMPS-LPoz.%y4%m2%d2_%h2z.nc +END +# OMPS-NPP +# -------- +BEGIN npp_ompsnm_bufr => OMPS-TC_v2r0_npp.t%y4%m2%d2.%h2z.ubufr + 20180227_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/OMPS-TC/bufr/OMPS-TC/Y%y4/M%m2/OMPS-TC_v2r0_npp.t%y4%m2%d2.%h2z.bufr +END +BEGIN npp_ompsnp_bufr => OMPS-NP_v2r0_npp.t%y4%m2%d2.%h2z.ubufr + 20180227_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/OMPS-NP/bufr/OMPS-NP/Y%y4/M%m2/OMPS-NP_v2r0_npp.t%y4%m2%d2.%h2z.bufr +END + +# Aircraft metadata for GSI temperature bias correction +BEGIN ncep_acftpfl_bufr => gdas1.%y4%m2%d2.t%h2z.prepbufr.acft_profiles.ublk + 20160511_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/AIRCFT/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.prepbufr.acft_profiles +END + +# GMAO AMSR2 +BEGIN gmao_amsr2_bufr => gmao.amsr2_gw1.%y4%m2%d2.t%h2z.ublk + 20190101_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/amsr2/bufr/Y%y4/M%m2/gmao.amsr2_gw1.%y4%m2%d2.t%h2z.bufr +END diff --git a/GMAO_etc/obsys-nccs.rc b/GMAO_etc/obsys-nccs.rc index 34646ed6..a017185b 100755 --- a/GMAO_etc/obsys-nccs.rc +++ b/GMAO_etc/obsys-nccs.rc @@ -77,12 +77,18 @@ # 2015.06.16 Wargn Add entry for OMPS-LP # 2015.07.28 Sienkiewicz End date for ncep_sptrmm_bufr # 2017.07.06 RT/for/Sienkiewicz Add ncep_acftpfl_bufr +# 2020.02.13 RT/for/JJin Add gmao_amsr2_bufr +# 2020.06.09 Todling Set final dates for GOESFV and CrIS as in FP +# 2020.09.30 Mohar Historical AVHRR (N15,16,17) +# 2020.10.14 McCarty COSMIC-2 single file for period before early Mar 2020 +# 2021.05.25 Wargan Add npp_ompsnmeff_nc, npp_ompsnp_nc, aura_omieff_nc +# 2021.06.03 RT/McCarty/RL RO class including commencial data; max used of IASI MetopC +# 2021.07.31 Todling Add MLS-T for verification +# 2021.08.18 Todling Blacked out a few days of AIRS due to data corruption # #+BEGIN obclass data set description -#+ upabufr_val: NCEP Upper Air BUFR -#+ upabufr_llk: NCEP Upper Air BUFR (Late Look) +#+ ncep_osbuv8_6_bufr: NCEP SBUV Data in bufr format v8.6 #+ ncep_osbuv_bufr: NCEP SBUV Data in bufr format -#+ gmao_osbuv_bufr: GMAO SBUV Data in bufr format #+ ncep_spssmi_bufr: NCEP SSMI Data in bufr format #+ ncep_sptrmm_bufr: NCEP TRMM Data in bufr format #+ ncep_1bamua_bufr: NCEP Satellite AMSUA Data (bufr) @@ -90,148 +96,87 @@ #+ ncep_1bhrs2_bufr: NCEP Satellite HIRS2 Data (bufr) #+ ncep_1bhrs3_bufr: NCEP Satellite HIRS3 Data (bufr) #+ ncep_1bmsu_bufr: NCEP Satellite MSU Data (bufr) +#+ ncep_ssmis_bufr: NCEP SSMIS Data in bufr format #+ ncep_ssmit_bufr: NCEP Satellite SSM/I Data (bufr) #+ ncep_prep_bufr: NCEP Conventional Data in bufr format (ops) -#+ gmao_airs_bufr: GMAO Version of NESDIS AMSU-A AIRS #+ ncep_tcvitals: NCEP Vital files for Tropical Storms -#+ ncep_mls_bufr: NCEP MLS +#+ ncep_mhs_bufr: NCEP MHS bufr format +#+ ncep_goesfv_bufr: NCEP GEOS FV bufr format +#+ ncep_gpsro_bufr: NCEP GPSRO bufr format +#+ ncep_gpsro_com_bufr: NCEP GPSRO bufr format including period w/ commercial data +#+ ncep_mls_bufr: NCEP MLS bufr format #+ ncep_1bhrs4_bufr: NCEP Satellite HIRS4 Data (bufr) +#+ ncep_mtiasi_bufr: NCEP IASI bufr format #+ ncep_aura_omi_bufr: OMI Ozone from AURA in BUFR -#+ merra_ers1: ERS-1 scatterometer for MERRA -#+ merra_ers2: ERS-2 scatterometer for MERRA -#+ merra_wspd_bufr: MERRA Wentz Speeds -#+ merra_gprofp13_bufr: MERRA GPROF F13 Precip -#+ merra_gprofp14_bufr: MERRA GPROF F14 Precip -#+ merra_tmi2l_bufr: MERRA TRMM Land Precip (full resol.) -#+ merra_tmi2o_bufr: MERRA TRMM Ocean Precip (full resol.) -#+ merra_tmil_bufr: MERRA TRMM Land Precip -#+ merra_tmio_bufr: MERRA TRMM Ocean Precip -#+ merra_1bamua_bufr: MERRA - Satellite AMSUA Data (bufr) -#+ merra_1bamub_bufr: MERRA - Satellite AMSUB Data (bufr) -#+ merra_1bhrs2_bufr: MERRA - Satellite HIRS2 Data (bufr) -#+ merra_1bhrs3_bufr: MERRA - Satellite HIRS3 Data (bufr) -#+ merra_1bmsu_bufr: MERRA - Satellite MSU Data (bufr) -#+ merra_1bssu_bufr: MERRA - Satellite SSU Data (bufr) -#+ merra_wssmi_bufr: MERRA - Superobbed Wentz SSM/I Rain Rate -#+ merra_ssmit08_bufr: MERRA - F08 Wentz SSM/I brightness temperatures -#+ merra_ssmit10_bufr: MERRA - F10 Wentz SSM/I brightness temperatures -#+ merra_ssmit11_bufr: MERRA - F11 Wentz SSM/I brightness temperatures -#+ merra_ssmit13_bufr: MERRA - F13 Wentz SSM/I brightness temperatures -#+ merra_ssmit14_bufr: MERRA - F14 Wentz SSM/I brightness temperatures -#+ merra_ssmit15_bufr: MERRA - F15 Wentz SSM/I brightness temperatures -#+ merra_nmodis_prep_bufr: MERRA - NESDIS MODIS winds -#+ merra_prof_prep_bufr: MERRA - Profilers -#+ merra_cdas_prep_bufr: NCEP Conventional Data in bufr format (ops) -#+ merra_qscat_jpl: QuickScat from JPL -#+ merra_sbuv_prep_bufr: SBUV Version 8 -#+ merra_airs_bufr: MERRA Version of NESDIS AMSU-A AIRS -#+ merra_sfcland_prep_bufr: MERRA Surf Land Conv Obs -#+ merra_upa_prep_bufr: MERRA Upper-Air Conv Obs -#+ merra_acars_prep_bufr: MERRA ACARS Conv Obs -#+ merra_aircft_prep_bufr: MERRA AirCraft Conv Obs -#+ merra_satwnd_prep_bufr: MERRA Sat Winds Conv Obs -#+ merra_sfcship_prep_bufr: MERRA Ship Conv Obs -#+ merra_sfcbog_prep_bufr: MERRA Boggus Obs -#+ aura_mlsoz_bufr: MLS standard (not near-realtime) Ozone from AURA in BUFR ("o3lev") -#+ aura_mlsoz_text: MLS standard (not near-realtime) Ozone from AURA in text ("o3lev") -#+ aura_mlst_bufr: EOSMLSt level 2b temperature from AURA in BUFR -#+ gmao_mlst_bufr: EOSMLSt level 2b temperature from AURA in BUFR, the same as aura_mlst_bufr -#+ aura_omieff_bufr: OMI Ozone from AURA with efficiency factors in BUFR ("omieff") -#+ aura_omieff_nc: OMI Ozone from AURA with efficiency factors in NetCDF ("omieff") -#+ nim07_tomseff_nc: Ozone from NIMBUS-07 TOMS in NetCDF ("tomseff") -#+ ep_tomseff_nc: Ozone from Earth-Probe TOMS in NetCDF ("tomseff") -#+ rscat_bufr: RapidScat sfc winds from instrument onboard ISS -#+ ompslp_nc: Ozone from OMPS-Limb Profiler ("ompslp") -#+ npp_ompsnm_bufr: Ozone from OMPS ("ompsnm") -#+ npp_ompsnp_bufr: Ozone from OMPS ("ompspm") #+ ncep_acftpfl_bufr: Metadata for GSI Aircraft Bias Correction +#+ ncep_atms_bufr: NCEP ATMS bufr format #+ ncep_cris_bufr: CrIS NPP #+ ncep_crisfsr_bufr: CrIS NOAA-20 +#+ ncep_satwnd_bufr: NCEP satellite winds bufr format +#+ ncep_sevcsr_bufr: NCEP SEVIRI bufr format +#+ ncep_avcsam_bufr: NCEP AM-AVHRR bufr format +#+ ncep_avcspm_bufr: NCEP PM-AVHRR bufr format +#+ gmao_amsr2_bufr: AMSR2 +#+ gmao_gmi_bufr: GMAO GMI/GPM bufr format +#+ disc_airs_bufr: GMAO AIRS bufr format +#+ mls_nrt_nc: GMAO MLS near-real-time (nc4 format) +#+ npp_ompsnm_bufr: OMPS AM bufr format +#+ npp_ompsnp_bufr: OMPS PM bufr format +#+ npp_ompsnmeff_nc: OMPS AM netcdf format +#+ npp_ompsnp_nc: OMPS PM netcdf format +#+ aura_omieff_nc: AURA OMI netcdf format +#+ gmao_mlst_bufr: MLS Retrieved Temperature (for verification in x-exp and FP) #+END # -# Upper-air BUFR from NCEP (UPABFR) -# --------------------------------- -#BEGIN upabufr_val => obsys.upabufr.obs.%y4%m2%d2%h2z.bfr -# 19971214_00z-19980201_18z 060000 /archive/input/dao_it/val/default/conv+tovs/bufr/upa/Y%y4/M%m2/upa%y4%m2%d2.%h2z.bufr_d -# 19980601_00z-19980801_18z 060000 /archive/input/dao_it/val/default/conv+tovs/bufr/upa/Y%y4/M%m2/upa%y4%m2%d2.%h2z.bufr_d -#END - -BEGIN upabufr_llk => obsys.upabufr.obs.%y4%m2%d2%h2z.bfr - 19991218_00z-19991219_18z 060000 /archive/input/dao_ops/obs/llk/conv+tovs/bufr/upa/Y%y4/M%m2/upa%y4%m2%d2.%h2z.bufr_d - 19991226_00z-20000507_18z 060000 /archive/input/dao_ops/obs/llk/conv+tovs/bufr/upa/Y%y4/M%m2/upa%y4%m2%d2.%h2z.bufr_d - 20000508_00z-20050513_18z 060000 /archive/input/dao_ops/obs/llk/conv+tovs/bufr/upa/Y%y4/M%m2/upa%y4%m2%d2.arc.%h2z.bufr_d -# 20010101_00z-21001231_18z 060000 /archive/input/dao_ops/obs/llk/conv+tovs/bufr/upa/Y%y4/M%m2/upa%y4%m2%d2.arc.%h2z.bufr_d -END - -# GMAO reprocessed SBUV OZ (SBUV-8) -# --------------------------------- -BEGIN gmao_osbuv8_bufr => gdas1.%y4%m2%d2.t%h2z.osbuv.tm00.bufr_d.ublk - 19781031_00z-20111231_18z 060000 /archive/input/gmao_ops/ops/merra/sbuv8r6/bufr/Y%y4/M%m2/gmao.sbuv8r6.%y4%m2%d2.%h2z.bufr -END - # NCEP unconventional observational data # --------------------------------------- BEGIN ncep_osbuv8_6_bufr => gdas1.%y4%m2%d2.t%h2z.osbuv.tm00.bufr_d.ublk # 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.osbuv.tm00.bufr_d # 20040615_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv.tm00.bufr_d # Use merra_sbuv_prep_bufr prior to 20071001 - 20071001_00z-20080204_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv.tm00.bufr_d - 20080205_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8_6.tm00.bufr_d -# 20071215_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8_6.tm00.bufr_d +# 20071001_00z-20080204_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv.tm00.bufr_d +# 20080205_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8_6.tm00.bufr_d + 20071215_00z-20181001_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8_6.tm00.bufr_d + 20181002_06z-20190703_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8_6.tm00.bufr_d END BEGIN ncep_osbuv_bufr => gdas1.%y4%m2%d2.t%h2z.osbuv.tm00.bufr_d.ublk - 20071215_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8.tm00.bufr_d -# 20080205_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8.tm00.bufr_d -END -BEGIN ncep_spssmi_bufr => gdas1.%y4%m2%d2.t%h2z.spssmi.tm00.bufr_d.ublk -# 20040416_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ssmi_nesdis/bufr/wind/Y%y4/M%m2/smi%y2%m2%d2.%h2z.bufr_d -# Use merra_gprofpXX for precip data prior to 20060401. - 20060401_00z-20091119_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SPSSMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.spssmi.tm00.bufr_d +# 20071215_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8.tm00.bufr_d + 20071214_06z-20161105_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8.tm00.bufr_d + 20161106_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SBUV8/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.osbuv8.tm00.bufr_d END BEGIN ncep_ssmis_bufr => gdas1.%y2%m2%d2.t%h2z.ssmisu.tm00.bufr_d.ublk - 20110228_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_gps/bufr/SSMISU/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.ssmisu.tm00.bufr_d -# 20110228_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SSMISU/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.ssmisu.tm00.bufr_d -END -BEGIN ncep_sptrmm_bufr => gdas1.%y4%m2%d2.t%h2z.sptrmm.tm00.bufr_d.ublk -# 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.sptrmm.tm00.bufr_d -# 20040714_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/TRMM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.sptrmm.tm00.bufr_d -# Use merra_tmio_bufr & merra_tmil_bufr prior to 20060101 - 20060101_00z-20150114_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/TRMM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.sptrmm.tm00.bufr_d +# 20110228_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_gps/bufr/SSMISU/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.ssmisu.tm00.bufr_d + 20110228_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SSMISU/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.ssmisu.tm00.bufr_d END # NCEP Operational (satellite) data # --------------------------------- BEGIN ncep_1bamua_bufr => gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d.ublk - 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.1bamua.tm00.bufr_d - 20041001_00z-20041017_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d - 20041019_00z-20041031_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d - 20050201_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d -# 20040615_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d +# 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.1bamua.tm00.bufr_d +# 20041001_00z-20041017_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d +# 20041019_00z-20041031_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d +# 20050201_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d + 20040615_06z-20040616_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d + 20040617_00z-20041017_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d + 20041018_06z-20041231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d + 20050201_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUA/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamua.tm00.bufr_d END BEGIN ncep_1bamub_bufr => gdas1.%y2%m2%d2.t%h2z.1bamub.tm00.bufr_d.ublk - 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.1bamub.tm00.bufr_d - 20050201_00z-20140606_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUB/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamub.tm00.bufr_d -# 20040615_00z-20140606_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUB/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamub.tm00.bufr_d -END -BEGIN ncep_1bhrs2_bufr => gdas1.%y2%m2%d2.t%h2z.1bhrs2.tm00.bufr_d.ublk - 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.1bhrs2.tm00.bufr_d - 20050201_00z-20060926_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/HIRS2/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs2.tm00.bufr_d -# 20040615_00z-20060926_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/HIRS2/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs2.tm00.bufr_d +# 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.1bamub.tm00.bufr_d +# 20050201_00z-20140606_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUB/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamub.tm00.bufr_d + 20040615_06z-20040616_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUB/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamub.tm00.bufr_d + 20040617_00z-20041231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUB/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamub.tm00.bufr_d + 20050201_00z-20140319_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUB/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamub.tm00.bufr_d + 20140319_18z-20140611_00z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSUB/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bamub.tm00.bufr_d END BEGIN ncep_1bhrs3_bufr => gdas1.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr_d.ublk - 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.1bhrs3.tm00.bufr_d - 20050201_00z-20140606_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/HIRS3/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr_d -# 20040615_00z-20140606_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/HIRS3/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr_d -END -BEGIN ncep_1bmsu_bufr => gdas1.%y2%m2%d2.t%h2z.1bmsu.tm00.bufr_d.ublk - 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.1bmsu.tm00.bufr_d - 20050201_00z-20060926_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/MSU/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmsu.tm00.bufr_d -END -BEGIN ncep_ssmit_bufr => gdas1.%y2%m2%d2.t%h2z.ssmitbufr.tm00.bufr_d.ublk -# 20060216_12z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SSMIT/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.ssmit.tm00.bufr_d -# data available from 20060216, but we only use from 20060726 when merra_smmit ends. - 20060726_00z-20091119_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SSMIT/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.ssmit.tm00.bufr_d +# 20040410_00z-20040411_18z 060000 /archive/input/dao_ops/geos5/Y%y4/M%m2/D%d2/gdas1.t%h2z.1bhrs3.tm00.bufr_d +# 20050201_00z-20140606_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/HIRS3/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr_d + 20040615_06z-20040616_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/HIRS3/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr_d + 20040617_00z-20041231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/HIRS3/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr_d + 20050201_00z-20140319_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/HIRS3/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr_d + 20140319_18z-20140611_00z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/HIRS3/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr_d END # NCEP Prep-bufr conventional data @@ -239,19 +184,9 @@ END BEGIN ncep_prep_bufr => gdas1.%y4%m2%d2.t%h2z.prepbufr.ublk # 20020307_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/PREPBUFR/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.prepbufr # data available from 2002, but we only use from 2006 after merra data ends. - 20060101_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/PREPBUFR/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.prepbufr -# 20100213_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/PREPBUFR/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.prepbufr -END -# NESDIS/GMAO AIRS/AMSU-A data -# ---------------------------- -BEGIN gmao_airs_bufr => gmaoairs.%y4%m2%d2.t%h2z.bufr.ublk -# 20021216_00z-20040428_18z 060000 /archive/input/dao_ops/obs/merra/airs/bufr/Y%y4/M%m2/airs.%y4%m2%d2.t%h2z.bufr -# 20040429_00z-20040723_18z 060000 /archive/input/dao_ops/ops/merra/airs_ncep/bufr/Y%y4/M%m2/gdas1.d%y4%m2%d2.t%h2z.airs.tm00.bufr_d -# 20040724_00z-21001231_18z 060000 /archive/input/dao_ops/obs/merra/airs/bufr/Y%y4/M%m2/airs.%y4%m2%d2.t%h2z.bufr -# Prior to 20060907, use merra_airs_bufr. - 20060907_00z-20070903_18z 060000 /archive/input/dao_ops/ops/flk/airs/bufr/C0300/Y%y4/M%m2/airs.%y4%m2%d2.t%h2z.bufr - 20070904_00z-20070904_18z 060000 /archive/input/dao_ops/ops/flk/airs/bufr/C0300/Y%y4/M%m2/airs_fix.%y4%m2%d2.t%h2z.bufr - 20070905_00z-20130903_00z 060000 /archive/input/dao_ops/ops/flk/airs/bufr/C0300/Y%y4/M%m2/airs.%y4%m2%d2.t%h2z.bufr +# 20060101_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/PREPBUFR/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.prepbufr + 20050204_00z-20050204_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/PREPBUFR/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.prepbufr + 20050301_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/PREPBUFR/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.prepbufr END ############################################################################################################### @@ -260,476 +195,225 @@ END ############################################################################################################### ############################################################################################################### -# MERRA ERS-1 Scatterometer -# -------------------------- -BEGIN merra_ers1_pre-qc => obsys.ers1.pre-qc.%y4%m2%d2.t%h2z.ublk - 19910805_00z-19911022_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19911024_00z-19911103_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19911105_00z-19911209_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19911212_00z-19911213_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19911222_00z-19920108_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19920110_00z-19920112_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19920120_00z-19920201_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19920301_00z-19920331_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19920414_00z-19920625_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19920629_00z-19920719_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19920724_00z-19920902_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19920904_00z-19940101_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19940103_00z-19940131_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19940406_00z-19940426_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr - 19940428_00z-19960525_18z 060000 /archive/input/dao_ops/obs/merra/ers1/prepbufr/Y%y4/M%m2/ers1.%y4%m2%d2.t%h2z.bufr -END - -# Satellite Observational Data for MERRA -# --------------------------------------- -BEGIN merra_1bamua_bufr => gmao.%y2%m2%d2.t%h2z.1bamua.tm00.bufr.ublk - 19981102_00z-20170429_18z 060000 /archive/input/dao_ops/obs/merra/tovs/AMSUA/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.1bamua.tm00.bufr -END -BEGIN merra_1bamub_bufr => gmao.%y2%m2%d2.t%h2z.1bamub.tm00.bufr.ublk - 19981102_00z-20140606_18z 060000 /archive/input/dao_ops/obs/merra/tovs/AMSUB/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.1bamub.tm00.bufr -END -BEGIN merra_1bhrs2_bufr => gmao.%y2%m2%d2.t%h2z.1bhrs2.tm00.bufr.ublk - 19781101_00z-20060930_18z 060000 /archive/input/dao_ops/obs/merra/tovs/HIRS2/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.1bhrs2.tm00.bufr -END -BEGIN merra_1bhrs3_bufr => gmao.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr.ublk - 19980721_00z-20140606_18z 060000 /archive/input/dao_ops/obs/merra/tovs/HIRS3/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.1bhrs3.tm00.bufr -END -BEGIN merra_1bmsu_bufr => gmao.%y2%m2%d2.t%h2z.1bmsu.tm00.bufr.ublk - 19781101_00z-19861031_18z 060000 /archive/input/dao_ops/obs/merra/tovs/MSU/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.1bmsu.tm00.bufr - 19861101_00z-20061010_18z 060000 /archive/input/dao_ops/obs/merra/tovs/MSU_RECALIBRATED/Y%y4/M%m2/ncep.%y2%m2%d2.t%h2z.1bmsu.tm00.bufr -END -BEGIN merra_1bssu_bufr => gmao.%y2%m2%d2.t%h2z.1bssu.tm00.bufr.ublk - 19781101_00z-20060505_18z 060000 /archive/input/dao_ops/obs/merra/tovs/SSU/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.1bssu.tm00.bufr -END -BEGIN merra_ssmit08_bufr => wentz.ssmit08.%y4%m2%d2%h2.bfr.ublk - 19870709_00z-19911230_18z 060000 /archive/input/dao_ops/ops/merra/SSMIRad/bufr_v6/F08/Y%y4/M%m2/wssmi.f08.%y4%m2%d2%h2.bfr -END -BEGIN merra_ssmit10_bufr => wentz.ssmit10.%y4%m2%d2%h2.bfr.ublk - 19901208_18z-19971112_18z 060000 /archive/input/dao_ops/ops/merra/SSMIRad/bufr_v6/F10/Y%y4/M%m2/wssmi.f10.%y4%m2%d2%h2.bfr -END -BEGIN merra_ssmit11_bufr => wentz.ssmit11.%y4%m2%d2%h2.bfr.ublk - 19911204_00z-20000515_18z 060000 /archive/input/dao_ops/ops/merra/SSMIRad/bufr_v6/F11/Y%y4/M%m2/wssmi.f11.%y4%m2%d2%h2.bfr -END -BEGIN merra_ssmit13_bufr => wentz.ssmit13.%y4%m2%d2%h2.bfr.ublk - 19950503_18z-20080922_18z 060000 /archive/input/dao_ops/ops/merra/SSMIRad/bufr_v6/F13/Y%y4/M%m2/wssmi.f13.%y4%m2%d2%h2.bfr - 20080923_00z-20091119_00z 060000 /archive/input/dao_ops/ops/llk/ssmirad/bfr/F13/Y%y4/M%m2/ssmirad.f13.%y4%m2%d2%h2.bfr -END -BEGIN merra_ssmit14_bufr => wentz.ssmit14.%y4%m2%d2%h2.bfr.ublk - 19970508_00z-20080731_18z 060000 /archive/input/dao_ops/ops/merra/SSMIRad/bufr_v6/F14/Y%y4/M%m2/wssmi.f14.%y4%m2%d2%h2.bfr - 20080801_00z-20080823_18z 060000 /archive/input/dao_ops/ops/llk/ssmirad/bfr/F14/Y%y4/M%m2/ssmirad.f14.%y4%m2%d2%h2.bfr -END -BEGIN merra_ssmit15_bufr => wentz.ssmit15.%y4%m2%d2%h2.bfr.ublk - 19991218_00z-20080731_18z 060000 /archive/input/dao_ops/ops/merra/SSMIRad/bufr_v6/F15/Y%y4/M%m2/wssmi.f15.%y4%m2%d2%h2.bfr - 20080801_00z-20140929_18z 060000 /archive/input/dao_ops/ops/llk/ssmirad/bfr/F15/Y%y4/M%m2/ssmirad.f15.%y4%m2%d2%h2.bfr -END - -# Superobbed SSM/I rain rate -# -------------------------- -#BEGIN merra_wssmi_bufr => wentz_rr.spssmi.%y4%m2%d2.%h2z.bfr.ublk -# 19870701_00z-20041231_18z 060000 /archive/input/dao_ops/ops/merra/ssmi_rain/prepbufr/Y%y4/M%m2/wentz_rr.%y4%m2%d2.%h2z.bfr -#END - -# NCEP Pre-bufr conventional data -# ------------------------------- -BEGIN merra_cdas_pre-qc_bufr => cdas.%y4%m2%d2.t%h2z.pre-qc.ublk - 20010101_00z-20040915_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 - 20040916_00z-20040916_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_gaps_filled_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 - 20040917_00z-20050624_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 - 20050625_00z-20050625_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_gaps_filled_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 - 20050626_00z-20050714_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 - 20050715_00z-20050721_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_gaps_filled_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 - 20050722_00z-20051231_18z 060000 /archive/input/dao_ops/obs/merra/conv/prepbufr/runh_PAOB_no_land/Y%y4/M%m2/RUNH_prepbufr_%y4%m2%d2%h2 - 20060101_00z-20081231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/runha/Y%y4/M%m2/prepbufr.gdas_red.%y4%m2%d2%h2 - 20090101_00z-21001231_18z 060000 /archive/input/dao_ops/ops/llk/conv/prepbufr/runha/Y%y4/M%m2/reanalysis.prepbufr.gdas_red.%y4%m2%d2%h2 -END -# -BEGIN merra_goesnd_prep_bufr => goesnd.%y4%m2%d2.t%h2z.ublk - 20010424_00z-20011231_18z 060000 /archive/input/dao_ops/ops/merra/GOES_sounder/prepbufr/Y%y4/M%m2/goesnd.d%y4%m2%d2.t%h2z.bfr - 20020101_00z-20020306_18z 060000 /archive/input/dao_ops/ops/merra/GOES_sounder/prepbufr/Y%y4/M%m2/goesnd.%y4%m2%d2.%h2z.bfr - 20020306_00z-20040429_18z 060000 /archive/input/dao_ops/ops/merra/GOES_sounder/prepbufr/Y%y4/M%m2/goesnd.d%y4%m2%d2.t%h2z.bfr - 20040601_00z-20051231_18z 060000 /archive/input/dao_ops/ops/merra/GOES_sounder/prepbufr/Y%y4/M%m2/goesnd.d%y4%m2%d2.t%h2z.bfr -END -# -BEGIN merra_nmodis_pre-qc_bufr => modis.%y4%m2%d2.t%h2z.pre-qc.ublk -# 20040623_00z-20051231_18z 060000 /archive/input/dao_ops/ops/merra/modisw/prepbufr/Y%y4/M%m2/modisw.%y4%m2%d2.t%h2z.bfr - 20020701_00z-20040708_18z 060000 /archive/input/dao_ops/ops/merra/modisw_combined_runh/prepbufr/Y%y4/M%m2/modisw_c.%y4%m2%d2.t%h2z.bfr - 20040709_00z-20040930_18z 060000 /archive/input/dao_ops/ops/merra/modisw_runh/prepbufr/Y%y4/M%m2/modisw.%y4%m2%d2.t%h2z.bfr -END -# -BEGIN merra_prof_pre-qc_bufr => prof.%y4%m2%d2.t%h2z.pre-qc.ublk - 19920510_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/profiler/prepbfr/Y%y4/M%m2/profil.%y4%m2%d2.%h2.bfr - 20010101_00z-20080731_18z 060000 /archive/input/dao_ops/ops/merra/profiler_runh/prepbfr/Y%y4/M%m2/profil.%y4%m2%d2.%h2.bfr -END -# BEGIN ncep_tcvitals => tcvitals.%y4%m2%d2%h2 - 20040101_00z-20041231_18z 060000 /archive/input/dao_ops/ops/merra/tcvitals/txt/Y%y4/M%m2/syndat_tcvitals.%y4%m2%d2.t%h2z.txt - 20060401_00z-21001231_18z 060000 /archive/input/dao_ops/obs/flk/tcvitals/text/TCVITALS/Y%y4/M%m2/gfs.%y2%m2%d2.t%h2z.syndata.tcvitals -# 20060217_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/tcvitals/text/TCVITALS/Y%y4/M%m2/gfs.%y2%m2%d2.t%h2z.syndata.tcvitals -END - -# MERRA ERS-2 Scatterometer -# ------------------------- -BEGIN merra_ers2_pre-qc => obsys.ers2.pre-qc.%y4%m2%d2.t%h2z.ublk - 19970925_00z-19980603_12z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr - 19980606_18z-19990307_00z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr - 19990309_06z-19991231_12z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr - 20000102_18z-20000207_06z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr - 20000210_18z-20000630_06z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr - 20000705_18z-20001007_18z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr - 20001010_18z-20001231_18z 060000 /archive/input/dao_ops/obs/merra/ers2/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr - 20010101_00z-20010117_18z 060000 /archive/input/dao_ops/obs/merra/ers2_runh/prepbufr/Y%y4/M%m2/ers2.%y4%m2%d2.t%h2z.bufr -END - -# MERRA SSMI Wentz Speed -# ---------------------- -BEGIN merra_wspd_bufr => wentzspd.%y4%m2%d2.t%h2z.bufr.ublk -#19870709_00z-20060831_18z 060000 /archive/input/dao_ops/obs/merra/ssmi_wind_wentz/prepbufr_v6/Y%y4/M%m2/ssmi_wind.%y4%m2%d2.%h2z.bfr -# even though we have this data into 2006, switch to ncep_prep_bufr on 20060101 when the other conv data switches - 19870709_00z-20071231_18z 060000 /archive/input/dao_ops/obs/merra/ssmi_wind_wentz/prepbufr_v6/Y%y4/M%m2/ssmi_wind.%y4%m2%d2.%h2z.bfr - 20080101_00z-20130802_18z 060000 /archive/input/dao_ops/ops/llk/ssmi_wind_wentz/prepbufr_v6/ssmi_wind_wentz/Y%y4/M%m2/ssmiwnd.%y4%m2%d2.%h2z.bfr -END - -# MERRA GPROF Precipitation -# -------------------------- -BEGIN merra_gprofp08_bufr => gprofp08.%y4%m2%d2.t%h2z.bufr.ublk - 19870709_00z-19900226_18z 060000 /archive/input/dao_ops/obs/merra/gprof/bufr/Y%y4/M%m2/gprof.F08.%y4%m2%d2.%h2z.bufr -END -BEGIN merra_gprofp10_bufr => gprofp10.%y4%m2%d2.t%h2z.bufr.ublk - 19910105_00z-19971115_18z 060000 /archive/input/dao_ops/obs/merra/gprof/bufr/Y%y4/M%m2/gprof.F10.%y4%m2%d2.%h2z.bufr -END -BEGIN merra_gprofp11_bufr => gprofp11.%y4%m2%d2.t%h2z.bufr.ublk - 19920101_00z-19961130_18z 060000 /archive/input/dao_ops/obs/merra/gprof/bufr/Y%y4/M%m2/gprof.F11.%y4%m2%d2.%h2z.bufr -END -BEGIN merra_gprofp13_bufr => gprofp13.%y4%m2%d2.t%h2z.bufr.ublk - 19950503_00z-20060331_18z 060000 /archive/input/dao_ops/obs/merra/gprof/bufr/Y%y4/M%m2/gprof.F13.%y4%m2%d2.%h2z.bufr -END -BEGIN merra_gprofp14_bufr => gprofp14.%y4%m2%d2.t%h2z.bufr.ublk - 19970508_00z-20060331_18z 060000 /archive/input/dao_ops/obs/merra/gprof/bufr/Y%y4/M%m2/gprof.F14.%y4%m2%d2.%h2z.bufr -END -#BEGIN merra_gprofp15_bufr => gprofp15.%y4%m2%d2.t%h2z.bufr.ublk -# 00000000_00z-00000000_00z 060000 /archive/input/dao_ops/obs/merra/gprof/bufr/Y%y4/M%m2/gprof.F15.%y4%m2%d2.%h2z.bufr -#END - -#BEGIN merra_tmi2l_bufr => tmi2l.%y4%m2%d2.%h2z.bufr.ublk -# 00000000_00z-00000000_00z 060000 /archive/input/dao_ops/obs/merra/trmm/bufr/Y%y4/M%m2/tmi2.land.%y4%m2%d2.%h2z.bufr -#END -#BEGIN merra_tmi2o_bufr => tmi2o.%y4%m2%d2.%h2z.bufr.ublk -# 00000000_00z-00000000_00z 060000 /archive/input/dao_ops/obs/merra/trmm/bufr/Y%y4/M%m2/tmi2.ocean.%y4%m2%d2.%h2z.bufr -#END - -# MERRA reduced-resolution TRMM TMI -#---------------------------------- -BEGIN merra_tmil_bufr => tmil.%y4%m2%d2.%h2z.bufr.ublk - 19980101_00z-20051231_18z 060000 /archive/input/dao_ops/obs/merra/trmm/bufr/Y%y4/M%m2/tmi.land.%y4%m2%d2.%h2z.bufr -END -BEGIN merra_tmio_bufr => tmio.%y4%m2%d2.%h2z.bufr.ublk - 19980101_00z-20051231_18z 060000 /archive/input/dao_ops/obs/merra/trmm/bufr/Y%y4/M%m2/tmi.ocean.%y4%m2%d2.%h2z.bufr -END - -# MERRA Quick SCAT Data (ms - added 2003,2004) -# --------------- -BEGIN merra_qscat_jpl_pre-qc => obsys.qscat.pre-qc.%y4%m2%d2.t%h2z.ublk - 19990719_00z-19991117_18z 060000 /archive/input/dao_ops/obs/merra/qscat/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr - 19991119_00z-20000101_18z 060000 /archive/input/dao_ops/obs/merra/qscat/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr - 20000103_00z-20001116_18z 060000 /archive/input/dao_ops/obs/merra/qscat/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr - 20001118_00z-20001231_18z 060000 /archive/input/dao_ops/obs/merra/qscat/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr - 20010101_00z-20010511_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr - 20010514_00z-20010707_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr - 20010709_00z-20011117_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr - 20011119_00z-20020319_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr - 20020321_00z-20021118_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr - 20021120_00z-20021231_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr - 20030101_00z-20030519_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr - 20030520_00z-20031231_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr - 20040101_00z-20081029_18z 060000 /archive/input/dao_ops/obs/merra/qscat_runh/prepbufr/Y%y4/M%m2/jpl_qscat.%y4%m2%d2.t%h2z.bufr - 20081030_00z-20091122_18z 060000 /archive/input/dao_ops/ops/llk/jplqscat/bfr/jplqscat/Y%y4/M%m2/jplqscat.%y4%m2%d2%h2.bfr -END - -# MERRA SBUV-8 -# ------------ -BEGIN merra_sbuv_prep_bufr => gmao.sbuv8.%y4%m2%d2.%h2z.bufr.ublk - 19781101_00z-19891231_18z 060000 /archive/input/dao_ops/ops/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n07.%y4%m2%d2.%h2z.bufr - 19900101_00z-19950228_18z 060000 /archive/input/dao_ops/ops/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n11.%y4%m2%d2.%h2z.bufr - 19950301_00z-19970630_18z 060000 /archive/input/dao_ops/ops/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n09.%y4%m2%d2.%h2z.bufr - 19970701_00z-20001231_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n11.%y4%m2%d2.%h2z.bufr -# 20010101_00z-20010127_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16.%y4%m2%d2.%h2z.bufr - 20010101_00z-20010127_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16_p1d.%y4%m2%d2.%h2z.bufr - 20010128_00z-20010129_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n11.%y4%m2%d2.%h2z.bufr -# 20010130_00z-20010216_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16.%y4%m2%d2.%h2z.bufr - 20010130_00z-20010216_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16_p1d.%y4%m2%d2.%h2z.bufr - 20010217_00z-20010218_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n11.%y4%m2%d2.%h2z.bufr -# 20010219_00z-20021116_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16.%y4%m2%d2.%h2z.bufr - 20010219_00z-20021116_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16_p1d.%y4%m2%d2.%h2z.bufr - 20021117_00z-20021118_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n17.%y4%m2%d2.%h2z.bufr -# 20021119_00z-20030725_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16.%y4%m2%d2.%h2z.bufr - 20021119_00z-20030725_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16_p1d.%y4%m2%d2.%h2z.bufr - 20030726_00z-20030727_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n17.%y4%m2%d2.%h2z.bufr -# 20030728_00z-20051231_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16.%y4%m2%d2.%h2z.bufr - 20030728_00z-20051231_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n16_p1d.%y4%m2%d2.%h2z.bufr - 20060101_00z-20070930_18z 060000 /archive/input/dao_ops/obs/merra/sbuv8/prepbufr/Y%y4/M%m2/sbuv8_n17.%y4%m2%d2.%h2z.bufr -END - -BEGIN merra_airs_bufr => airs.%y4%m2%d2.t%h2z.bufr.ublk - 20021216_00z-20040428_18z 060000 /archive/input/dao_ops/obs/merra/airs/bufr/Y%y4/M%m2/airs.%y4%m2%d2.t%h2z.bufr - 20040429_00z-20040723_18z 060000 /archive/input/dao_ops/ops/merra/airs_ncep/bufr/Y%y4/M%m2/gdas1.d%y4%m2%d2.t%h2z.airs.tm00.bufr_d - 20040724_00z-20060906_18z 060000 /archive/input/dao_ops/obs/merra/airs/bufr/Y%y4/M%m2/airs.%y4%m2%d2.t%h2z.bufr +# 20040101_00z-20041231_18z 060000 /archive/input/dao_ops/ops/merra/tcvitals/txt/Y%y4/M%m2/syndat_tcvitals.%y4%m2%d2.t%h2z.txt +# 20060401_00z-21001231_18z 060000 /archive/input/dao_ops/obs/flk/tcvitals/text/TCVITALS/Y%y4/M%m2/gfs.%y2%m2%d2.t%h2z.syndata.tcvitals + 20060401_00z-20130812_00z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/tcvitals/text/TCVITALS/Y%y4/M%m2/gfs.%y2%m2%d2.t%h2z.syndata.tcvitals + 20130812_12z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/tcvitals/text/TCVITALS/Y%y4/M%m2/gfs.%y2%m2%d2.t%h2z.syndata.tcvitals END BEGIN ncep_mhs_bufr => gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d.ublk - 20081021_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d -# 20081021_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d +# 20081021_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d + 20080201_00z-20080203_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d + 20080203_18z-20080618_00z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d + 20080618_18z-20080714_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d + 20080716_00z-20080726_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d + 20080726_18z-20080810_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d + 20080811_18z-20080911_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d + 20080911_18z-20080923_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d + 20080924_00z-20080924_00z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d + 20080924_12z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BMHS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bmhs.tm00.bufr_d END BEGIN ncep_1bhrs4_bufr => gdas1.%y2%m2%d2.t%h2z.1bhrs4.tm00.bufr_d.ublk - 20090129_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BHRS4/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs4.tm00.bufr_d -# 20090129_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BHRS4/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs4.tm00.bufr_d -END - -BEGIN ncep_airs_bufr => gdas1.%y2%m2%d2.t%h2z.airsev.tm00.bufr_d.ublk - 20081007_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/AIRS/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.airsev.tm00.bufr_d -END - -BEGIN ncep_amsre_bufr => gdas1.%y2%m2%d2.t%h2z.amsre.tm00.bufr_d.ublk - 20090129_00z-20111006_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/AMSRE/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.amsre.tm00.bufr_d -END - -BEGIN ncep_geoimr_bufr => gdas1.%y2%m2%d2.t%h2z.geoimr.tm00.bufr_d.ublk - 20080904_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/GEOIMR/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.geoimr.tm00.bufr_d +# 20090129_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BHRS4/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs4.tm00.bufr_d + 20090129_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/1BHRS4/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.1bhrs4.tm00.bufr_d END BEGIN ncep_goesfv_bufr => gdas1.%y2%m2%d2.t%h2z.goesfv.tm00.bufr_d.ublk - 20070222_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/GOESFV/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.goesfv.tm00.bufr_d -# 20080904_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/GOESFV/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.goesfv.tm00.bufr_d +# 20070222_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/GOESFV/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.goesfv.tm00.bufr_d + 20070222_00z-20200303_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/GOESFV/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.goesfv.tm00.bufr_d END -BEGIN ncep_gome_bufr => gdas1.%y2%m2%d2.t%h2z.gome.tm00.bufr_d.ublk - 20090129_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/GOME/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gome.tm00.bufr_d -END - -BEGIN ncep_gpsipw_bufr => gdas1.%y2%m2%d2.t%h2z.gpsipw.tm00.bufr_d.ublk - 20080811_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/GPSIPW/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gpsipw.tm00.bufr_d +BEGIN ncep_gpsro_bufr => gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d.ublk +# 20080811_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/GPSRO/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d + 20010519_00z-20190930_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/GPSRO/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d + 20191001_00z-20200316_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/GPSRO/Y%y4/M%m2/gdas1_w_C2.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d + 20200316_18z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/GPSRO/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d END -BEGIN ncep_gpsro_bufr => gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d.ublk - 20080811_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/GPSRO/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d -# 20080811_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/GPSRO/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d +BEGIN ncep_gpsro_com_bufr => gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d.ublk +# 20080811_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/GPSRO/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d + 20010519_00z-20190930_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/GPSRO/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d + 20191001_00z-20200316_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/GPSRO/Y%y4/M%m2/gdas1_w_C2.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d + 20200316_18z-20201217_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/GPSRO/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d + 20201218_00z-20210114_18z 060000 /discover/nobackup/projects/gmao/obsdev/wrmccart/RO_BUFR/x0045_merge/gdas1_com.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d + 20210115_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/GPSRO/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.gpsro.tm00.bufr_d END BEGIN ncep_mtiasi_bufr => gdas1.%y2%m2%d2.t%h2z.mtiasi.tm00.bufr_d.ublk - 20090129_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/MTIASI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.mtiasi.tm00.bufr_d -# 20090129_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/MTIASI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.mtiasi.tm00.bufr_d +# 20090129_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/MTIASI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.mtiasi.tm00.bufr_d + 20080916_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/MTIASI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.mtiasi.tm00.bufr_d END BEGIN ncep_atms_bufr => gdas1.%y4%m2%d2.t%h2z.atms.tm00.bufr_d.ublk - 20120213_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/ATMS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.atms.tm00.bufr_d -# 20111116_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/ATMS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.atms.tm00.bufr_d +# 20120213_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/ATMS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.atms.tm00.bufr_d + 20111115_06z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/ATMS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.atms.tm00.bufr_d END BEGIN ncep_cris_bufr => gdas1.%y4%m2%d2.t%h2z.cris.tm00.bufr_d.ublk - 20120107_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/CRIS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.cris.tm00.bufr_d -# 20120107_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/CRIS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.cris.tm00.bufr_d +# 20120107_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/CRIS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.cris.tm00.bufr_d + 20120106_06z-20120112_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/CRIS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.cris.tm00.bufr_d + 20120406_12z-20200422_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/CRIS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.cris.tm00.bufr_d END BEGIN ncep_crisfsr_bufr => gdas1.%y4%m2%d2.t%h2z.crisfsr.tm00.bufr_d.ublk - 20171020_00z-20180930_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/CRISF4/Y%y4/M%m2/crisf4.gdas.%y4%m2%d2%h2 - 20181001_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/CRISF4/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.crisf4.tm00.bufr_d -# 20171020_00z-20180930_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/crisf4/bufr/CRISF4/Y%y4/M%m2/crisf4.gdas.%y4%m2%d2%h2 -# 20181001_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/crisf4/bufr/CRISF4/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.crisf4.tm00.bufr_d +# 20171020_00z-20180930_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/CRISF4/Y%y4/M%m2/crisf4.gdas.%y4%m2%d2%h2 +# 20181001_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/CRISF4/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.crisf4.tm00.bufr_d + 20171020_00z-20180930_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/crisf4/bufr/CRISF4/Y%y4/M%m2/crisf4.gdas.%y4%m2%d2%h2 + 20181001_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/crisf4/bufr/CRISF4/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.crisf4.tm00.bufr_d END BEGIN ncep_satwnd_bufr => gdas1.%y4%m2%d2.t%h2z.satwnd.tm00.bufr_d.ublk - 20100701_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/SATWND/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.satwnd.tm00.bufr_d -# 20120201_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SATWND/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.satwnd.tm00.bufr_d +# 20100701_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/SATWND/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.satwnd.tm00.bufr_d + 20100701_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SATWND/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.satwnd.tm00.bufr_d END BEGIN ncep_sevcsr_bufr => gdas1.%y4%m2%d2.t%h2z.sevcsr.tm00.bufr_d.ublk - 20120502_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SEVCSR/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.sevcsr.tm00.bufr_d -# 20111116_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SEVCSR/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.sevcsr.tm00.bufr_d +# 20120502_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/SEVCSR/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.sevcsr.tm00.bufr_d + 20120214_12z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/SEVCSR/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.sevcsr.tm00.bufr_d END BEGIN ncep_avcsam_bufr => gdas1.%y2%m2%d2.t%h2z.avcsam.tm00.bufr_d.ublk - 20120207_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/AVCSAM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcsam.tm00.bufr_d -# 20120207_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AVCSAM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcsam.tm00.bufr_d +# 20120207_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/AVCSAM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcsam.tm00.bufr_d + 20120207_00z-20160227_00z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AVCSAM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcsam.tm00.bufr_d + 20160227_12z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AVCSAM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcsam.tm00.bufr_d END BEGIN ncep_avcspm_bufr => gdas1.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d.ublk - 20120207_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/AVCSPM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d -# 20181201_00z-20181231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AVCSPM/Y2018/M12/gdas1.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d +# 20120207_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/AVCSPM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d + 20120207_00z-20140731_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AVCSPM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d + 20140801_00z-20160226_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AVCSPM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d + 20160228_06z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AVCSPM/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d END -BEGIN ncep_mls_bufr => gdas1.%y2%m2%d2.t%h2z.mls.tm00.bufr_d.ublk - 20120502_00z-20170201_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/MLS/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.mls.tm00.bufr_d +BEGIN ncep_avcsam_n15_bufr => gdas1_n15.%y2%m2%d2.t%h2z.avcsam.tm00.bufr_d.ublk + 19981101_00z-20120206_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/reanalysis/AVHRR_repro/bufr/AVCSAM/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.avcsam.tm00.n15.bufr_d +END +BEGIN ncep_avcspm_n16_bufr => gdas1_n16.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d.ublk + 20010301_00z-20050430_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/reanalysis/AVHRR_repro/bufr/AVCSPM/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.avcspm.tm00.n16.bufr_d +END +BEGIN ncep_avcsam_n17_bufr => gdas1_n17.%y2%m2%d2.t%h2z.avcsam.tm00.bufr_d.ublk + 20021101_00z-20100131_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/reanalysis/AVHRR_repro/bufr/AVCSAM/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.avcsam.tm00.n17.bufr_d +END +BEGIN ncep_avcspm_n18_bufr => gdas1_n18.%y2%m2%d2.t%h2z.avcspm.tm00.bufr_d.ublk + 20050701_00z-20120206_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/reanalysis/AVHRR_repro/bufr/AVCSPM/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.avcspm.tm00.n18.bufr_d +END +BEGIN ncep_avcsam_metopa_bufr => gdas1_metopa.%y2%m2%d2.t%h2z.avcsam.tm00.bufr_d.ublk + 20070601_00z-20120206_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/reanalysis/AVHRR_repro/bufr/AVCSAM/Y%y4/M%m2/gmao.%y2%m2%d2.t%h2z.avcsam.tm00.metopA.bufr_d END BEGIN ncep_aura_omi_bufr => gdas1.%y4%m2%d2.t%h2z.omi.tm00.bufr_d.ublk -# 20120201_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/OMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.omi.tm00.bufr_d - 20091212_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/OMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.omi.tm00.bufr_d +# 20091212_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_g5obs/bufr/OMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.omi.tm00.bufr_d + 20120201_00z-20130316_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/OMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.omi.tm00.bufr_d + 20130316_18z-20131003_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/OMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.omi.tm00.bufr_d + 20131004_12z-20140302_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/OMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.omi.tm00.bufr_d + 20140303_18z-20140708_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/OMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.omi.tm00.bufr_d + 20140709_12z-20160308_00z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/OMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.omi.tm00.bufr_d + 20160308_18z-20160309_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/OMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.omi.tm00.bufr_d + 20160310_00z-20160408_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/OMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.omi.tm00.bufr_d + 20160409_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/OMI/Y%y4/M%m2/gdas1.%y2%m2%d2.t%h2z.omi.tm00.bufr_d END - # New Aqua data from DISC NRT server #----------------------------------- BEGIN disc_airs_bufr => airs.%y4%m2%d2.t%h2z.bufr - 20100801_00z-20100818_18z 060000 /archive/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airs_disc.%y4%m2%d2.t%h2z.bufr - 20100819_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr -# 20100819_00z-20131001_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr -# 20131002_00z-20131011_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airs_disc_final.%y4%m2%d2.t%h2z.bufr -# 20131012_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr +# 20100801_00z-20100818_18z 060000 /archive/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airs_disc.%y4%m2%d2.t%h2z.bufr +# 20100819_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr + 20100721_00z-20100810_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airs_disc.%y4%m2%d2.t%h2z.bufr + 20100811_06z-20100818_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airs_disc.%y4%m2%d2.t%h2z.bufr + 20100819_00z-20130405_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr + 20130406_18z-20131001_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr + 20131012_00z-20170306_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr + 20170307_00z-20201112_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr + 20201114_00z-20201123_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr + 20201125_00z-20201130_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr + 20201202_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airsbufr_disc.%y4%m2%d2.t%h2z.bufr +# 20131001_00z-20131031_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/airs/Y%y4/M%m2/airs_disc_final.%y4%m2%d2.t%h2z.bufr END BEGIN disc_amsua_bufr => eos_amsua.%y4%m2%d2.t%h2z.bufr - 20100801_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr -# 20100815_00z-20131001_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr -# 20131002_00z-20131011_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc_final.%y4%m2%d2.t%h2z.bufr -# 20131012_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr -END - -# MERRA CONV OBS (IN PIECES) -# ------------------------- -BEGIN merra_sfcland_pre-qc_bufr => adpsfc.%y4%m2%d2.t%h2z.pre-qc.ublk - 19480101_00z-19971231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/adpsfc/Y%y4/M%m2/MERG_ADPSFC_prepbufr_%y4%m2%d2%h2 - 19980101_00z-19991231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/adpsfc_gaps_filled_plus_METAR/Y%y4/M%m2/MERG_ADPSFC_prepbufr_%y4%m2%d2%h2 - 20000101_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/adpsfc/Y%y4/M%m2/MERG_ADPSFC_prepbufr_%y4%m2%d2%h2 +# 20100801_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100701_06z-20100701_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100702_06z-20100702_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100703_06z-20100703_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100704_06z-20100704_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100705_06z-20100705_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100705_18z-20100705_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100706_06z-20100706_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100706_18z-20100706_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100707_06z-20100707_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100708_06z-20100708_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100709_06z-20100709_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100710_06z-20100710_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100711_06z-20100711_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100712_06z-20100712_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100713_06z-20100713_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100714_06z-20100714_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100715_06z-20100715_06z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100716_06z-20100716_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100717_06z-20100717_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100718_06z-20100718_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100719_06z-20100719_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100720_06z-20100821_12z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20100822_06z-20130125_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20130126_06z-20131001_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20131012_00z-20190727_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20190728_12z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc.%y4%m2%d2.t%h2z.bufr + 20101001_00z-20101031_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc_final.%y4%m2%d2.t%h2z.bufr + 20131001_00z-20131031_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/aqua_disc/bufr/amsu/Y%y4/M%m2/amsua_disc_final.%y4%m2%d2.t%h2z.bufr END -BEGIN merra_upa_pre-qc_bufr => adpupa.%y4%m2%d2.t%h2z.pre-qc.ublk - 19700101_00z-19721231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/adpupa/Y%y4/M%m2/MERG_ADPUPA_prepbufr_%y4%m2%d2%h2 - 19730101_00z-19841231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/adpupa_with_stationID/Y%y4/M%m2/MERG_ADPUPA_prepbufr_%y4%m2%d2%h2 - 19850101_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/adpupa_fixvai/Y%y4/M%m2/MERG_ADPUPA_prepbufr_%y4%m2%d2%h2 +# GPM GMI 1CR brightness temperature +#------------------------- +BEGIN gmao_gmi_bufr => gmi.%y4%m2%d2.t%h2z.bufr +# V03A +# 20140304_18z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/gmi/bufr/gmi/Y%y4/M%m2/gmi_L1CR.%y4%m2%d2.t%h2z.bufr + 20140304_18z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/gmi/bufr/gmi/Y%y4/M%m2/gmi_L1CR.%y4%m2%d2.t%h2z.bufr END -BEGIN merra_acars_pre-qc_bufr => aircar.%y4%m2%d2.t%h2z.pre-qc.ublk - 19910417_06z-19970531_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 - 19970601_00z-19970831_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar_gaps_filled/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 - 19970901_00z-19980930_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 - 19981001_00z-19981031_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar_gaps_filled/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 - 19981101_00z-19981231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 - 19990101_00z-19990131_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar_gaps_filled/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 - 19990201_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircar/Y%y4/M%m2/MERG_AIRCAR_prepbufr_%y4%m2%d2%h2 +# AURA MLS near real time +BEGIN mls_nrt_nc => mlsnc.%y4%m2%d2.t%h2z.nc +# 20140723_00z-20140815_18z 060000 /archive/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRToz.%y4%m2%d2_%h2z.nc +# 20140818_00z-20180331_18z 060000 /archive/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRToz.%y4%m2%d2_%h2z.nc +# 20180401_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRT-v4.2-oz.%y4%m2%d2_%h2z.nc + 20140717_00z-20180331_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRToz.%y4%m2%d2_%h2z.nc + 20180401_00z-20180306_00z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRT-v4.2-oz.%y4%m2%d2_%h2z.nc + 20180306_18z-20180307_00z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRT-v4.2-oz.%y4%m2%d2_%h2z.nc + 20180307_18z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRT-v4.2-oz.%y4%m2%d2_%h2z.nc END -BEGIN merra_aircft_pre-qc_bufr => aircft.%y4%m2%d2.t%h2z.pre-qc.ublk - 19710101_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/aircft/Y%y4/M%m2/MERG_AIRCFT_prepbufr_%y4%m2%d2%h2 +# GMAO AMSR2 +BEGIN gmao_amsr2_bufr => gmao.amsr2_gw1.%y4%m2%d2.t%h2z.ublk + 20171101_00z-20180228_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/amsr2/bufr/Y%y4/M%m2/gmao.amsr2_gw1.%y4%m2%d2.t%h2z.bufr + 20180401_00z-20180909_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/amsr2/bufr/Y%y4/M%m2/gmao.amsr2_gw1.%y4%m2%d2.t%h2z.bufr + 20181001_06z-20200615_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/amsr2/bufr/Y%y4/M%m2/gmao.amsr2_gw1.%y4%m2%d2.t%h2z.bufr + 20200616_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/amsr2_nrt/bufr/Y%y4/M%m2/gmao.amsr2_gw1_nrt.%y4%m2%d2.t%h2z.bufr END -BEGIN merra_satwnd_pre-qc_bufr => satwnd.%y4%m2%d2.t%h2z.pre-qc.ublk - 19850912_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/satwnd/Y%y4/M%m2/MERG_SATWND_prepbufr_%y4%m2%d2%h2 -END -BEGIN merra_satwnd00_pre-qc_bufr => satwnd.%y4%m2%d2.t00z.pre-qc.ublk - 19770101_00z-19850911_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/satwnd/Y%y4/M%m2/MERG_SATWND_prepbufr_%y4%m2%d200 -END -BEGIN merra_satwnd12_pre-qc_bufr => satwnd.%y4%m2%d2.t12z.pre-qc.ublk - 19770101_00z-19850911_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/satwnd/Y%y4/M%m2/MERG_SATWND_prepbufr_%y4%m2%d212 -END -BEGIN merra_satwnd18_pre-qc_bufr => satwnd.%y4%m2%d2.t18z.pre-qc.ublk - 19770101_00z-19850911_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/satwnd/Y%y4/M%m2/MERG_SATWND_prepbufr_%y4%m2%d218 +# OMPS-NPP +# -------- +BEGIN npp_ompsnm_bufr => OMPS-TC_v2r0_npp.t%y4%m2%d2.%h2z.ubufr +# 20180227_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/OMPS-TC/bufr/OMPS-TC/Y%y4/M%m2/OMPS-TC_v2r0_npp.t%y4%m2%d2.%h2z.bufr + 20180227_00z-20200115_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/OMPS-TC/bufr/OMPS-TC/Y%y4/M%m2/OMPS-TC_v2r0_npp.t%y4%m2%d2.%h2z.bufr + 20200118_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/OMPS-TC/bufr/OMPS-TC/Y%y4/M%m2/OMPS-TC_v2r0_npp.t%y4%m2%d2.%h2z.bufr END - -BEGIN merra_sfcship_pre-qc_bufr => sfcshp.%y4%m2%d2.t%h2z.pre-qc.ublk - 19700101_00z-20001231_18z 060000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcshp_gaps_filled/Y%y4/M%m2/COAD_SFCSHP_prepbufr_%y4%m2%d2%h2 +BEGIN npp_ompsnp_bufr => OMPS-NP_v2r0_npp.t%y4%m2%d2.%h2z.ubufr +# 20180227_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/OMPS-NP/bufr/OMPS-NP/Y%y4/M%m2/OMPS-NP_v2r0_npp.t%y4%m2%d2.%h2z.bufr + 20180227_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/OMPS-NP/bufr/OMPS-NP/Y%y4/M%m2/OMPS-NP_v2r0_npp.t%y4%m2%d2.%h2z.bufr END -BEGIN merra_sfcbog00_pre-qc_bufr => sfcbog.%y4%m2%d2.t00z.pre-qc.ublk - 19781001_00z-19841231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_no_land/Y%y4/M%m2/REAN_SFCBOG_prepbufr_%y4%m2%d200 - 19850101_00z-19931231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_jaob/Y%y4/M%m2/JAOB_SFCBOG_prepbufr_%y4%m2%d200 - 19940101_00z-19941231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_jaob/Y%y4/M%m2/ER40_SFCBOG_prepbufr_%y4%m2%d200 - 19950101_00z-20001231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_jaob/Y%y4/M%m2/JAOB_SFCBOG_prepbufr_%y4%m2%d200 +# Aircraft metadata for GSI temperature bias correction +BEGIN ncep_acftpfl_bufr => gdas1.%y4%m2%d2.t%h2z.prepbufr.acft_profiles.ublk +# 20160511_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/AIRCFT/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.prepbufr.acft_profiles + 20160511_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/ncep_g5obs/bufr/AIRCFT/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.prepbufr.acft_profiles END -BEGIN merra_sfcbog12_pre-qc_bufr => sfcbog.%y4%m2%d2.t12z.pre-qc.ublk - 19781001_00z-19841231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_no_land/Y%y4/M%m2/REAN_SFCBOG_prepbufr_%y4%m2%d212 - 19850101_00z-19931231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_jaob/Y%y4/M%m2/JAOB_SFCBOG_prepbufr_%y4%m2%d212 - 19940101_00z-19941231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_jaob/Y%y4/M%m2/ER40_SFCBOG_prepbufr_%y4%m2%d212 - 19950101_00z-20001231_18z 240000 /archive/input/dao_ops/ops/merra/conv/prepbufr/sfcbog_jaob/Y%y4/M%m2/JAOB_SFCBOG_prepbufr_%y4%m2%d212 +BEGIN npp_ompsnmeff_nc => ompsnmeffnc.%y4%m2%d2.t%h2z.nc + 20120201_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/reanalysis/ompsnm_eff/Y%y4/M%m2/OMPSNM.%y4%m2%d2_%h2z.nc END -#MLS ozone BUFR data -#------------------------- -BEGIN aura_mlsoz_bufr => mlsoz.%y4%m2%d2.t%h2z.bufr - 20040813_00z-20040831_18z 060000 /gpfsm/dnb31/jjin3/obs_data/mlso3lev_bufr/Y%y4/M%m2/MLSo3lev.%y4%m2%d2.t%h2z.bufr +BEGIN npp_ompsnp_nc => ompsnpnc.%y4%m2%d2.t%h2z.nc + 20120201_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/reanalysis/ompsnp/Y%y4/M%m2/OMPSNP.%y4%m2%d2_%h2z.nc END -#MLS ozone text -#------------------------- -#BEGIN mls12_oenew_text => mlsoz.%y4%m2%d2.t%h2z.txt -# This is an old name for aura_mlsoz_text, for backward reference purpose only. -# 00000000_00z-00000000_00z 060000 /archive/u/kwargan/data/MLSv3.3/aver/Y%y4/M%m2/MLSoz.%y4%m2%d2.t%h2z.txt -#END -#BEGIN aura_mlsoz_text => mlsoz.%y4%m2%d2.t%h2z.txt -# Note the difference between v2.2 and v3.3. -# 00000000_00z-00000000_00z 060000 /archive/u/kwargan/data/MLSv3.3/aver/Y%y4/M%m2/MLSoz.%y4%m2%d2.t%h2z.txt -# 00000000_00z-00000000_00z 060000 /archive/u/kwargan/data/MLSv2.2/txt/aver/Y%y4/M%m2/MLSoz.%y4%m2%d2.t%h2z.txt -#END - -# EOSMLSt level 2b in BUFR -# -------------- -#BEGIN aura_mlst_bufr => MLSt.%y4%m2%d2.t%h2z.bufr -# Note this is the same data as in gmao_mlst_bufr -# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/gmao_mls_bufr/te_v3_bufr/Y%y4/M%m2/MLSt.%y4%m2%d2.t%h2z.ublk -#END -#BEGIN gmao_mlst_bufr => MLSt.%y4%m2%d2.t%h2z -# Note this is the same data as in aura_mlst_bufr -# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/gmao_mls_bufr/te_v3_bufr/Y%y4/M%m2/MLSt.%y4%m2%d2.t%h2z.ublk -#END - -#AURA OMI totoz+eff., NetCDF data -#------------------------- BEGIN aura_omieff_nc => omieff.%y4%m2%d2.t%h2z.nc - 20041231_18z-20111231_18z 060000 /archive/input/dao_ops/obs/reanalysis/omi_eff/netcdf/Y%y4/M%m2/OMIeff.%y4%m2%d2_%h2z.nc + 20041001_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/reanalysis/omi_eff_adjusted/Y%y4/M%m2/OMIeff-adj.%y4%m2%d2_%h2z.nc END -#Nimbus-07 TOMS -#BEGIN nim07_tomseff_nc => tomseff.%y4%m2%d2.t%h2z.nc -# 00000000_00z-00000000_00z 060000 /archive/u/kwargan/data/TOMS/NETCDF/Y%y4/M%m2/TOMSeff.%y4%m2%d2_%h2z.nc -#END -#Earth-Probe TOMS -#BEGIN ep_tomseff_nc => tomseff.%y4%m2%d2.t%h2z.nc -# 00000000_00z-00000000_00z 060000 /archive/u/kwargan/data/EPTOMS/NETCDF/Y%y4/M%m2/TOMSeff.%y4%m2%d2_%h2z.nc -#END - -# AURA MLS near real time -BEGIN mls_nrt_nc => mlsnc.%y4%m2%d2.t%h2z.nc -# 20140723_00z-20180331_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRToz.%y4%m2%d2_%h2z.nc -# 20180401_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRT-v4.2-oz.%y4%m2%d2_%h2z.nc - 20140723_00z-20140815_18z 060000 /archive/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRToz.%y4%m2%d2_%h2z.nc - 20140818_00z-20180331_18z 060000 /archive/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRToz.%y4%m2%d2_%h2z.nc - 20180401_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/mls_oz_nrt/netcdf/mls_oz_nrt/Y%y4/M%m2/MLSNRT-v4.2-oz.%y4%m2%d2_%h2z.nc -END - -# TRMM TMI 1B11 brightness temperature -#------------------------- -#BEGIN tmi_bufr => tmi.%y4%m2%d2.t%h2z.bufr -# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/obs_data/tmi/tmi_bufr/Y%y4/M%m2/tmi.%y4%m2%d2.t%h2z.bufr -#END - -# GPM GMI 1B brightness temperature -#------------------------- -#BEGIN gmis1_bufr => gmis1.%y4%m2%d2.t%h2z.bufr -# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/obs_data/gmi/gmi_bufr_data/V01D/1B/Y%y4/M%m2/gmi_nrt_L1B_S1.%y4%m2%d2.t%h2z.bufr -# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/obs_data/gmi/gmi_bufr_data/V02A/1B/Y%y4/M%m2/gmi_nrt_L1B_S1.%y4%m2%d2.t%h2z.bufr -#END -#BEGIN gmis2_bufr => gmis2.%y4%m2%d2.t%h2z.bufr -# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/obs_data/gmi/gmi_bufr_data/V01D/1B/Y%y4/M%m2/gmi_nrt_L1B_S2.%y4%m2%d2.t%h2z.bufr -# 00000000_00z-00000000_00z 060000 /archive/u/jjin3/obs_data/gmi/gmi_bufr_data/V02A/1B/Y%y4/M%m2/gmi_nrt_L1B_S2.%y4%m2%d2.t%h2z.bufr -#END -# GPM GMI 1CR brightness temperature -#------------------------- -BEGIN gmao_gmi_bufr => gmi.%y4%m2%d2.t%h2z.bufr -# V03A - 20140304_18z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/gmi/bufr/gmi/Y%y4/M%m2/gmi_L1CR.%y4%m2%d2.t%h2z.bufr -END - -# RapidScat Scatterometer Surface Winds onboard ISS -#------------------------- -BEGIN rscat_bufr => rscat.%y4%m2%d2.t%h2z.bufr_d.ublk - 20150501_00z-20170501_12z 060000 /archive/input/dao_ops/ops/flk/rapidscat/bufr/rapidscat/Y%y4/M%m2/rscat.%y4%m2%d2.%h2z.bufr -END - -# Suomi NPP OMPS-Limb Profiler near real time -BEGIN ompslp_nc => ompslpnc.%y4%m2%d2.t%h2z.nc - 20120101_00z-20160930_18z 060000 /archive/u/kwargan/data/OMPS-LP/NetCDF_error_x_1.5/Y%y4/M%m2/OMPS-LPoz.%y4%m2%d2_%h2z.nc -END -# OMPS-NPP -# -------- -BEGIN npp_ompsnm_bufr => OMPS-TC_v2r0_npp.t%y4%m2%d2.%h2z.ubufr - 20180227_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/OMPS-TC/bufr/OMPS-TC/Y%y4/M%m2/OMPS-TC_v2r0_npp.t%y4%m2%d2.%h2z.bufr -END -BEGIN npp_ompsnp_bufr => OMPS-NP_v2r0_npp.t%y4%m2%d2.%h2z.ubufr - 20180227_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/OMPS-NP/bufr/OMPS-NP/Y%y4/M%m2/OMPS-NP_v2r0_npp.t%y4%m2%d2.%h2z.bufr -END - -# Aircraft metadata for GSI temperature bias correction -BEGIN ncep_acftpfl_bufr => gdas1.%y4%m2%d2.t%h2z.prepbufr.acft_profiles.ublk - 20160511_00z-21001231_18z 060000 /archive/input/dao_ops/ops/flk/ncep_NotUsed/bufr/AIRCFT/Y%y4/M%m2/gdas1.%y4%m2%d2.t%h2z.prepbufr.acft_profiles +# MLS retrieved temperature +BEGIN gmao_mlst_bufr => MLSt.%y4%m2%d2.t%h2z.bufr + 20040813_00z-20150531_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/reanalysis/mls/temperature_v3/bufr/Y%y4/M%m2/MLSt.%y4%m2%d2.t%h2z.bufr + 20150601_00z-21001231_18z 060000 /discover/nobackup/projects/gmao/input/dao_ops/ops/reanalysis/mls/temperature_v4/bufr/Y%y4/M%m2/MLSt_v4.%y4%m2%d2.t%h2z.bufr END diff --git a/GMAO_etc/parallel-untar.py b/GMAO_etc/parallel-untar.py new file mode 100755 index 00000000..6dc7f946 --- /dev/null +++ b/GMAO_etc/parallel-untar.py @@ -0,0 +1,223 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# From: https://github.com/parallel-fs-utils/multi-thread-posix/blob/master/parallel-untar.py +# +# parallel-untar.py - unpack tarball subdirectories in parallel +# +# copyright (c) 2015 Ben England, Red Hat, under Apache license +# see http://www.apache.org/licenses/LICENSE-2.0 for license details + +import os +import errno +import tarfile + +# we use multiprocessing module to create separate sub-processes and avoid +# the constraints of the python GIL + +import multiprocessing +import sys +import time + +debug = (os.getenv('DEBUG') is not None) + +NOTOK = 1 # process failure exit status + + +def usage(msg): + print('ERROR: ' + msg) + print('usage: parallel-untar.py your-file.tar [ max-threads ]') + sys.exit(NOTOK) + +fmt_dangling_link = \ + 'ERROR: %s is a link pointing to an absolute pathname that does not exist' +fmt_link2nonexistent = \ + '%s is a link pointing to a relative non-existent file' + +# parse command line inputs + +thread_count = 4 +start_time = time.time() + +if len(sys.argv) > 2: + try: + thread_count = int(sys.argv[2]) + except ValueError as e: + usage('could not parse thread count %s' % sys.argv[2]) +elif len(sys.argv) < 2: + usage('must supply .tar file') +fn = sys.argv[1] +if fn == '--help' or fn == '-h': + usage('so you need help, we all knew that ;-)') +print('untarring file %s with up to %d parallel threads' % (fn, thread_count)) +if not fn.endswith('.tar'): + usage('parallel-untar.py does not yet support compressed tar files' + + 'uncompress first to .tar file then run it on that') +if not os.path.exists(fn): + usage('does not exist: %s' % fn) + + +# this class partitions directories in tar file amongst worker threads +# in a static way +# (thread k handles all directories with index d mod thread_count == k ) +# so that no preprocessing is needed + +class untarThread(multiprocessing.Process): + + def __init__( + self, parent_conn_in, child_conn_in, + index_in, thread_count_in, archive_path_in): + + # init base class + + multiprocessing.Process.__init__(self) + + # save thread inputs for run() + + self.parent_conn = parent_conn_in + self.child_conn = child_conn_in + self.index = index_in + self.thread_count = thread_count_in + self.archive_path = archive_path_in + + # counters for reporting + + self.file_count = 0 + self.dir_count = 0 + self.dir_create_collisions = 0 + + def __str__(self): + return 'untarThread %d %s %s' % (self.index, self.archive_path) + + def run(self): + my_dirs = {} + link_queue = [] + archive = tarfile.open(name=self.archive_path) + archive.errorlevel = 2 # want to know if errors + count = self.thread_count - 1 + for m in archive: # for each thing in the tarfile + if m.isdir(): # if a directory + stripped_name = m.name.strip(os.sep) # remove any trailing '/' + count += 1 + if count >= thread_count: + count = 0 + if count == self.index: + if debug: + print('thread %d recording on count %d dir %s' % + (self.index, count, stripped_name)) + # value doesn't matter, my_dirs is just a set + my_dirs[stripped_name] = self.index + try: + archive.extract(m) + except OSError as e: + # race condition if > 1 thread + # creating a common parent directory, + # just back off different amounts + # so one of them succeeds. + + if e.errno == errno.EEXIST: + time.sleep(0.1 * self.index) + self.dir_create_collisions += 1 + archive.extract(m) + else: + raise e + if debug: + print('%d got dir %s' % (self.index, m.name)) + self.dir_count += 1 + else: + # if not a directory + dirname = os.path.dirname(m.name) + # ASSUMPTION: directory object is always read from tarfile + # before its contents + if dirname in my_dirs: + if m.islnk() or m.issym(): + print('link %s -> %s' % (m.name, m.linkname)) + if not os.path.exists(m.linkname): + if m.linkname.startswith(os.sep): + if debug: + print(fmt_dangling_link % m.linkname) + else: + # BUT DO IT ANYWAY, that's what tar xf does! + # FIXME: how do we know if link target is a + # file within the untarred directory tree? + # Only postpone link creation for these. + + if debug: + print(fmt_link2nonexistent % m.linkname) + link_queue.append(m) + continue + try: + archive.extract(m) # not a link or dir at this point + except OSError as e: + if not (e.errno == errno.EEXIST and m.issym()): + raise e + if debug: + print('%d got file %s' % (self.index, m.name)) + self.file_count += 1 + + # we postpone links to non-existent files in case other threads + # need to create target files + # these links are created after + # all other subprocesses have finished directories and files + # to ensure that this succeeds. + + self.child_conn.send('y') + # block until all subprocesses finished above loop + self.child_conn.recv() + + # now it should be safe to create softlinks that point within this tree + + for m in link_queue: + try: + archive.extract(m) + except OSError as e: + if not (e.errno == errno.EEXIST and m.issym()): + raise e + if debug: + print('%d got file %s' % (self.index, m.name)) + self.file_count += 1 + archive.close() + self.child_conn.send((self.file_count, self.dir_count, + self.dir_create_collisions)) + + +# create & start worker threads, wait for them to finish + +worker_pool = [] +for n in range(0, thread_count): + (parent_conn, child_conn) = multiprocessing.Pipe() + t = untarThread(parent_conn, child_conn, n, thread_count, fn) + worker_pool.append(t) + t.daemon = True + t.start() +if debug: + print('thread pool: ' + str(worker_pool)) + +# implement barrier for softlink creation within the tree + +for t in worker_pool: + assert t.parent_conn.recv() == 'y' +for t in worker_pool: + t.parent_conn.send('y') +elapsed_time = time.time() - start_time +print('reached softlink barrier at %7.2f sec' % elapsed_time) + +total_files = 0 +total_dirs = 0 +for t in worker_pool: + (w_file_count, w_dir_count, w_dir_create_collisions) = \ + t.parent_conn.recv() + t.join() + print('thread %d file-count %d dir-count %d create-collisions %d' % + (t.index, w_file_count, w_dir_count, w_dir_create_collisions)) + total_files += w_file_count + total_dirs += w_dir_count + +elapsed_time = time.time() - start_time +print('all threads completed at %7.2f sec' % elapsed_time) + +fps = total_files / elapsed_time +print('files per sec = %9.2f' % fps) + +dps = total_dirs / elapsed_time +print('directories per sec = %8.2f' % dps) diff --git a/GMAO_etc/pyrob b/GMAO_etc/pyrob index e8628305..8df5e1ed 100755 --- a/GMAO_etc/pyrob +++ b/GMAO_etc/pyrob @@ -81,6 +81,9 @@ class Writer(object): elif len(dims) == 4: a, b, c, d = dims dim = get1d(a) + get1d(b) + get1d(c) + get1d(d) + elif len(dims) == 5: + a, b, c, d, e = dims + dim = get1d(a) + get1d(b) + get1d(c) + get1d(d) + get1d(e) else: raise ValueError, 'invalid dimensions: %s for <%s>'%(str(dims),vname) descr = var.long_name.replace('__ENSEMBLE__','').replace('_',' ') @@ -100,48 +103,89 @@ class Writer(object): # Defaults deverived from collection name # --------------------------------------- - if Name[0][0:4].upper() == 'TAVG': + if options.geosit: + sampfield = 1 + else: + sampfield = 0 + if Name[sampfield][0:4].upper() == 'TAVG': sampling = 'Time-Averaged' - elif Name[0][0:4].upper() == 'INST': + elif Name[sampfield][0:4].upper() == 'INST': sampling = 'Instantaneous' - elif Name[0][0:4].upper() == 'CONS': + elif Name[sampfield][0:4].upper() == 'CONS': sampling = 'Invariant' else: sampling = 'unknown' - try: - freq = Name[0][4]+'-Hourly' # not robust - except: - freq = 'unknown' - - dim = Name[1] + if options.geosit: + if Name[2][-2:].lower() == 'mn': + freq = Name[2][:-2]+'-minutes' + elif Name[2][-2:].lower() == 'hr': + freq = Name[2][:-2]+'-hourly' + else: + freq = 'Unknown' + else: + try: + freq = Name[0][4]+'-Hourly' # not robust + except: + freq = 'unknown' - if options.dyamond and 'Invariant' not in sampling: - resfield = 4 + if options.geosit: + if Name[5] == 'slv': + dim = '2d' + else: + dim = '3d' + else: + dim = Name[1] + + if options.geosit: + hresfield = 4 + vresfield = 5 + vreschar = 0 + elif options.dyamond and 'Invariant' not in sampling: + hresfield = 4 + vresfield = 4 + vreschar = 1 else: - resfield = 3 + hresfield = 3 + vresfield = 3 + vreschar = 1 onCube = False - if Name[resfield][0] == 'C': - res = 'Coarsened Horizontal Resolution' - elif Name[resfield][0] == 'N': - res = 'Full Horizontal Resolution' - elif Name[resfield][0] == 'M': - onCube = True - res = 'Full Horizontal Resolution On Cube' + if options.geosit: + if Name[3] == 'glo': + region = "Global" + else: + region = "Regional" + if Name[hresfield][0] == 'L': + res = region + ' Horizontal Resolution' + elif Name[hresfield][0] == 'C': + onCube = True + res = region + ' Horizontal Resolution On Cube' + else: + res = 'Unknown resolution' else: - res = 'Unknown resolution' + if Name[hresfield][0] == 'C': + res = 'Coarsened Horizontal Resolution' + elif Name[hresfield][0] == 'N': + res = 'Full Horizontal Resolution' + elif Name[hresfield][0] == 'M': + onCube = True + res = 'Full Horizontal Resolution On Cube' + else: + res = 'Unknown resolution' - if Name[resfield][1] == 'v': + if Name[vresfield][vreschar] == 'v': level = 'Model-Level' - elif Name[resfield][1] == 'e': + elif Name[vresfield][vreschar] == 'e': level = 'Model-Edge-Level' - elif Name[resfield][1] == 'p': + elif Name[vresfield][vreschar] == 'p': level = 'Pressure-Level' - elif Name[resfield][1] == 'x': + elif Name[vresfield][vreschar] == 'x': level = 'Single-Level' - elif Name[resfield][1] == 'z': + elif Name[vresfield][vreschar] == 'z': level = 'Height-Level' + elif Name[vresfield] == 'slv': + level = 'Single-Level' else: level = 'unknown' @@ -157,6 +201,14 @@ class Writer(object): if options.nature: dim_, freq, sampling, level, res = Title[:5] descr = ','.join(Title[5:])[:-2] + elif options.geosit: + if sampling == "Invariant": + #dim_, freq, sampling, level = Title[:4] + descr = "Constant Fields" + else: + #dim_, freq, sampling, level = Title[:4] + #print(Title) + descr = ','.join(Title[5:]) elif options.merraobs: dim_, freq, sampling, level = Title[:4] descr = ','.join(Title[4:]) @@ -169,11 +221,15 @@ class Writer(object): descr = ','.join(Title[4:]) else: descr = 'fix me, please' - - #if Coll.LongName is not None: - # Descr = Coll.LongName.split()[4:] - # descr = ' '.join(Descr) - + + if options.geosit: + if Coll.LongName is not None: + Descr = Coll.LongName.split()[4:] + descr = ' '.join(Descr) + if "edge" in descr: + level = "Model-Level Edge" + descr = descr.title() + descr = descr.replace('Forecast,','').replace('Assimilation,','').replace('Analysis,','').replace('Model,','') # Section Header @@ -207,6 +263,15 @@ class Writer(object): else: self.property("Dimensions","longitude=%d, latitude=%d, level=%d, time=%d "%(Coll.nx,Coll.ny,Coll.nz,Coll.nt)) + # Maybe to print out levels?? + #if options.geosit: + #if 'lev' in Coll.nc.variables: + #levsFR = Coll.nc.variables["lev"][:].tolist() + #print(type(levsFR[1])) + #levels = Coll.nc.variables["lev"] + #vunits = levels.units + #vLN = levels.long_name + #self.property("Levels","%s (%s)"%(levsFR,vunits)) usize = 'MB' gsize = int(float(Coll.size)/(1024.*1024.)+0.5) @@ -549,6 +614,10 @@ if __name__ == "__main__": action="store_true", dest="dyamond", help="Assume DYAMOND file name conventions") + parser.add_option( "--geosit", + action="store_true", dest="geosit", + help="Assume GEOS-IT file name conventions") + parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help="Verbose mode.") @@ -572,11 +641,12 @@ if __name__ == "__main__": # Only one type of files # ---------------------- n = 0 - if options.merra: n+=1 - if options.nature: n+=1 + if options.merra: n+=1 + if options.nature: n+=1 if options.merraobs: n+=1 - if options.dyamond: n+=1 - if options.fp: n+=1 + if options.dyamond: n+=1 + if options.fp: n+=1 + if options.geosit: n+=1 if n>1: raise 'ValueError', 'only one of -N, -M, -F can be specified' @@ -628,9 +698,13 @@ if __name__ == "__main__": elif options.fp: collname = os.path.basename(fname).split('.')[3] colltype = None + elif options.geosit: + collname = os.path.basename(fname).split('.')[3] + colltype = None else: collname = os.path.basename(fname).split('.')[1] colltype = None + #print(collname) if colltype: Name = colltype.split('_') @@ -664,6 +738,16 @@ if __name__ == "__main__": else: prefix = 'd' name = prefix + collname CollNames[name] = collname + elif options.geosit: + for collname in Files: + name, freq, dur, dim, hres, vres = collname.split('_') + + if freq == 'const': prefix = 'a' + elif hres[0] == 'L': prefix = 'b' + elif hres[0] == 'C': prefix = 'c' + else: prefix = 'd' + name = prefix + collname + CollNames[name] = collname else: for collname in Files: freq, dim, name, res = collname.split('_') @@ -682,6 +766,7 @@ if __name__ == "__main__": print "[] Working on collection <%s>"%collname fname = Files[collname] Collection = getCollection(fname,collname,options,colltype) + #print("MAT Collection: ", Collection) if cf is not None: try: rcn = collname+'.descr' diff --git a/GMAO_etc/pyrob_CF b/GMAO_etc/pyrob_CF new file mode 100755 index 00000000..1202a5eb --- /dev/null +++ b/GMAO_etc/pyrob_CF @@ -0,0 +1,591 @@ +#!/usr/bin/env python + +""" + Utility to generate GEOS-5 file spec information, a.k.a. + the Rob Lucchesi emulator. + + Arlindo da Silva, February 2014. + +""" + +import os +import sys + +from optparse import OptionParser +from netCDF4 import Dataset +from MAPL import Config +from netCDF4 import MFDataset + +try: + from PyRTF import * + HAS_RTF = True +except ImportError: + try: + from rtfw import * + HAS_RTF = True + except: + HAS_RTF = False + +if HAS_RTF: + + nNAME = int(TabPS.DEFAULT_WIDTH * 2.5) + nDIMS = int(TabPS.DEFAULT_WIDTH * 1) + nDESC = int(TabPS.DEFAULT_WIDTH * 7.5) + nUNIT = int(TabPS.DEFAULT_WIDTH * 2) + #grey_bkg = ShadingPS(shading='Grey') + thin_edge = BorderPS( width=5, style=BorderPS.SINGLE ) + normal_edge = BorderPS( width=20, style=BorderPS.SINGLE ) + thick_edge = BorderPS( width=40, style=BorderPS.SINGLE ) + none_edge = BorderPS( width=0, style=BorderPS.SINGLE ) + header_frame = FramePS( None, normal_edge, thick_edge, normal_edge ) + header_frameL = FramePS( None, None, thick_edge, normal_edge ) + header_frameR = FramePS( None, normal_edge, thick_edge, None ) + thin_frame = FramePS( thin_edge, normal_edge, thin_edge, normal_edge ) + thin_frameL = FramePS( thin_edge, None, thin_edge, normal_edge ) + thin_frameR = FramePS( thin_edge, normal_edge, thin_edge, None ) + +# ----- +class Spec(object): +# ----- + """ + Generic container for Variables + """ + def __init__(self,name): + self.name = name + self.section = 0 + +#................................................................................................. + +# ------ +class Writer(object): +# ------ + """ + Base class for writer. + """ + def writeVariable(self,vname,var): + """ + Write row for a single variable. + """ + dims = var.dimensions + if len(dims) == 2: + a, b = dims + dim = get1d(a) + get1d(b) + elif len(dims) == 3: + a, b, c = dims + dim = get1d(a) + get1d(b) + get1d(c) + elif len(dims) == 4: + a, b, c, d = dims + dim = get1d(a) + get1d(b) + get1d(c) + get1d(d) + else: + raise ValueError, 'invalid dimensions: %s for <%s>'%(str(dims),vname) + descr = var.long_name.replace('__ENSEMBLE__','').replace('_',' ') + self.row(vname,dim,descr,var.units) + + def doCollection(self,Coll,options): + """ + Write spec for a given collection. + """ + + Title = Coll.title.split(',') + Name = Coll.name.split('_') + + # Defaults deverived from collection name + # --------------------------------------- + if Name[1][0:3] == 'TAVG': + sampling = 'Time-Averaged' + elif Name[1][0:3] == 'INST': + sampling = 'Instantaneous' + else: + sampling = 'unknown' + + if Name[2][0:3].lower() == 'mn': + freq = Name[2][0:1]+'-minutes' + elif Name[2][0:3].lower() == 'hr': + freq = Name[2][0:1]+'-hourly' # How to make sure it only grabs the numerical values at start? i.e., 1hr vs 24hr. + else: + freq = 'Unknown' + + if Name[3][0] == 'g': + res = 'Full Horizontal Resolution' # On Cube' #Our way doesn't say if on the cube; but it gives a resolution that matches the cube? + #dim = Name[3] #Hopefully this picks up the full g1440x721 or whatever it is + elif Name[3][0] == 'r': + res = 'Subset region of Full Horizontal Resolution' + #dim = Name[3] + else: + res = 'Unknown resolution' + + if Coll.nz<=1: + dim = '2D' + elif Coll.nz>1: + dim = '3D' + else: + dim = 'Unknown dimension' + + + +# if Name[3][0] == '': +# res = 'Coarsened Horizontal Resolution' +# elif Name[3][0] == 'N': +# res = 'Full Horizontal Resolution' +# elif Name[3][0] == 'M': +# res = 'Full Horizontal Resolution On Cube' +# else: +# res = 'Unknown resolution' + + if Name[4][0] == 'v': + no_lvs = Name[4][0:2].lower() #Not sure how we want to use this as we have non-conventional numbers of levels. Do we want additive, i.e., '72 Model-Level', '1 Model-Level' if v1, is it always lowest model level? + level = 'Model-Level' + elif Name[4][0] == 'e': + level = 'Model-Edge-Level' + elif Name[4][0] == 'p': + level = 'Pressure-Level' + elif Name[4][0] == 'x': + level = 'Single-Level' + elif Name[4][0] == 'z': + level = 'Height-Level' + elif Name[4][0] == 'h': + level = 'Theta-Level' + elif Name[4][0] == 'd': + level = 'Iserteric-Level' #PV surface + else: + level = 'unknown' + + + if Title[0] == 'Invariants': + dim, freq, sampling, level = ('2d','invariants','time independent', 'surface') + descr = Title[1] + else: + if options.nature: + dim_, freq, sampling, level, res = Title[:5] + descr = ','.join(Title[5:])[:-2] + elif options.merra: + dim_, freq, sampling, level = Title[:4] + descr = ','.join(Title[5:]) #[:-2].replace("'","") + else: + if len(Title) >= 4: + dim_, freq, sampling, level = Title[:4] + descr = ','.join(Title[4:]) + else: + descr = 'fix me, please' + + #if Coll.LongName is not None: + # Descr = Coll.LongName.split()[4:] + # descr = ' '.join(Descr) + + descr = descr.replace('Forecast,','').replace('Assimilation,','').replace('Analysis,','') + + # Section Header + # -------------- + if Coll.ShortName is None: + self.section(Coll.name,descr) + else: + cname = Coll.name + ' (%s)'%str(Coll.ShortName) + self.section(cname,descr) + + # Properties + # ---------- + if Coll.tbeg is None: + self.property('Frequency',"%s (%s)"%(freq.lower(),sampling.lower())) + else: + date,time = Coll.tbeg.split('T') + tbeg = time[:5]+' UTC' + if sampling == 'Time-Averaged': + self.property('Frequency',"%s centered on %s (%s)"%(freq.lower(),tbeg,sampling.lower())) + else: + self.property('Frequency',"%s from %s (%s)"%(freq.lower(),tbeg,sampling.lower())) + self.property("Spatial Grid","%s, %s, %s"%(dim.upper(),level.lower(),res.lower())) + if Coll.nz<1: + self.property("Dimensions","longitude=%d, latitude=%d, time=%d "%(Coll.nx,Coll.ny,Coll.nt)) + else: + self.property("Dimensions","longitude=%d, latitude=%d, level=%d, time=%d "%(Coll.nx,Coll.ny,Coll.nz,Coll.nt)) + levsFR = Coll.nc.variables["lev"][:] + levels = Coll.nc.variables["lev"] + vunits = levels.units + vLN = levels.long_name + self.property("%s"%(vLN),"%s (%s)"%(levsFR,vunits)) + usize = 'MB' +# gsize = int(float(Coll.size)/(1024.*1024.)+0.5) #Does not like the int(). TypeError: 'str' object is not callable + gsize = float(Coll.size)/(1024.*1024.)+0.5 + if ( gsize>1024): + usize = 'GB' + gsize = float(Coll.size)/(1024*1024.*1024.)+0.05 + self.property("Granule Size","~%3.1f %s"%(gsize,usize)) + else: + self.property("Granule Size","~%d %s"%(gsize,usize)) + + # Variable table + # -------------- + self.table('header') + for vname in sorted(Coll.variables): + self.writeVariable(vname, Coll.variables[vname] ) + self.table('footer') + +#................................................................................................. + +# --------- +class stdoutWriter(Writer): +# --------- + """ + Implements text file writer. + """ + def __init__(self,filename=None): + self.filename = filename # ignore this for now. + self.secn = 0 + def section(self,collection,description): + self.secn += 1 + print + print + print "%d) Collection %s: %s"%(self.secn,collection,description) + print + def property(self,name,value): + print "%19s: %s"%(name,value) + def table(self,choice='header'): + if choice == 'header': + print + print " ---------------------------------|------|---------------------------------------------------------------------------------------------------------------|------------" + print " Name | Dims | Description | Units " + print " ---------------------------------|------|---------------------------------------------------------------------------------------------------------------|------------" + return + def row(self,vname,dim,descr,units): + print ' %-32s | %4s | %-109s | %-10s '%(vname,dim,descr,units) + + def close(self): + pass + +#................................................................................................. + +# --------- +class txtWriter(Writer): +# --------- + """ + Implements text file writer. + """ + def __init__(self,filename=None): + self.filename = filename # ignore this for now. + self.doc = open(filename,'w') + self.secn = 0 + def section(self,collection,description): + self.secn += 1 + self.doc.write("\n") + self.doc.write("\n") + self.doc.write( "%d) Collection %s: %s\n"%(self.secn,collection,description) ) + self.doc.write("\n") + def property(self,name,value): + self.doc.write( "%19s: %s\n"%(name,value) ) + def table(self,choice='header'): + if choice == 'header': + self.doc.write("\n") + self.doc.write( " ---------------------------------|------|---------------------------------------------------------------------------------------------------------------|------------\n" ) + self.doc.write( " Name | Dims | Description | Units \n" ) + self.doc.write( " ---------------------------------|------|---------------------------------------------------------------------------------------------------------------|------------\n" ) + return + def row(self,vname,dim,descr,units): + self.doc.write( ' %-32s | %4s | %-109s | %-10s \n'%(vname,dim,descr,units) ) + + def close(self): + self.doc.close() + +#................................................................................................. + +# --------- +class rtfWriter(Writer): +# --------- + """ + Implements RTF file writer. + """ + def __init__(self,filename): + self.filename = filename # ignore this for now. + self.doc = Document(style_sheet=MakeMyStyleSheet()) + self.ss = self.doc.StyleSheet + self.secn = 0 + self.Section = Section() + self.doc.Sections.append(self.Section) + def skip(self): + p = Paragraph(self.ss.ParagraphStyles.Normal) + p.append('') + self.Section.append(p) + def section(self,collection,description): + self.secn += 1 + font = font=self.ss.Fonts.Arial + p = Paragraph(self.ss.ParagraphStyles.Heading3) + # p.append(TEXT('%d) Collection '%self.secn,font=font)) + # p.append(TEXT('Collection ',font=font)) + # p.append(TEXT(collection,colour=self.ss.Colours.Blue,font=font)) + # p.append(TEXT(': %s'%str(description),font=font)) + p.append(TEXT(collection,colour=self.ss.Colours.Blue)) + p.append(TEXT(': %s'%str(description))) + self.Section.append(p) + self.skip() + def property(self,name,value): + s = str("%s: %s"%(name,value)) + p = Paragraph(self.ss.ParagraphStyles.Normal) + p.append(TEXT(' '+name+': ',bold=True),TEXT(str(value),bold=False,italic=True)) + #p.append(TAB,s) + self.Section.append(p) + def table(self,choice='header'): + if choice == 'header': + self.Table = Table(nNAME,nDIMS,nDESC,nUNIT) + c1 = Cell( Paragraph(TEXT(' Name',bold=True,italic=True)),header_frameL) + c2 = Cell( Paragraph(TEXT(' Dim',bold=True,italic=True)),header_frame) + c3 = Cell( Paragraph(TEXT(' Description',bold=True,italic=True)),header_frame) + c4 = Cell( Paragraph(TEXT(' Units',bold=True,italic=True)),header_frameR) + self.Table.AddRow(c1, c2, c3, c4) + else: + self.skip() + self.Section.append(self.Table) + self.skip() + def row(self,vname,dim,descr,units): + #print ' %-10s | %4s | %-58s | %-10s '%(vname,dim,descr,units) + c1 = Cell(Paragraph(TEXT(str(vname))),thin_frameL) + c2 = Cell(Paragraph(TEXT(str(dim))),thin_frame) + c3 = Cell(Paragraph(TEXT(str(descr))),thin_frame) + c4 = Cell(Paragraph(TEXT(str(units))),thin_frameR) + self.Table.AddRow(c1, c2, c3, c4) + def close(self): + r = Renderer() + f = file(self.filename,'w') + r.Write(self.doc,f) + +# ------------- +def getCollection(filename,collname): +# ------------- + """ + Parses netCDF file and gathers collection metadata. + """ + Coll = Spec(collname) + Coll.size = os.path.getsize(filename) + Coll.nc = Dataset(filename) + Coll.variables = dict() + Coll.title = Coll.nc.Title + try: + Coll.LongName = Coll.nc.LongName + except: + Coll.LongName = None + try: + Coll.ShortName = Coll.nc.ShortName + except: + Coll.ShortName = None + Coll.nx = len(Coll.nc.dimensions['lon']) + Coll.ny = len(Coll.nc.dimensions['lat']) + try: + Coll.nt = len(Coll.nc.dimensions['time']) + except: + Coll.nt = 0 + try: + Coll.nz = len(Coll.nc.dimensions['lev']) + print Coll.nc.variables["lev"][:] + except: + Coll.nz = 0 + for v in Coll.nc.variables: + if v.upper() in ('LON', 'LAT', 'LEV','TIME', 'TAITIME' ): + continue + Coll.variables[v] = Coll.nc.variables[v] + #print Coll.variables[v] + try: + time = Coll.nc.variables['time'] + tunits = time.units + units, offset = time.units.split(' since ') + Coll.tbeg = offset.replace(' ','T') + except: + Coll.tbeg = None +# units, offset = levels.units.split(' since ') +# Coll.tbeg = offset.replace(' ','T') + + return Coll + +def get1d(dname): + return dname.replace('time','t').replace('lon','x').replace('lat','y').replace('lev','z') + + +def MakeMyStyleSheet( ): + + result = StyleSheet() + NormalText = TextStyle( TextPropertySet( result.Fonts.TimesNewRoman, 22 ) ) + ps = ParagraphStyle( 'Normal', + NormalText.Copy(), + ParagraphPropertySet( space_before = 60, + space_after = 60 ) ) + result.ParagraphStyles.append( ps ) + + ps = ParagraphStyle( 'Normal Short', + NormalText.Copy() ) + result.ParagraphStyles.append( ps ) + + NormalText.TextPropertySet.SetSize( 32 ) + ps = ParagraphStyle( 'Heading 1', + NormalText.Copy(), + ParagraphPropertySet( space_before = 240, + space_after = 60 ) ) + result.ParagraphStyles.append( ps ) + + NormalText.TextPropertySet.SetSize( 24 ).SetBold( True ) + ps = ParagraphStyle( 'Heading 2', + NormalText.Copy(), + ParagraphPropertySet( space_before = 240, + space_after = 60 ) ) + result.ParagraphStyles.append( ps ) + + NormalText.TextPropertySet.SetSize( 24 ).SetBold( True ).SetItalic(True) + ps = ParagraphStyle( 'Heading 3', + NormalText.Copy(), + ParagraphPropertySet( space_before = 240, + space_after = 60 ) ) + result.ParagraphStyles.append( ps ) + + # Add some more in that are based on the normal template but that + # have some indenting set that makes them suitable for doing numbered + normal_numbered = result.ParagraphStyles.Normal.Copy() + normal_numbered.SetName( 'Normal Numbered' ) + normal_numbered.ParagraphPropertySet.SetFirstLineIndent( TabPropertySet.DEFAULT_WIDTH * -1 ) + normal_numbered.ParagraphPropertySet.SetLeftIndent ( TabPropertySet.DEFAULT_WIDTH ) + + result.ParagraphStyles.append( normal_numbered ) + + normal_numbered2 = result.ParagraphStyles.Normal.Copy() + normal_numbered2.SetName( 'Normal Numbered 2' ) + normal_numbered2.ParagraphPropertySet.SetFirstLineIndent( TabPropertySet.DEFAULT_WIDTH * -1 ) + normal_numbered2.ParagraphPropertySet.SetLeftIndent ( TabPropertySet.DEFAULT_WIDTH * 2 ) + + result.ParagraphStyles.append( normal_numbered2 ) + + ## LIST STYLES + for idx, indent in [ (1, TabPS.DEFAULT_WIDTH ), + (2, TabPS.DEFAULT_WIDTH * 2), + (3, TabPS.DEFAULT_WIDTH * 3) ] : + indent = TabPropertySet.DEFAULT_WIDTH + ps = ParagraphStyle( 'List %s' % idx, + TextStyle( TextPropertySet( result.Fonts.Arial, 22 ) ), + ParagraphPropertySet( space_before = 60, + space_after = 60, + first_line_indent = -indent, + left_indent = indent) ) + result.ParagraphStyles.append( ps ) + + return result + +#------------------------------------ M A I N ------------------------------------ +if __name__ == "__main__": + + format = 'text' + history = 'none' + outFile = 'filespec.txt' + +# Parse command line options +# -------------------------- + parser = OptionParser(usage="Usage: %prog [OPTIONS] netcdf_file(s)", + version='1.1.0' ) + + parser.add_option("-o", "--output", dest="outFile", default=outFile, + help="Output file name for the File Spec, ignored for format 'stdout' (default=%s)"\ + %outFile ) + + parser.add_option("-f", "--format", dest="format", default=format, + help="Output file format: one of 'stdout', 'text', 'rtf' (default=%s)"%format ) + + parser.add_option("-H", "--history", dest="history", default=None, + help="Optional HISTORY.rc resource file (default=None)") + + parser.add_option("-M", "--merra", + action="store_true", dest="merra", + help="Assume MERRA-2 file name conventions") + + parser.add_option("-N", "--nature", + action="store_true", dest="nature", + help="Assume Nature Run file name conventions") + + parser.add_option("-F", "--forward_processing", + action="store_true", dest="fp", + help="Assume Forward Processing file name conventions") + + parser.add_option("-v", "--verbose", + action="store_true", dest="verbose", + help="Verbose mode.") + + (options, inFiles) = parser.parse_args() + + if len(inFiles) < 1: + parser.error("must have 1 afile name") + + # Load HISTORY.rc if specified + # ---------------------------- + if options.history is not None: + cf = Config(options.history) + Descr = dict() + for v in cf.keys(): + v_ = v.replace('-.descr','.descr') + Descr[v_] = cf(v) + else: + cf = None + + # Only one type of files + # ---------------------- + n = 0 + if options.merra: n+=1 + if options.nature: n+=1 + if options.fp: n+=1 + if n>1: + raise 'ValueError', 'only one of -N, -M, -F can be specified' + + # Instantiate writer + # ------------------ + name, ext = os.path.splitext(options.outFile) + if 'text' in options.format: + options.outFile = name + '.txt' + writer = txtWriter(options.outFile) + elif 'stdout' in options.format: + options.outFile = name + '.txt' + writer = stdoutWriter(options.outFile) + elif 'rtf' in options.format: + if not HAS_RTF: + raise ValueError, 'PyRTF is not installed, therefore format RTF is not available' + options.outFile = name + '.doc' + writer = rtfWriter(options.outFile) + else: + raise ValueError, "unsupported format <%s>"%options.format + + # Unique name of collections + # -------------------------- + Files = dict() + for fname in inFiles: + if options.nature: + collname = os.path.basename(fname).split('.')[1] + elif options.fp: + collname = os.path.basename(fname).split('.')[3] + else: + collname = os.path.basename(fname).split('.')[3] #[1] + Name = collname.split('_') + if len(Name) == 5: #4 + Files[collname] = fname + + # Sort collections by (res,name,freq,dim) + # -------------------------------------- + CollNames = dict() + for collname in Files: + name, freq, int, dim, res = collname.split('_') + if freq == 'const': prefix = 'a' + elif dim[0] == 'g': prefix = 'b' + elif dim[0] == 'r': prefix = 'c' + else: prefix = 'd' + name = prefix + collname + CollNames[name] = collname + + # Gather metadata for each collection + # ----------------------------------- + for name in sorted(CollNames): + collname = CollNames[name] + if options.verbose: + print "[] Working on collection <%s>"%collname + fname = Files[collname] + Collection = getCollection(fname,collname) + if cf is not None: + try: + rcn = collname+'.descr' + title = Descr[rcn][:-2].replace("'","") # override what is on file + Collection.title = title + except: + pass + writer.doCollection(Collection,options) + + # All done + # -------- + writer.close() diff --git a/GMAO_etc/rndasfiles b/GMAO_etc/rndasfiles index d9a32087..77428470 100755 --- a/GMAO_etc/rndasfiles +++ b/GMAO_etc/rndasfiles @@ -14,6 +14,7 @@ # 11Nov2009 Todling Initial code (very simple minded) # 04Dec2009 Todling Add purge and sfx opts # 02Dec2011 Todling Add opt clean +# 24Feb2020 Todling Allow for high freq background (up to 1mn) # #-------------------------------------------------- use Env; # make env vars readily available @@ -43,7 +44,11 @@ use lib ( "$FindBin::Bin", "$FVROOT/bin", "$ESMADIR/$ARCH/bin" ); # Special-handle first file # ------------------------- $nymd = $nymdb; $nhms = $nhmsb; -$hh = substr($nhms,0,2); +if ( $type =~ "internal" ) { + $hh = substr($nhms,0,2); +} else { + $hh = substr($nhms,0,4); +} $sfname = "$expid.$type.${nymd}_${hh}z.$suffix"; $efname = "$expid.$type.${nymd}_${hh}z.iter${idx}.$suffix"; if ( $idx >= 99 ) { @@ -73,7 +78,11 @@ if ( ! $opt_clean ) { # ---------------------------------- while ( $nymd != $nymde || $nhms != $nhmse ) { ($nymd,$nhms) = tick($nymd,$nhms,$dtmin*60); - $hh = substr($nhms,0,2); + if ( $type =~ "internal" ) { + $hh = substr($nhms,0,2); + } else { + $hh = substr($nhms,0,4); + } $sfname = "$expid.$type.${nymd}_${hh}z.$suffix"; $efname = "$expid.$type.${nymd}_${hh}z.iter${idx}.$suffix"; if ( $idx >= 99 ) { diff --git a/GMAO_etc/rst2rcyc b/GMAO_etc/rst2rcyc index 10f2caa4..14d4f63b 100644 --- a/GMAO_etc/rst2rcyc +++ b/GMAO_etc/rst2rcyc @@ -1,4 +1,4 @@ -#!@DASPERL@ +#!/usr/bin/env perl # # Script to copy restarts from rs location to recycle # @@ -12,7 +12,6 @@ use Env; # make env vars readily available use File::Basename; # for basename(), dirname() use File::Copy "cp"; # for cp() use Getopt::Long; # command line options -use Shell qw(cat); # cat command # Command line options # -------------------- diff --git a/GMAO_gfio/CMakeLists.txt b/GMAO_gfio/CMakeLists.txt index eefdac0a..b5a5e960 100644 --- a/GMAO_gfio/CMakeLists.txt +++ b/GMAO_gfio/CMakeLists.txt @@ -49,20 +49,23 @@ include_directories (${BASEDIR}/lib) include_directories (${include_${this}}) include_directories (${INC_NETCDF}) -if (F2PY_FOUND) +if (USE_F2PY) if (precision STREQUAL "r4") - add_f2py_module(GFIO_ SOURCES GFIO_py.F90 - DESTINATION lib/Python - ONLY gfioopen gfiocreate gfiodiminquire gfioinquire - gfiogetvar gfiogetvart gfioputvar gfiogetbegdatetime - gfiointerpxy gfiointerpnn gfiocoordnn gfioclose - LIBRARIES GMAO_gfio_r4 ${NETCDF_LIBRARIES} - INCLUDEDIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/lib ${BASEDIR}/lib ${include_${this}} ${INC_NETCDF} - USE_MPI - ) - add_dependencies(GFIO_ ${this}) + find_package(F2PY2) + if (F2PY2_FOUND) + esma_add_f2py2_module(GFIO_ SOURCES GFIO_py.F90 + DESTINATION lib/Python + ONLY gfioopen gfiocreate gfiodiminquire gfioinquire + gfiogetvar gfiogetvart gfioputvar gfiogetbegdatetime + gfiointerpxy gfiointerpnn gfiocoordnn gfioclose + LIBRARIES GMAO_gfio_r4 ${NETCDF_LIBRARIES} + INCLUDEDIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/lib ${BASEDIR}/lib ${include_${this}} ${INC_NETCDF} + USE_MPI + ) + add_dependencies(GFIO_ ${this}) + endif () endif () -endif (F2PY_FOUND) +endif () ecbuild_add_executable(TARGET GFIO_mean_${precision}.x SOURCES GFIO_mean.f90 LIBS GMAO_gfio_${precision} ) diff --git a/GMAO_hermes/CMakeLists.txt b/GMAO_hermes/CMakeLists.txt index 2802d412..eb8df43b 100644 --- a/GMAO_hermes/CMakeLists.txt +++ b/GMAO_hermes/CMakeLists.txt @@ -47,7 +47,7 @@ if ( NOT HERMES_LIGHT ) ecbuild_add_executable (TARGET dyn2prs.x SOURCES dyn2prs.f90 LIBS ${this}) ecbuild_add_executable (TARGET dyn2rs5.x SOURCES dyn2rs5.f90 LIBS ${this}) ecbuild_add_executable (TARGET dyn52dyn.x SOURCES dyn52dyn.f90 LIBS ${this}) - ecbuild_add_executable (TARGET dyndiff.x SOURCES dyndiff.f90 LIBS ${this}) + ecbuild_add_executable (TARGET dyndiff.x SOURCES dyndiff.f90 LIBS ${this} GEOS_Shared) ecbuild_add_executable (TARGET dyndims.x SOURCES dyndims.f LIBS ${this}) ecbuild_add_executable (TARGET dynp.x SOURCES dynp.f90 LIBS ${this}) ecbuild_add_executable (TARGET echorc.x SOURCES echorc.f90 LIBS ${this}) @@ -72,8 +72,10 @@ if ( NOT HERMES_LIGHT ) ecbuild_add_executable (TARGET dyn_efsens.x SOURCES dyn_efsens.f90 LIBS ${this}) ecbuild_add_executable (TARGET eta_echo.x SOURCES eta_echo.f90 LIBS ${this}) ecbuild_add_executable (TARGET dyn_inflate.x SOURCES dyn_inflate.f90 LIBS ${this}) + ecbuild_add_executable (TARGET dyn_blob.x SOURCES dyn_blob.f90 LIBS ${this}) + ecbuild_add_executable (TARGET dyn_fsens_conv.x SOURCES dyn_fsens_conv.f90 LIBS ${this}) - install(PROGRAMS cnv2prs.pl ana5sfc DESTINATION bin) + install(PROGRAMS cnv2prs.pl ana5sfc echorc.pl DESTINATION bin) else () @@ -88,5 +90,5 @@ endif () ecbuild_add_executable (TARGET write_eta.x SOURCES write_eta.F90 LIBS ${this}) -file(GLOB resource_files *.rc) +file(GLOB resource_files CONFIGURE_DEPENDS *.rc) install(FILES ${resource_files} DESTINATION etc) diff --git a/GMAO_hermes/cnv2prs.pl b/GMAO_hermes/cnv2prs.pl index 7335c590..0837b8b1 100755 --- a/GMAO_hermes/cnv2prs.pl +++ b/GMAO_hermes/cnv2prs.pl @@ -85,7 +85,7 @@ } if ($etabkgflg) { - @files = < *.bkg.eta.*_{00,06,12,18}z.nc4 >; + @files = < *.bkg.eta.*.nc4 >; @rcfiles = ( @eta_rc ); $lcvflg = "-lcv"; $subsetflg = ""; diff --git a/GMAO_hermes/dyn2dyn.f90 b/GMAO_hermes/dyn2dyn.f90 index 1a90d8ff..9f3c8368 100644 --- a/GMAO_hermes/dyn2dyn.f90 +++ b/GMAO_hermes/dyn2dyn.f90 @@ -74,6 +74,7 @@ program dyn2dyn ! Locals ! ------ character(len=255) msg + character(len=255), pointer :: xtrnames(:) integer, parameter :: READ_ONLY = 1 integer fid, nvars, ngatts integer ier, ifile @@ -95,7 +96,8 @@ program dyn2dyn prec, in, jn, kn, pick, nymd, nhms, myfreq, & fakedate, nymdf, nhmsf, & dophys, expid, RCfile, verbose, oldana, force, & - vectype, dgrid, ncep72, ncf, pncf, indxlevs ) + vectype, dgrid, ncep72, ncf, pncf, indxlevs, & + xtrnames ) ! Loop over input eta files @@ -126,18 +128,18 @@ program dyn2dyn ! -------------------------- if ( oldana ) then if ( pick ) then - call dyn_get ( etafile, nymd, nhms, w_e, ier, timidx=0, freq=freq, vectype=vectype, ncf=ncf, pncf=pncf ) + call dyn_get ( etafile, nymd, nhms, w_e, ier, timidx=0, freq=freq, vectype=vectype, ncf=ncf, pncf=pncf, xtrnames=xtrnames ) if ( myfreq/=0 ) freq = myfreq ! reset frequency to whatever user's want else - call dyn_get ( etafile, nymd, nhms, w_e, ier, timidx=n, freq=freq, vectype=vectype, ncf=ncf, pncf=pncf ) + call dyn_get ( etafile, nymd, nhms, w_e, ier, timidx=n, freq=freq, vectype=vectype, ncf=ncf, pncf=pncf, xtrnames=xtrnames ) endif nstep = mynstep else if ( pick ) then - call dyn_get ( etafile, nymd, nhms, w_e, ier, timidx=0, freq=freq, nstep=nstep, vectype=vectype, ncf=ncf, pncf=pncf ) + call dyn_get ( etafile, nymd, nhms, w_e, ier, timidx=0, freq=freq, nstep=nstep, vectype=vectype, ncf=ncf, pncf=pncf, xtrnames=xtrnames ) if ( myfreq/=0 ) freq = myfreq ! reset frequency to whatever user's want else - call dyn_get ( etafile, nymd, nhms, w_e, ier, timidx=n, freq=freq, nstep=nstep, vectype=vectype, ncf=ncf, pncf=pncf ) + call dyn_get ( etafile, nymd, nhms, w_e, ier, timidx=n, freq=freq, nstep=nstep, vectype=vectype, ncf=ncf, pncf=pncf, xtrnames=xtrnames ) endif endif if ( ier .ne. 0 ) then @@ -189,6 +191,7 @@ program dyn2dyn ! All done ! -------- + if(associated(xtrnames)) deallocate(xtrnames) call exit(0) CONTAINS @@ -207,7 +210,8 @@ subroutine Init_ ( mfiles, etafiles, nfiles, dynfile, lwifile, & prec, in, jn, kn, pick, nymd, nhms, myfreq, & fakedate, nymdf, nhmsf, & dophys, expid, RCfile, verbose, oldana, force, & - vectype, dgrid, ncep72, ncf, pncf, indxlevs ) + vectype, dgrid, ncep72, ncf, pncf, indxlevs, & + xtrnames ) implicit NONE @@ -240,6 +244,7 @@ subroutine Init_ ( mfiles, etafiles, nfiles, dynfile, lwifile, & logical, intent(out) :: ncf ! non-complaint dyn-file knob logical, intent(out) :: pncf ! non-complaint dyn-perturbation file knob logical, intent(out) :: indxlevs! index levels (in place of pressure levs) + character(len=*), pointer :: xtrnames(:) ! ! !REVISION HISTORY: @@ -259,10 +264,12 @@ subroutine Init_ ( mfiles, etafiles, nfiles, dynfile, lwifile, & character*4, parameter :: myname = 'init' integer iret, i, iarg, argc, iargc + integer ii,jj,ie,il integer uprec, iprec, ires, jcapusr logical verb, setres, geos4res, setjcap character(len=255) :: etafile, argv, res character*10 str + character(len=255) trnames integer, dimension(6), parameter :: IMS4 = (/ 72, 144, 288, 576, 1152, 2304 /) integer, dimension(6), parameter :: IMS5 = (/ 72, 144, 288, 576, 1152, 2304 /) @@ -275,7 +282,7 @@ subroutine Init_ ( mfiles, etafiles, nfiles, dynfile, lwifile, & integer, dimension(6), parameter :: IMSN = (/ 192, 376, 512, 768, 1152, 2304 /) integer, dimension(6), parameter :: JMSN = (/ 96, 192, 258, 386, 578, 1154 /) - integer, dimension(8), parameter :: KMS = (/ 18, 32, 55, 64, 72, 91, 132, 137 /) + integer, dimension(9), parameter :: KMS = (/ 18, 32, 55, 64, 72, 91, 132, 137, 181 /) ! Defaults ! -------- @@ -306,6 +313,7 @@ subroutine Init_ ( mfiles, etafiles, nfiles, dynfile, lwifile, & ncf = .false. ! default: handle usual dyn-complaint file pncf = .false. ! default: handle usual dyn-complaint file indxlevs= .false. ! default: put pressure levels in lev attribute + trnames = 'NONE' ! Parse command line ! ------------------ @@ -403,6 +411,10 @@ subroutine Init_ ( mfiles, etafiles, nfiles, dynfile, lwifile, & print *, 'Cannot handle this vertical number of levels' call exit(1) endif + case ('-tracers') + if ( iarg+1 .gt. argc ) call usage() + iarg = iarg + 1 + call GetArg ( iarg, trnames ) case ('-pick') if ( iarg+2 .gt. argc ) call usage() iarg = iarg + 1 @@ -482,6 +494,22 @@ subroutine Init_ ( mfiles, etafiles, nfiles, dynfile, lwifile, & jn = jmsn(ires) endif + if (trnames/='NONE') then + ie=len_trim(trnames) + ii=index(trnames,',') + allocate(xtrnames(ii+1)) + jj=1 + do while (ii>0) + ie=ii-1 + xtrnames(jj)=trim(trnames(1:ie)) + print *, xtrnames(jj) + il=len_trim(trnames) + trnames=trnames(ii+1:il) + ii=index(trnames,',') + jj=jj+1 + enddo + xtrnames(jj)=trim(trnames) + endif if (verbose) then print * print *, ' -----------------------------------------------------------' @@ -550,6 +578,7 @@ subroutine usage() print *, ' (default: GEOS-4 vector-type)' print *, '-ncf non-compliant dyn-vector (see NOTES)' print *, '-pncf non-compliant dyn-vector perturbation (see NOTES)' + print *, '-tracers N,M read/write extra tracers of name N and M from ori file to new' print * print *, ' NOTES:' print *, ' 1) For the time being, in order to do horizontal' diff --git a/GMAO_hermes/dyn_blob.f90 b/GMAO_hermes/dyn_blob.f90 new file mode 100644 index 00000000..9dcd97e5 --- /dev/null +++ b/GMAO_hermes/dyn_blob.f90 @@ -0,0 +1,383 @@ +program dyn_blob + +use m_dyn, only: dyn_get +use m_dyn, only: dyn_put +use m_dyn, only: dyn_vect +use m_dyn, only: dyn_clean +use m_const, only: radius_earth +use m_die, only: die + +implicit none + +character(len=*), parameter :: fname = 'bkg.eta.nc4' +character(len=*), parameter :: pname = 'fsens.eta.nc4' +character(len=*), parameter :: bname = 'blob.eta.nc4' +character(len=*), parameter :: dname = 'delta.eta.nc4' +real, parameter :: PPMV2GpG = 1.6571E-6 ! ((47.9982 g/mol)/((28.9644 g/mol))*1e-6(mol/mol)-> g/g +integer, parameter :: dyntype=5 +integer nymd, nhms, ier, im, jm, km, freq, nstep +integer ii, nymdw, nhmsw +real,allocatable:: blocs(:,:) +logical :: advect=.false. + +real,parameter:: adrate = 0.75 +real,parameter:: lenfcst = 24 +real,parameter:: deltlen = 0.001 ! make this really small +real,parameter:: corrlen = 800. ! to be read from file +real :: corrlength + +integer, parameter :: zlevout = -1! won''t do anything + +type(dyn_vect) :: wind +type(dyn_vect) :: pert + +logical :: delta=.true. !.false. +integer :: ntimes = 12 +integer :: lu=10 +real,parameter :: dlon=60. +real,allocatable :: covloc(:,:,:,:) +real,allocatable :: adcovloc(:,:,:,:) +real,allocatable :: ploc(:,:,:) +integer :: npnts,nblobs_perlon + +nblobs_perlon=360./dlon +npnts = 4*nblobs_perlon +allocate(blocs(2,npnts)) + +! read in perturbation fields +call dyn_get ( trim(pname), nymd, nhms, pert, ier, timidx=1, freq=freq, nstep=nstep, vectype=dyntype ) +im=pert%grid%im +jm=pert%grid%jm +km=pert%grid%km + +if (zlevout>0) then + open (lu,file='tracer.grd',form='unformatted',access='sequential',convert='little_endian') + call wrtout_ (lu,pert%q(:,:,zlevout,1)) + close(lu) + call readin_(lu,pert%q(:,:,zlevout,1)) +endif + +pert%u = 0.0 +pert%v = 0.0 +pert%ps = 0.0 +pert%delp = 0.0 +pert%q = 0.0 +pert%pt = 0.0 +pert%ts = 0.0 + +call set_blobs_ +if ( delta ) then + corrlength = deltlen*1000/radius_earth +else + corrlength = corrlen*1000/radius_earth +endif +call make_blobs_ +!call make_sfc_blobs_ +call dyn_put ( trim(bname), nymd, nhms, 0, pert, ier, freq=freq, nstep=nstep, vectype=dyntype ) + +! read in wind fields +if (advect) then + call dyn_get ( trim(fname), nymdw, nhmsw, wind, ier, timidx=1, freq=freq, nstep=nstep, vectype=dyntype ) + call advect_blobs_ +endif +if (zlevout>0) then + open (lu,file='wind.grd',form='unformatted',access='sequential',convert='little_endian') + call wrtout_ (lu,wind%u(:,:,zlevout)) + call wrtout_ (lu,wind%v(:,:,zlevout)) + close(lu) +endif + +call clean_blobs_ + +if(zlevout<=0) then + call dyn_put ( trim(pname), nymd, nhms, 0, pert, ier, freq=freq, nstep=nstep, vectype=dyntype ) +endif + + +contains + +subroutine wrtout_(lu,fld) + integer, intent(in) :: lu + real, intent(in) :: fld(:,:) + real(4),allocatable:: fld4(:,:) + integer myim,myjm,ndim + myim=size(fld,1) + myjm=size(fld,2) + ndim = myim*myjm + allocate(fld4(myim,myjm)) + fld4=fld + call lon_shift(fld4,myim,myjm) + print *, 'wrtout: sum field ', myim, myjm, sum(fld)/ndim, sum(fld4)/ndim + write(lu) fld4 + deallocate(fld4) +end subroutine wrtout_ + +subroutine readin_(lu,fld) + integer, intent(in) :: lu + real, intent(in) :: fld(:,:) + real(4),allocatable:: fld4(:,:) + integer myim,myjm,ndim + myim=size(fld,1) + myjm=size(fld,2) + ndim = myim*myjm + allocate(fld4(myim,myjm)) + open (lu,file='tracer.grd',form='unformatted',access='sequential',convert='little_endian') + read(lu) fld4 + close(lu) + call lon_shift(fld4,myim,myjm) + print *, 'readin: sum field ', myim, myjm, sum(fld4)/ndim + deallocate(fld4) +end subroutine readin_ + +subroutine set_blobs_ + + integer :: np,n + + np=1 + do n=1,nblobs_perlon + blocs(1,np)=45 ! 1,:=lats, 2,:=lons + blocs(2,np)= -180.+(n-1)*dlon + np=np+1 + enddo + do n=1,nblobs_perlon + blocs(1,np)=10 ! 1,:=lats, 2,:=lons + blocs(2,np)= -180.+(n-1)*dlon + np=np+1 + enddo + do n=1,nblobs_perlon + blocs(1,np)=-30 ! 1,:=lats, 2,:=lons + blocs(2,np)= -180.+(n-1)*dlon + np=np+1 + enddo + do n=1,nblobs_perlon + blocs(1,np)=-60 ! 1,:=lats, 2,:=lons + blocs(2,np)= -180.+(n-1)*dlon + np=np+1 + enddo + + allocate(ploc(1,1,3)) + allocate(covloc(im,jm,3,npnts)) + if(advect) allocate(adcovloc(im,jm,3,npnts)) +end subroutine set_blobs_ +subroutine clean_blobs_ + if(advect) deallocate(adcovloc) + deallocate(covloc) + deallocate(ploc) + deallocate(blocs) +end subroutine clean_blobs_ + +subroutine make_blobs_ + integer nn,ma,mb,ii,jj,kk,iii,jjj,jlat,jlon + real pi,cs,sn,dist + +! ma=km-9 ! 850 mb +! mb=km-9 ! 850 mb +! ma=km-22 ! 500 mb +! mb=km-22 ! 500 mb +! ma=14 ! 1 mb +! mb=14 ! 1 mb +! ma=25 ! 10 mb +! mb=25 ! 10 mb + ma=km ! sfc + mb=km ! sfc + do jlat=1,4 + do jlon=1,nblobs_perlon + nn=nn+1 + if(nn>npnts) call die('make_blobs_','Trying to access more pnts than avail',99) + + call globeloc ( ploc, blocs(1,nn:nn), blocs(2,nn:nn) ) + call globeloc ( covloc(:,:,:,nn), pert%grid%lat, pert%grid%lon ) + do jj=1,jm + do ii=1,im + dist = sqrt( (covloc(ii,jj,1,nn)-ploc(1,1,1))**2 + & + (covloc(ii,jj,2,nn)-ploc(1,1,2))**2 + & + (covloc(ii,jj,3,nn)-ploc(1,1,3))**2 )/corrlength + if (jlon==1) then + if (dist<10*corrlength) then +! do kk=1,km +! pert%delp(ii,jj,kk) = 0.01*gc(dist)*(pert%grid%bk(kk+1)-pert%grid%bk(kk)) +! enddo + pert%ps(ii,jj) = 0.01*gc(dist) ! 1mb + endif + endif + if (jlon==2) then + if (dist<10*corrlength) pert%pt(ii,jj,ma:mb) = gc(dist) + endif + if (jlon==3) then + if (dist<10*corrlength) pert%u(ii,jj,ma:mb) = gc(dist) + endif + if (jlon==4) then + if (dist<10*corrlength) pert%v(ii,jj,ma:mb) = gc(dist) + endif + if (jlon==5) then + if (dist<10*corrlength) pert%q(ii,jj,ma:mb,1) = gc(dist) + endif + if (jlon==6) then + if (dist<10*corrlength) pert%q(ii,jj,ma:mb,2) = gc(dist)/PPMV2GpG ! 1 g/g + endif + enddo + enddo + enddo + enddo + +end subroutine make_blobs_ + +subroutine make_sfc_blobs_ + integer nn,ii,jj,iii,jjj + real pi,cs,sn,dist + + do nn=1,npnts + call globeloc ( ploc, blocs(1,nn:nn), blocs(2,nn:nn) ) + call globeloc ( covloc(:,:,:,nn), pert%grid%lat, pert%grid%lon ) + do jj=1,jm + do ii=1,im + dist = sqrt( (covloc(ii,jj,1,nn)-ploc(1,1,1))**2 + & + (covloc(ii,jj,2,nn)-ploc(1,1,2))**2 + & + (covloc(ii,jj,3,nn)-ploc(1,1,3))**2 )/corrlength + if (dist<10*corrlength) then +! pert%ts(ii,jj) = gc(dist) + pert%ps(ii,jj) = 100.*gc(dist) + endif + enddo + enddo + enddo + +end subroutine make_sfc_blobs_ + +subroutine advect_blobs_ + integer nn,ii,jj,kk,iii,jjj + real fcstlen,dt,pi,cs,sn,dist + +end subroutine advect_blobs_ + + +real function gc(r) + ! Gaspari-Cohn taper function. + ! r should be positive, and normalized so taper = 0 at r = 1 + ! very close to exp(-(r/c)**2), where c = 0.388 + implicit none + + real a1,a2,a3,a4,a5,a6,a7,a8,a9 + parameter(a1 = -8.0) + parameter(a2 = 8.0) + parameter(a3 = 5.0) + parameter(a4 = 20.0/3.0) + parameter(a5 = 1.0) + parameter(a6 = 8.0/3.0) + parameter(a7 = -10.0) + parameter(a8 = 4.0) + parameter(a9 = -1.0/3.0) + + real, intent(in) :: r + if(r < a5)then + if(r > 0.5)then + gc = ( ( ( ( a6*r -a2 )*r +a3 )*r +a4 )*r +a7)*r + a8 + a9/r + else + gc = ( ( ( a1*r +a2)*r +a3 )*r -a4)*r*r + a5 + end if + else + gc = 0.0 + end if +end function gc + +subroutine globeloc (aloc,lat,lon) + implicit none + real,intent(inout) :: aloc(:,:,:) + real,intent(in) :: lat(:),lon(:) + real pi + integer i,j + + real,allocatable:: clat(:),clon(:),slat(:),slon(:) + if(size(aloc,3)<3) then + print *, 'globeloc error: check 2nd dim of aloc ', size(aloc,3) + endif + pi=4.0*atan(1.0) + allocate(clat(size(lat)),clon(size(lon))) + allocate(slat(size(lat)),slon(size(lon))) + clat=cos(lat*pi/180.) + slat=sin(lat*pi/180.) + clon=cos(lon*pi/180.) + slon=sin(lon*pi/180.) + do j=1,size(aloc,2) + do i=1,size(aloc,1) + aloc(i,j,1) = clat(j)*clon(i) + aloc(i,j,2) = clat(j)*slon(i) + aloc(i,j,3) = slat(j) + enddo + enddo + deallocate(slat,slon) + deallocate(clat,clon) +end subroutine globeloc + +subroutine globeadloc (fcstlen,aloc,lat,lon, u,v) + implicit none + real,intent(in) :: fcstlen + real,intent(inout) :: aloc(:,:,:) + real,intent(in) :: lat(:),lon(:) + real,intent(in) :: u(:,:),v(:,:) + real pi,pi2,halfpi + real adlat,adlon + real adtime + integer i,j + + real,allocatable:: clat(:),clon(:),slat(:),slon(:) + if(size(aloc,3)<3) then + print *, 'globeloc error: check 2nd dim of aloc ', size(aloc,3) + endif + pi=4.0*atan(1.0) + pi2=2.0*pi + halfpi=0.5*pi + adtime=adrate*fcstlen*3600./radius_earth + allocate(clat(size(lat)),clon(size(lon))) + allocate(slat(size(lat)),slon(size(lon))) + clat=lat*pi/180. + slat=lat*pi/180. + clon=lon*pi/180. + slon=lon*pi/180. + do j=1,size(aloc,2) + do i=1,size(aloc,1) + adlon = clon(i) - u(i,j) * cos(clat(j)) * adtime + adlat = clat(j) - v(i,j) * adtime + if(adlat > halfpi) then + adlat = pi - adlat + adlon = adlon + pi + else if(adlat < -halfpi) then + adlat = -pi - adlat + adlon = adlon + pi + end if + if(adlon > pi2) then + adlon = mod(adlon,pi2) + else if(adlon < 0.0) then + adlon = mod(adlon,pi2) + pi2 + end if + + aloc(i,j,1) = cos(adlat)*cos(adlon) + aloc(i,j,2) = cos(adlat)*sin(adlon) + aloc(i,j,3) = sin(adlat) + enddo + enddo + deallocate(slat,slon) + deallocate(clat,clon) +end subroutine globeadloc + +subroutine lon_shift(field,im,jm) + Implicit NONE + + integer, intent(in) :: im + integer, intent(in) :: jm + + real(4), intent(inout) :: field(im,jm) + integer i, j + real(4) tmp + + do j = 1, jm + do i = 1, im/2 + tmp = field(i,j) + field(i,j) = field(i+im/2,j) + field(i+im/2,j) = tmp + enddo + enddo + +end subroutine lon_shift + +end program dyn_blob diff --git a/GMAO_hermes/dyn_fsens_conv.f90 b/GMAO_hermes/dyn_fsens_conv.f90 new file mode 100644 index 00000000..e2ac6989 --- /dev/null +++ b/GMAO_hermes/dyn_fsens_conv.f90 @@ -0,0 +1,186 @@ +! read reference state and fsens and convert fsens vars +! to JEDI analysis variables + + program dyn_fsens_conv + use m_dyn + use m_ioutil, only : luavail + use m_die, only: die + use m_const, only : zvir + implicit none + character(len=*), parameter :: myname='dyn_fsen_conv' + integer,parameter :: dyntype=5 + integer,parameter :: nfiles=2 + integer nymd, nhms, lu, n, freq, vectype, prec, ier, nstep + integer i, nf, iarg, argc, ndim2, ndim3, intarg, iargc + character(len=255) :: ofile + character(len=255) :: dynfile(nfiles) + character(len=255) argv + type(dyn_vect) w_1 + type(dyn_vect) w_2 + real,allocatable :: t(:,:,:), t_tl(:,:,:), t_ad(:,:,:) + logical use_ps + real :: total, dotp(5) + integer im,jm,km,lm,k,rc + integer im1,jm1,km1,lm1 + integer im2,jm2,km2,lm2 + logical verbose + + ofile="NONE" + prec = 0 + vectype = 5 + verbose = .false. + + iarg=0 + argc = iargc() + if ( argc < 1 ) call usage_() + nf=0 + do i = 1, 32767 + iarg = iarg + 1 + if ( iarg .gt. argc ) exit + call GetArg ( iarg, argv ) + select case (trim(argv)) + case ("-verbose") + verbose = .true. + case ("-o") + if ( iarg+1 .gt. argc ) call usage_() + iarg = iarg + 1 + call GetArg ( iarg, ofile ) + case default + nf = nf + 1 + if ( nf .gt. nfiles ) call die(myname,'too many eta files:',nf) + dynfile(nf) = trim(argv) + end select + enddo + + if (verbose) then + do nf=1,nfiles + write(6,'(a,i3,2a)') "Dyn Vector ", nf , ": ", trim(dynfile(nf)) + enddo + endif + + if (nf==0) call die(myname,'missing input files') + + call dyn_getdim ( trim(dynfile(1)), im1, jm1, km1, lm1, rc ) + call dyn_getdim ( trim(dynfile(2)), im2, jm2, km2, lm2, rc ) + if(km1/=km2) then ! ignore diff in lm for now + print *, trim(myname), ': km/lm file 1 = ', km1,lm1 + print *, trim(myname), ': km/lm file 2 = ', km2,lm2 + call die(myname,'inconsistent km/lm') + endif + im=min(im1,im2) + jm=min(jm1,jm2) + km=min(km1,km2) + lm=min(lm1,lm2) + ndim2 = im*jm + +! check dimensions and take proper action + n=1 + if ( im1==im2 .and. jm1==jm2 ) then + call dyn_get ( trim(dynfile(1)), nymd, nhms, w_1, ier, timidx=n, & + freq=freq, nstep=nstep, vectype=vectype ) + call dyn_get ( trim(dynfile(2)), nymd, nhms, w_2, ier, timidx=n, & + freq=freq, nstep=nstep, vectype=vectype ) + else + call die(myname,'cannot handle inconsistent dims') + endif + ndim3 = ndim2 * km + + allocate (t_ad(im,jm,km)) + call t2tv_ad (w_1%pt,w_1%q(:,:,:,1),w_2%pt,t_ad) + w_2%pt = t_ad ! overwrite field + deallocate (t_ad) + + if (trim(ofile) == "NONE" ) then + print *, "Overwriting input fsens with converted fields ..." + ofile = trim(dynfile(2)) + else + print *, "Writing converted fsens file ..." + endif + +! change sign of sensitivity to adjust what for JEDI +! temporary +! -------------------------------------------------- +! w_2%delp = -w_2%delp +! w_2%ps = -w_2%ps +! w_2%pt = -w_2%pt +! w_2%u = -w_2%u +! w_2%v = -w_2%v +! w_2%q = -w_2%q + call dyn_put ( trim(ofile), nymd, nhms, 0, w_2, rc, freq=freq, vectype=dyntype ) + + contains + + subroutine usage_ + print *, "Purpose: Convert variables in fsens to require JEDI fields" + print *, " " + print *, "Usage: dyn_fsens_conv.x [options] reference_state fsens " + print *, " " + print *, " Optional arguments: " + print *, " " + print *, " -o Output converted file (DEFAULT: NONE: overwrite input)" + print *, " -verbose Echo actions" + print *, " " + stop + end subroutine usage_ + + subroutine tv2t (tv,qv,t) + + real,intent(in) :: tv(:,:,:), qv(:,:,:) + real,intent(out) :: t(:,:,:) + + t=tv/(1.d0+zvir*qv) + + end subroutine tv2t + + subroutine tv2t_tl (qv,t, tv_tl,qv_tl, t_tl) + + real,intent(in) :: t (:,:,:), qv (:,:,:) + real,intent(in) :: tv_tl(:,:,:), qv_tl(:,:,:) + real,intent(out) :: t_tl(:,:,:) + + t_tl = (tv_tl - zvir*t*qv_tl)/(1.d0+zvir*qv) + + end subroutine tv2t_tl + +! subroutine tv2t_ad (qv,t, t_tl, tv_ad, qv_ad) + +! real,intent(in) :: t (:,:,:), qv (:,:,:) +! real,intent(in) :: tv_ad(:,:,:), qv_tl(:,:,:) +! real,intent(out) :: t_ad(:,:,:) + +! tv_ad = t_tl*(1.d0+zvir*qv) +! qv_ad = t_tl*(1.d0+zvir*qv)/(zvir*t) + +! end subroutine tv2t_ad + + subroutine t2tv (t,qv,tv) + + real,intent(in) :: t(:,:,:), qv(:,:,:) + real,intent(out) :: tv(:,:,:) + + tv=t*(1.d0+zvir*qv) + + end subroutine t2tv + + subroutine t2tv_tl (t,qv,t_tl,qv_tl,tv_tl) + + real,intent(in) :: t (:,:,:), qv (:,:,:) + real,intent(in) :: t_tl(:,:,:), qv_tl(:,:,:) + real,intent(out) :: tv_tl(:,:,:) + + tv_tl=t_tl*(1.d0+zvir*qv)+zvir*t*qv_tl + + end subroutine t2tv_tl + + subroutine t2tv_ad (t,qv,tv_ad,t_ad) + + real,intent(in) :: t (:,:,:), qv(:,:,:) + real,intent(in) :: tv_ad(:,:,:) + real,intent(out) :: t_ad(:,:,:) + + t_ad=tv_ad/(1.d0+zvir*qv) +! q_ad=tv_tl/(zvir*t) + + end subroutine t2tv_ad + + end program dyn_fsens_conv diff --git a/GMAO_hermes/dyn_iupd.F90 b/GMAO_hermes/dyn_iupd.F90 index 50105813..2f69c255 100644 --- a/GMAO_hermes/dyn_iupd.F90 +++ b/GMAO_hermes/dyn_iupd.F90 @@ -19,7 +19,8 @@ program dyn_iupd integer :: nymd, nhms, freq, rc integer :: im1,jm1,km1,lm1 integer :: im2,jm2,km2,lm2 -integer :: iargc,iarg, argc, k +integer :: k +real :: rscale real,allocatable :: ak(:),bk(:) type(dyn_vect) :: xi type(dyn_vect) :: yi @@ -27,19 +28,9 @@ program dyn_iupd logical, parameter :: pncf=.true. character(len=*), parameter :: ovars(11)=(/' u',' v',' delp',' tv',' ps',' ts', ' sphu','qitot','qltot','qrtot','qstot'/) -argc = iargc() -if ( argc < 2 ) then - print *, "Usage: dyn_iupd.x finput foutput" - print *, " " - stop -end if +rscale = -1.0e15 -iarg = 1 -call GetArg ( iarg, ifile ) -print * , "input increment: ", trim(ifile) -iarg = iarg + 1 -call GetArg ( iarg, iofile ) -print * , "increment to update: ", trim(iofile) +call init_() call dyn_getdim ( trim(ifile) , im1, jm1, km1, lm1, rc ) call dyn_getdim ( trim(iofile), im2, jm2, km2, lm2, rc ) @@ -108,6 +99,14 @@ program dyn_iupd yi%q(:,:,:,1:lm1) = yi%q(:,:,:,1:lm1) + xi%q(:,:,:,1:lm1) yi%ps= yi%ps+ xi%ps yi%ts= yi%ts+ xi%ts +if ( rscale > -1.0e15 ) then ! split to avoid round off diffs in DAS when rscale=1. + yi%u = rscale*yi%u + yi%v = rscale*yi%v + yi%pt= rscale*yi%pt + yi%q(:,:,:,1:lm1) = rscale*yi%q(:,:,:,1:lm1) + yi%ps= rscale*yi%ps + yi%ts= rscale*yi%ts +endif ! reconstruct delp increment from ps increment allocate(ak(km2+1),bk(km2+1)) @@ -125,4 +124,49 @@ program dyn_iupd call dyn_clean ( yi ) call dyn_clean ( xi ) +contains + subroutine init_ + + integer, parameter :: mfiles=2 + integer iargc,argc,nfiles,iarg,i + character(len=256) str,argv + + argc = iargc() + if ( argc < 2 ) then + print *, "Usage: dyn_iupd.x [-scale SCALE] finput foutput" + print *, " " + stop + end if + + iarg = 0 + nfiles = 0 + + do i = 1, 32767 + iarg = iarg + 1 + if ( iarg .gt. argc ) exit + call GetArg ( iarg, argv ) + select case (argv) + case ('-scale') + if ( iarg+1 .gt. argc ) then + print *, "See usage, aborting" + stop + endif + iarg = iarg + 1 + call GetArg ( iarg, str ) + read(str,*) rscale + case default + nfiles = nfiles + 1 + if ( nfiles .gt. mfiles ) call die(myname,'too many eta files') + if ( nfiles==1 ) ifile = argv + if ( nfiles==2 ) iofile = argv + end select + enddo + + print * , "input increment: ", trim(ifile) + print * , "increment to update: ", trim(iofile) + if ( rscale > -1.e15 ) then + print *, "scaling perturbation by: ", rscale + endif + + end subroutine init_ end program dyn_iupd diff --git a/GMAO_hermes/dyn_recenter.f90 b/GMAO_hermes/dyn_recenter.f90 index 65640026..ba5f508e 100644 --- a/GMAO_hermes/dyn_recenter.f90 +++ b/GMAO_hermes/dyn_recenter.f90 @@ -61,6 +61,7 @@ program dyn_recenter ! 09Apr2018 Todling Add vertically-varying additive inflation mechanism ! 11Apr2018 Todling Additive inflation only applied over ocean for ps/delp ! 09May2018 Todling Ability to vertically interpolate central ana to mem res +! 12Jul2019 Todling Ability to vertically interpolate inflation perturbation ! ! !See Also: ! @@ -261,14 +262,9 @@ program dyn_recenter ! Get mean to recenter ensemble around ! ------------------------------------- call dyn_getdim ( trim(dyn_inflate), imm, jmm, kmm, lmm, rc ) - if(km/=kmm) then ! ignore diff in lm for now - print *, trim(myname), ': km/lm members = ', km ,lm - print *, trim(myname), ': km/lm perturbation= ', kmm,lmm - call die(myname,'inconsistent km/lm') - endif - lm_pert=lmm - if(im/=imm.or.jm/=jmm) then + lm_pert=lmm + if(im/=imm.or.jm/=jmm.or.km/=kmm) then ! Read full resolution perturbation ! --------------------------------- @@ -281,27 +277,53 @@ program dyn_recenter ! Initialize dimension of output (interpolated) vector ! ---------------------------------------------------- - call dyn_init ( im, jm, km, x_x%grid%lm, x_m, rc, & - x_e%grid%ptop, x_e%grid%ks, x_e%grid%ak, x_e%grid%bk, vectype=dyntype ) + if (km/=kmm) then + allocate(ak(kmm+1),bk(kmm+1)) + call set_eta ( kmm,ks,ptop,pint,ak,bk ) + call dyn_init ( im, jm, kmm, x_x%grid%lm, x_m, rc, & + ptop, ks, ak, bk, vectype=dyntype ) + else + call dyn_init ( im, jm, km, x_x%grid%lm, x_m, rc, & + x_e%grid%ptop, x_e%grid%ks, x_e%grid%ak, x_e%grid%bk, vectype=dyntype ) + endif if ( rc/=0 ) then call die (myname, ': Error initializing dyn vector(x_e)') endif -! Interpolate to required resolution -! ---------------------------------- -!_RT x_m%grid%lm=min(lm_pert,lm) ! only interp minimal set of fields (others are zero) +! Interpolate to required horizontal resolution (at vertical resolution of input perturbation +! ------------------------------------------------------------------------------------------- call h_map_pert ( x_x, x_m, rc ) if ( rc/=0 ) then call dyn_clean ( x_x ) call dyn_clean ( x_m ) print *, 'h_map error code = ', rc call die(myname,' failed in h_map') - else + endif + +! Interpolate vertically when required ... +! ---------------------------------------- + if (km/=kmm) then + call dyn_clean ( x_x ) + call dyn_init ( x_m, x_x, rc, copy=.true., vectype=dyntype ) + call dyn_clean ( x_m ) + call dyn_init ( im, jm, km, x_x%grid%lm, x_m, rc, & + x_e%grid%ptop, x_e%grid%ks, x_e%grid%ak, x_e%grid%bk, vectype=dyntype ) + call vinter_pert_ ( x_x, x_m, ak, bk, dyntype, rc ) + if ( rc/=0 ) then call dyn_clean ( x_x ) + call dyn_clean ( x_m ) + print *, 'vinter_pert_ error code = ', rc + call die(myname,' failed in vinter_pert') endif -!_RT x_m%grid%lm = lm ! reset lm-dim(x_m) - print*, myname, ': interpolated additive perturbation to member resolution' - print*, myname, ': from ', imm, 'x', jmm, ' to ', im, 'x', jm + deallocate(ak,bk) + print*, myname, ': interpolated additive perturbation to member resolution' + print*, myname, ': from ', imm, 'x', jmm, 'x', kmm, ' to ', im, 'x', jm, 'x', km + else ! if vertical interpolation not required, we are done + print*, myname, ': interpolated additive perturbation to member resolution' + print*, myname, ': from ', imm, 'x', jmm, ' to ', im, 'x', jm + endif + + call dyn_clean ( x_x ) else @@ -623,7 +645,13 @@ subroutine Init_ ( dyntype, mfiles, files, damp, remap2central, remap2member, & ainf_ps = alpha ainf_ts = alpha - if ( nfiles .lt. 1 ) call usage() + if ( nfiles .lt. 1 ) then + call usage() + else + do i=1,nfiles + write(6,'(a,i4,2a)') 'Reading file (',i,'): ', trim(files(i)) + enddo + endif ! Load resources: some of these will overwrite command line settings ! -------------- @@ -1135,4 +1163,41 @@ logical function getphis_(phis,remapinfo) end function getphis_ + subroutine vinter_pert_ (xpi,xpo,ak,bk,dyntype,rc) + + use m_set_eta, only: set_eta + use m_mapz_pert, only: mapz_pert_set + use m_mapz_pert, only: mapz_pert_interp + implicit none + + type(dyn_vect) :: xpi ! input vector + type(dyn_vect) :: xpo ! output vector + real(8), intent(in) :: ak(:),bk(:) + integer,intent(in) :: dyntype + integer,intent(out) :: rc + + integer kmi,kmo,ier + real,allocatable,dimension(:) :: plevi,plevo + + kmo=xpo%grid%km + kmi=xpi%grid%km + rc =0 + +! set pressure levels + allocate(plevi(kmi),plevo(kmo)) + call mapz_pert_set (kmi,plevi) + call mapz_pert_set (kmo,plevo) + +! interpolate vertically + call mapz_pert_interp ( plevi, plevo, xpi, xpo, ier) + if (ier/=0) then + print *, 'main: Error from mapz_pert_interp(xpo), rc=', rc + rc=ier ! return error code + endif + +! clean up + deallocate(plevi,plevo) + + end subroutine vinter_pert_ + end program dyn_recenter diff --git a/GMAO_hermes/dyndiff.f90 b/GMAO_hermes/dyndiff.f90 index 8ee9c8c6..48ca890a 100644 --- a/GMAO_hermes/dyndiff.f90 +++ b/GMAO_hermes/dyndiff.f90 @@ -29,6 +29,7 @@ program dyndiff ! 05Mar2009 Todling Add land fractions ! 08Mar2012 Todling Add acoeff [to allow calc of inc as -(b-a)] ! 12Sep2012 Todling Quick fix for LM issue in dyn-vector +! 10Jun2020 Todling Add ability to add rh diff and mean rh to diff file ! !------------------------------------------------------------------------- !EOP @@ -42,7 +43,7 @@ program dyndiff integer :: nfiles ! actual no. of input files character(len=255) :: dyn_dout ! difference output file name - + logical, parameter :: fix_top_rh = .true. ! Dynamics/simulator vectors ! -------------------------- @@ -58,12 +59,15 @@ program dyndiff integer ios, rc, iopt, ifile integer ntimes, n, freq, nymd, nhms, prec integer freq_d, nymd_d, nhms_d, prec_d !Timetag for newly created diff in *.hdf format - integer im, jm, km, lm, system, dyntype + integer im, jm, km, lm, system, dyntype, irh logical dominmax,verb,sbyene,tv2t + integer addrh logical normlz character(len=3) ntype ! norm type (when applicable) real, allocatable :: ps (:,:) real, allocatable :: delp(:,:,:) + real, allocatable :: rh1(:,:,:) + real, allocatable :: rh2(:,:,:) real acoeff real eps_eer real projlat(2), projlon(2) @@ -72,7 +76,7 @@ program dyndiff ! Initialize ! ---------- call Init_ ( dyntype, mfiles, files, dominmax, verb, egress, eps_eer, anorm, jnorm, & - tv2t, projlon, projlat, projlev, normlz, ntype ) + tv2t, projlon, projlat, projlev, normlz, ntype, addrh ) ! Loop over input eta files ! ------------------------- @@ -122,6 +126,13 @@ program dyndiff print *, "> nymd, nhms: ", nymd, nhms, " (diff)" lm = min(dyn(1)%grid%lm,dyn(2)%grid%lm) if ( .not. dominmax ) then + if (abs(addrh)>0) then + allocate(rh1(im,jm,km)) + allocate(rh2(im,jm,km)) + call getrh_(rh1,dyn(1)%pt,dyn(1)%q(:,:,:,1),dyn(1)%ps,dyn(1)%grid%ak,dyn(1)%grid%bk) + call getrh_(rh2,dyn(2)%pt,dyn(2)%q(:,:,:,1),dyn(2)%ps,dyn(2)%grid%ak,dyn(2)%grid%bk) + endif + print *, "scaling difference by: ", acoeff if (sbyene) then allocate(ps (dyn(1)%grid%im,dyn(1)%grid%jm)) @@ -154,6 +165,15 @@ program dyndiff nymd,nhms,ntype=ntype,normlz=normlz,ps=ps,delp=delp) deallocate(ps,delp) endif + if (abs(addrh)>0) then + if (addrh<0) then + rh2 = (rh1 + rh2) + rh1 = acoeff*(2.*rh1 - rh2) + rh2 = 0.5*acoeff*rh2 + else + rh1 = acoeff*(rh1 - rh2) + endif + endif endif ! If so, echo result to standard out @@ -165,17 +185,37 @@ program dyndiff endif endif +! Do some cleaning +! ---------------- + call dyn_clean ( dyn(2) ) + ! If requested write *.hdf file with a header from dyn(1) ! ------------------------------------------------------- if ( trim(dyn_dout) .ne. 'NONE' ) then - dyn(1)%grid%lm = lm - call dyn_put ( trim(dyn_dout), nymd_d, nhms_d, 0, dyn(1), rc, freq=freq, vectype=dyntype ) + if ( abs(addrh)>0 ) then + irh=1 + if(addrh<0) irh=2 + call dyn_init ( dyn(1), dyn(2), rc, copy=.true., vectype=dyntype, lm=dyn(1)%grid%lm+irh ) + dyn(2)%q(:,:,:,dyn(1)%grid%lm+1) = rh1 + dyn(2)%qm(dyn(1)%grid%lm+1)%name = 'rh'; dyn(2)%qm(dyn(1)%grid%lm+1)%long_name = 'Relative Humidity ' + dyn(2)%qm(dyn(1)%grid%lm+1)%units = '%' + if(irh==2) then + dyn(2)%q(:,:,:,dyn(1)%grid%lm+2) = rh2 + dyn(2)%qm(dyn(1)%grid%lm+2)%name = 'mrh'; dyn(2)%qm(dyn(1)%grid%lm+2)%long_name = 'Mean Relative Humidity ' + dyn(2)%qm(dyn(1)%grid%lm+2)%units = '%' + endif + call dyn_put ( trim(dyn_dout), nymd_d, nhms_d, 0, dyn(2), rc, freq=freq, vectype=dyntype, skip_setvec=.true. ) + deallocate(rh1,rh2) + call dyn_clean ( dyn(2) ) + else + dyn(1)%grid%lm = lm + call dyn_put ( trim(dyn_dout), nymd_d, nhms_d, 0, dyn(1), rc, freq=freq, vectype=dyntype ) + endif endif ! Clean up mess ! ------------- call dyn_clean ( dyn(1) ) - call dyn_clean ( dyn(2) ) end do @@ -210,7 +250,7 @@ program dyndiff ! subroutine Init_ ( dyntype, mfiles, files, dominmax, verb, egress, & eps_eer, anorm, jnorm, tv2t, & - projlon, projlat, projlev, normlz, ntype ) + projlon, projlat, projlev, normlz, ntype, addrh ) use m_inpak90 use m_chars, only: lowercase @@ -231,12 +271,14 @@ subroutine Init_ ( dyntype, mfiles, files, dominmax, verb, egress, & logical, intent(out) :: tv2t logical, intent(out) :: verb logical, intent(out) :: normlz + integer, intent(out) :: addrh character(len=*), intent(out) :: ntype ! ! !REVISION HISTORY: ! 2002.01.07 E. Yeh Initial code. ! 05Oct2012 Todling Add verb +! 09Jun2020 Todling Add rh option ! !EOP !BOC @@ -261,6 +303,7 @@ subroutine Init_ ( dyntype, mfiles, files, dominmax, verb, egress, & acoeff = 1.0 egress = 'DYNDIFF_EGRESS' rcfile = 'NULL' + addrh = 0 sbyene = .false. tv2t = .false. eps_eer = 1.0 @@ -319,6 +362,11 @@ subroutine Init_ ( dyntype, mfiles, files, dominmax, verb, egress, & if ( iarg+1 .gt. argc ) call usage() iarg = iarg + 1 call GetArg ( iArg, jnorm ) + case ("-addrh") + if ( iarg+1 .gt. argc ) call usage() + iarg = iarg + 1 + call GetArg ( iArg, argv ) + read(argv,*) addrh case ("-tv2t") tv2t = .true. case ("-h") @@ -466,6 +514,18 @@ subroutine Init_ ( dyntype, mfiles, files, dominmax, verb, egress, & do i = 1, nfiles print *, i, ': ', trim(files(i)) end do + if(dout) then + select case (abs(addrh)) + case (1) + print *, 'Adding GEOS-qsat-based RH to ouput file' + case (2) + print *, 'Adding BeCov-qsat-based RH to ouput file' + case (3) + print *, 'Adding GSI-qsat-based RH to ouput file' + case default + ! nothing to say + end select + endif end subroutine Init_ @@ -486,6 +546,9 @@ subroutine usage() print *, '-tv2t Converts diff in Tv to diff in T' print *, '-egress Name of EGRESS file for successful finalization' print *, '-a coeff Scale difference by this coefficient (see note)' + print *, '-addrh N Add rh diff to file: 1=use GEOS qsat' + print *, ' 2=use BeCov qsat' + print *, ' 3=use GSI qsat' print * print * print *, 'Where etafile_1 and etafile_2 are two (required)' @@ -507,6 +570,7 @@ subroutine usage() print *, ' in general meaningless. This ability is added to compensate' print *, ' for the fact that sometimes file1-file2 not possible, but' print *, ' file2-file1 is possible due to nc4-header issues' + print *, ' 3. If addrh<0, mean rh is added to the file (serves BeCov code)' call exit(1) end subroutine usage @@ -518,6 +582,69 @@ subroutine die ( myname, msg ) call exit(1) end subroutine die + subroutine getrh_(rh,tv,qv,ps,ak,bk) + use m_const, only: zvir + use GEOS_UtilsMod, only: GEOS_Qsat + use m_dyn_util, only: dyn_qsat + implicit none + real,intent(out):: rh(:,:,:) + real,intent(in) :: tv(:,:,:), qv(:,:,:), ps(:,:) + real,intent(in) :: ak(:), bk(:) + real(4),allocatable :: tmp(:,:,:),pmk(:,:,:),qs(:,:,:) + integer i,j,k,kb + select case (abs(addrh)) + case (1) + allocate(tmp(im,jm,1),pmk(im,jm,1),qs(im,jm,1)) + do k = 1, km + pmk(:,:,1) = 0.5 * ( ak(k)+ak(k+1) + & + ps*(bk(k)+bk(k+1)) ) + tmp(:,:,1) = tv(:,:,k)/(1.0+zvir*qv(:,:,k)) + qs (:,:,1) = GEOS_Qsat(tmp(:,:,1), pmk(:,:,1), PASCALS=.true.) + rh(:,:,k) = qv(:,:,k)/qs(:,:,1) + end do + case (2) + allocate(tmp(im,jm,1),pmk(im,jm,1),qs(im,jm,1)) + if (fix_top_rh) then + k=1 + pmk(:,:,1) = 0.5 * ( ak(k)+ak(k+1) + & + ps*(bk(k)+bk(k+1)) ) + tmp(:,:,1) = tv(:,:,k)/(1.0+zvir*qv(:,:,k)) + qs (:,:,1) = GEOS_Qsat(tmp(:,:,1), pmk(:,:,1), PASCALS=.true.) + rh(:,:,k) = qv(:,:,k)/qs(:,:,1) + kb = 2 + else + kb = 1 + endif + do k = kb, km + pmk(:,:,1) = 0.5 * ( ak(k)+ak(k+1) + & + ps*(bk(k)+bk(k+1)) ) + tmp(:,:,1) = tv(:,:,k) + qs (:,:,1) = qv(:,:,k) + call dyn_qsat(qs(:,:,1),tmp(:,:,1),pmk(:,:,1),im,jm,.true.) + rh(:,:,k) = qv(:,:,k)/qs(:,:,1) + end do + case (3) + allocate(tmp(im,jm,km),pmk(im,jm,km),qs(im,jm,km)) + do k = 1, km + pmk(:,:,k) = 0.5 * ( ak(k)+ak(k+1) + & + ps*(bk(k)+bk(k+1)) ) + tmp(:,:,k) = tv(:,:,k)/(1.0+zvir*qv(:,:,k)) + enddo + call dyn_qsat(qs,tmp,pmk,im,jm,km,.true.,ntop=1) + rh = qv/qs + if (fix_top_rh) then + k=1 + pmk(:,:,1) = 0.5 * ( ak(k)+ak(k+1) + & + ps*(bk(k)+bk(k+1)) ) + tmp(:,:,1) = tv(:,:,k)/(1.0+zvir*qv(:,:,k)) + qs (:,:,1) = GEOS_Qsat(tmp(:,:,1), pmk(:,:,1), PASCALS=.true.) + rh(:,:,1)=qv(:,:,1)/qs(:,:,1) + endif + case default + return + end select + deallocate(tmp,pmk,qs) + end subroutine getrh_ !................................................................. end program dyndiff diff --git a/GMAO_hermes/dyndot.f90 b/GMAO_hermes/dyndot.f90 index 3f419568..c143eba5 100644 --- a/GMAO_hermes/dyndot.f90 +++ b/GMAO_hermes/dyndot.f90 @@ -28,7 +28,7 @@ program dyndot argc = iargc() if ( argc < 1 ) call usage_() - nf=0 + nf=0; iarg=0 do i = 1, 32767 iarg = iarg + 1 if ( iarg .gt. argc ) exit diff --git a/GMAO_hermes/dynp.f90 b/GMAO_hermes/dynp.f90 index 660ad2c5..c9f7acba 100644 --- a/GMAO_hermes/dynp.f90 +++ b/GMAO_hermes/dynp.f90 @@ -618,7 +618,7 @@ subroutine usage_() print * print *, ' -a pcoef perturbation coefficient (default: 1.0)' print * - print *, ' -scal scale scaling factor for the output perturbation (default: 1.0)' + print *, ' -scale scale scaling factor for the output perturbation (default: 1.0)' print * print *, ' -pick nymd nhms date and time' print *, ' (default: use latest on file)' diff --git a/GMAO_hermes/echorc.f90 b/GMAO_hermes/echorc.f90 index 09b130fb..c1944e55 100644 --- a/GMAO_hermes/echorc.f90 +++ b/GMAO_hermes/echorc.f90 @@ -132,8 +132,6 @@ program echorc endif - stop 0 - CONTAINS !------------------------------------------------------------------------- diff --git a/GMAO_hermes/echorc.pl b/GMAO_hermes/echorc.pl new file mode 100755 index 00000000..75dee286 --- /dev/null +++ b/GMAO_hermes/echorc.pl @@ -0,0 +1,244 @@ +#!/usr/bin/env perl +#======================================================================= +# name - echorc.pl +# purpose - This is an alternative to the echorc.x program. +#======================================================================= +use strict; +use warnings; + +use File::Basename qw(basename); +use Getopt::Long qw(GetOptions); + +# global variables +#----------------- +my (@tvals, $rcfile, $rcstring, $numcol, $fillFLG); +my (%month, %lastday); + +%month = ("01" => "jan", "02" => "feb", "03" => "mar", "04" => "apr", + "05" => "may", "06" => "jun", "07" => "jul", "08" => "aug", + "09" => "sep", "10" => "oct", "11" => "nov", "12" => "dec" ); + +%lastday = ( 1 => 31, 2 => 0, 3 => 31, 4 => 30, + 5 => 31, 6 => 30, 7 => 31, 8 => 31, + 9 => 30, 10 => 31, 11 => 30, 12 => 31 ); + +#======================================================================= +# main program +#======================================================================= +{ + my ($value, $expid, $yyyy, $yy, $mm, $dd, $hh, $nn, $ss, $jjj); + + init(); + #---------------------- + #--echorc.x -rc test.rc -ncol 2 OBS_INPUT + #--dtype: ps t t q + #---------------------- + $value = getvalue(); + if (@tvals) { + $expid = $tvals[0]; + ($yyyy, $yy, $mm, $dd) = ( $tvals[1] =~ m/^(\d{2}(\d{2}))(\d{2})(\d{2})$/ ); + ($hh, $nn, $ss) = ( $tvals[2] =~ m/^(\d{2})(\d{2})(\d{2})$/ ); + $jjj = julianday($yyyy, $mm, $dd); + + $value =~ s/%s/$expid/g; + $value =~ s/%y4/$yyyy/g; + $value =~ s/%y2/$yy/g; + $value =~ s/%m2/$mm/g; + $value =~ s/%m3/$month{$mm}/g; + $value =~ s/%d2/$dd/g; + $value =~ s/%h2/$hh/g; + $value =~ s/%n2/$nn/g; + $value =~ s/%j3/$jjj/g; + $value =~ s/%c/?/g; + } + print "$value\n"; +} + +#======================================================================= +# name - julianday +# purpose - +#======================================================================= +sub julianday { + my ($yyyy, $mm, $dd, $jjj, $month); + + $yyyy = shift @_; + $mm = shift @_; + $dd = shift @_; + + $lastday{2} = 28; + $lastday{2} = 29 if $yyyy%4==0 and ($yyyy%100!=0 or $yyyy%400==0); + + $jjj = 0; + foreach $month (1..$mm-1) { $jjj += $lastday{$month} } + $jjj += $dd; + $jjj = sprintf("%03d", $jjj); + + return $jjj; +} + +#======================================================================= +# name - init +# purpose - get runtime parameters and options +#======================================================================= +sub init { + my ($help, $debug); + + GetOptions( "template=s{3}" => \@tvals, + "rc=s" => \$rcfile, + "ncol=i" => \$numcol, + "fill" => \$fillFLG, + "db|debug" => \$debug, + "help|h" => \$help ); + usage() if $help; + usage() unless scalar(@ARGV) == 1; + $rcstring = shift @ARGV; + $rcstring =~ s/\$PESTOROOT/$ENV{"PESTOROOT"}/; + + unless ($fillFLG) { $rcfile = "fvpsas.rc" unless $rcfile } + $numcol = 1 unless $numcol; + + if (@tvals) { + die "Error. Bad format for yyyymmdd, $tvals[1];" + unless $tvals[1] =~ /^\d{8}$/; + die "Error. Bad format for hhmmss, $tvals[2];" + unless $tvals[2] =~ /^\d{6}$/; + } + checkinput() if $debug; + usage() if $help; +} + +#======================================================================= +# name - getvalue +# purpose - get a variable's value +#======================================================================= +sub getvalue { + my ($variable, $line, $val, $value, @vals); + + return $rcstring if $fillFLG; + + die "Error. No rcfile specified;" unless $rcfile; + die "Error. Cannot find rcfile, $rcfile;" unless -e $rcfile; + + open (RCF, "< $rcfile") or die "Error opening rcfile, $rcfile;"; + while () { + + # if namelist found, then strip out numcol + #----------------------------------------- + if (m/^\s*$rcstring\s*::/) { + @vals = (); + foreach $line () { + $line =~ s/|^\s*|\s*$|//g; # remove leading and trailing blanks + next if $line =~ m/^\!/; # skip comment lines + last if $line =~ m/^::$/; # end of namelist + + $val = (split /\s+/, $line)[$numcol-1]; + push @vals, $val; + } + $value = "@vals"; + } + + # else, get variable's value from file + #------------------------------------- + else { + $value = $1 if m/^\s*$rcstring\s*:\s*(.*)\s*$/; + } + last if $value; + } + close RCF; + die "Error. Could not find $rcstring in $rcfile;" unless $value; + return $value; +} + +#======================================================================= +# name - checkinput +#======================================================================= +sub checkinput { + if (@tvals) { + print "check: \@tvals ="; + foreach (@tvals) { print " $_" } + print "\n"; + } + print "check: \$rcfile = $rcfile\n" if $rcfile; + print "check: \$rcstring = $rcstring\n"; + print "check: \$numcol = $numcol\n" if $numcol; + print "check: \$fillFLG = $fillFLG\n" if $fillFLG; +} + +#======================================================================= +# name - usage +# purpose - print usage information +#======================================================================= +sub usage { + my ($FH, $info); + my $script = basename($0); + + $FH = select; + open(INFO, ">", \$info); + + select INFO; + print << "EOF"; + +Usage : $script [-template expid nymd nhms] [-rc rcfile|-fill] rcstring + +where + rcstring is string in rcfile whose value is to be echoed + or a GRADS template to be filled if the -fill flag is present +options: + -template expid nymd nhms + values to fill into %s, the GRADS template; + where rcstring is the the GRADS template (with -fill option) + or rcstring\'s value extracted from rcfile is the GRADS template + + -rc rcfilename rcfile name (default: fvpsas.rc) + -ncol numcol when reading table, allows getting given column (default: 1) + -fill treat rcstring as GRADS template to use with -template option + +Examples +-------- +1. (using rc file) + > $script -template myexp 20040101 060000 -rc myfile.rc templatename + + result: myexp.myfile.something.20040101_06z.bin + +2. (using default, fvpsas.rc) + > $script variableName + + result: variable values + +3. (direct template fill): + > $script -template myexp 20040101 060000 -fill %s.myfile.something.%y4%m2%d2_%h2z.bin + + result: myexp.myfile.something.20040101_06z.bin + +4. (-ncol option) + > $script -rc gsi.rc -ncol 2 OBS_INPUT + + result: ps t t q + +where + + myfile.rc contains the following line: + ------------------------------------- +templatename: %s.myfile.something.%y4%m2%d2_%h2z.bin + + fvpsas.rc contains the following line: + ------------------------------------- +variableName: variable values + + gsi.rc contains the following lines: + ----------------------------------- +OBS_INPUT:: +! dfile dtype dplat dsis dval dthin dsfcalc obsclass + prepbufr ps null ps 0.0 0 0 ncep_prep_bufr + prepbufr t null t 0.0 0 0 ncep_prep_bufr + prepbufr_profl t null t 0.0 0 0 ncep_acftpfl_bufr + prepbufr q null q 0.0 0 0 ncep_prep_bufr +:: +EOF +; + close INFO; + select $FH; + + system("echo \"$info\" | more"); + exit(); +} diff --git a/GMAO_hermes/m_const.f90 b/GMAO_hermes/m_const.f90 index 1305bf62..614bc04f 100644 --- a/GMAO_hermes/m_const.f90 +++ b/GMAO_hermes/m_const.f90 @@ -61,11 +61,14 @@ MODULE m_const ! Thermodynamic constants ! ----------------------- + real, parameter :: capice = 2000. ! MAPL J/(K kg) real, parameter :: cpd = 1004.16 real, parameter :: cpm = 1004.64 real, parameter :: cpv = 1869.46 - real, parameter :: alhl = 2.499e6 ! Latent heat consensation - real, parameter :: alhs = 2.845e6 ! Latent heat sublimation +! real, parameter :: alhl = 2.499e6 ! Latent heat consensation + real, parameter :: alhl = 2.4665e6 ! Latent heat consensation J/kg (MAPL) + real, parameter :: alhs = 2.845e6 ! Latent heat sublimation + real, parameter :: alhf = 3.3370e5 ! Latent heat sublimation J/Kg real, parameter :: stfbol = 5.6734e-8 real, parameter :: airmw = 28.965 ! molecular weight of air real, parameter :: h2omw = 18.015 ! molecular weight of H2O @@ -80,6 +83,7 @@ MODULE m_const real, parameter :: tice = 273.16 ! Freezing point ! real, parameter :: zvir = 4.61e2/rgas - 1. real, parameter :: zvir = rvap/rgas-1.0 ! MAPL + real, parameter :: capwtr = 4218. ! MAPL (J/(kg K)) @@ -97,6 +101,11 @@ MODULE m_const real, parameter :: eps = h2omw/airmw real, parameter :: virtcon = 0.609 real, parameter :: epsfac = eps*heatw/rgas*caltoj + +! Constituents +! ------------ + real, parameter :: o3_ppmv2gpg = 1.6571e-6 + real, parameter :: o3_gpg2ppmv = 1.0/o3_ppmv2gpg !EOC diff --git a/GMAO_hermes/m_dyn.f90 b/GMAO_hermes/m_dyn.f90 index 3dcecd72..9b6a7e46 100644 --- a/GMAO_hermes/m_dyn.f90 +++ b/GMAO_hermes/m_dyn.f90 @@ -1070,7 +1070,7 @@ end subroutine dyn_null ! subroutine dyn_put ( fname, nymd, nhms, prec, w_f, rc, & nstep, verbose, new, freq, epv, plevs, vectype, forceflip,& ! optional - only_vars, indxlevs ) ! optional + only_vars, indxlevs, skip_setvec ) ! optional ! ! !USES: ! @@ -1102,6 +1102,7 @@ subroutine dyn_put ( fname, nymd, nhms, prec, w_f, rc, & integer, intent(in), OPTIONAL :: vectype ! switch between g4/g5 dyn-vects logical, intent(in), OPTIONAL :: forceflip! allows flip of data%fields only logical, intent(in), OPTIONAL :: indxlevs ! place lev index instead of pressure levs in file + logical, intent(in), OPTIONAL :: skip_setvec ! skip set of meta-data - typically because user sets its own character(len=*), intent(in), OPTIONAL :: only_vars(:) ! write out only these fields ! @@ -1135,6 +1136,7 @@ subroutine dyn_put ( fname, nymd, nhms, prec, w_f, rc, & ! 16Jan2010 Todling Add forceflip here as already in the read ! 23Jun2010 Kokron Initialize fliplon to .false. ! 08May2018 Todling Allow for lev-index to be in file (MAPL only handles indx) +! 20Jun2020 Todling Allow for user-set of specs ! !EOP !------------------------------------------------------------------------- @@ -1154,6 +1156,7 @@ subroutine dyn_put ( fname, nymd, nhms, prec, w_f, rc, & integer :: fid, err, next logical verb, creating, fexists, fliplon + logical do_setvec integer, parameter :: READ_WRITE = 0 @@ -1262,7 +1265,13 @@ subroutine dyn_put ( fname, nymd, nhms, prec, w_f, rc, & ! Allow reset of variable names ! ----------------------------- - call dyn_setvectyp_ ( rc, w_f, vectype=vectype_ ) + do_setvec=.true. + if(present(skip_setvec)) then + if(skip_setvec) do_setvec=.false. + endif + if(do_setvec) then + call dyn_setvectyp_ ( rc, w_f, vectype=vectype_ ) + endif ! Setup variable information ! -------------------------- @@ -1349,7 +1358,7 @@ subroutine dyn_put ( fname, nymd, nhms, prec, w_f, rc, & if ( present(plevs) ) then vname(next) = 'slp' vtitle(next) = 'Sea level pressure' - vunits(next) = 'hPa' + vunits(next) = 'Pa' kmvar(next) = 0 else vname(next) = w_f%psm%name @@ -1758,7 +1767,7 @@ end Subroutine dyn_put ! subroutine dyn_get ( fname, nymd, nhms, w_f, rc, & nstep, timidx, freq, skipSPHU, vectype, forceflip, & ! optional - ncf, pncf ) ! optional + ncf, pncf, xtrnames ) ! optional ! ! !USES: ! @@ -1773,6 +1782,7 @@ subroutine dyn_get ( fname, nymd, nhms, w_f, rc, & logical, OPTIONAL, intent(in) :: skipSPHU ! if true, does not read SPHU integer, OPTIONAL, intent(in) :: vectype ! dyn-vector type (g4 or g5) logical, OPTIONAL, intent(in) :: forceflip! flip fields at user's request + character(len=*), OPTIONAL, intent(in), pointer :: xtrnames(:) ! name of addition tracers ! ! !INPUT/OUTPUT PARAMETERS: @@ -1833,6 +1843,7 @@ subroutine dyn_get ( fname, nymd, nhms, w_f, rc, & ! 06Mar2014 Todling pncf knob to allow reading non-compliant perturbation file created by GSI ! 16Oct2015 Todling For too long now MAP-written files have upset m_dyn; patch fix ! 01Oct2016 M.J. Kim Add qi,ql,qr,qs to perturbation +! 20Jun2020 Todling Allow for handling of additional named tracers ! !EOP !------------------------------------------------------------------------- @@ -1845,7 +1856,7 @@ subroutine dyn_get ( fname, nymd, nhms, w_f, rc, & real, allocatable :: valid_range(:,:), packing_range(:,:) integer, allocatable :: kmvar(:), yyyymmdd(:), hhmmss(:) - integer :: im, jm, km, lm, nvars + integer :: im, jm, km, lm, nvars, nx, nxt integer :: l, timinc, lbeg, myvtype,i real :: amiss @@ -2220,8 +2231,19 @@ subroutine dyn_get ( fname, nymd, nhms, w_f, rc, & else ! .not. ncf/pncf + nxt=0; nx=0 + if(present(xtrnames)) then + if(associated(xtrnames)) nxt=size(xtrnames) + endif do l = lbeg, lm - call GFIO_GetVar ( fid, w_f%qm(l)%name, nymd, nhms, & + fldname = trim(w_f%qm(l)%name) + if (nxt>0.and.fldname(1:6) == 'tracer') then + if (nx<=nxt) then + nx=nx+1 + fldname = trim(xtrnames(nx)) + endif + endif + call GFIO_GetVar ( fid, fldname, nymd, nhms, & im, jm, 1, km, w_f%q(:,:,:,l), err ) if ( l .eq. 2 .and. err .eq. -40 ) then rc = 1113 + l ! variable not found. @@ -2231,6 +2253,7 @@ subroutine dyn_get ( fname, nymd, nhms, w_f, rc, & w_f%q(:,:,:,l) = 0.0 ! for backward compatibility, if cloud fields not found, no problem end if if ( fliplon ) call hflip_ ( w_f%q(:,:,:,l),im,jm,km ) + if(nxt>0.and.nx==nxt) exit end do end if ! ncf/pncf diff --git a/GMAO_hermes/m_dyn_util.F90 b/GMAO_hermes/m_dyn_util.F90 index 291b6b6f..c6903f89 100644 --- a/GMAO_hermes/m_dyn_util.F90 +++ b/GMAO_hermes/m_dyn_util.F90 @@ -19,12 +19,14 @@ module m_dyn_util ! !REVISION HISTORY: ! ! 30Aug2017 Todling Initial wrap from collected utils +! 10Jun2020 Todling Add two versions of qsat ! !------------------------------------------------------------------------- !EOP public :: dyn_util_tv2t public :: Dyn_Scale_by_TotEne + public :: Dyn_Qsat interface Dyn_Util_Tv2T module procedure tv2t_ @@ -38,6 +40,31 @@ module m_dyn_util interface Dyn_TotEne_Dotp module procedure dotp_ end interface + interface Dyn_Qsat + module procedure becov_qsat_ + module procedure gsi_qsat_ + end interface + + integer, parameter :: nkxe = 1 ! index for kinetic energy contribution + integer, parameter :: nape = 2 ! index for avail. pot. energy contribution + integer, parameter :: ngpe = 3 ! index for geopotential. energy contribution + integer, parameter :: nqxe = 4 ! index for moist energy contribution + integer, parameter :: ntxe = 5 ! index for total dry energy + integer, parameter :: ntwe = 6 ! index for total wet energy + integer, parameter :: nall = 6 ! max index from those above + + character(len=*), dimension(nall), parameter :: vnames = & + (/'kxe','ape','pse','qxe','txe','twe'/) + character(len=*), dimension(nall), parameter :: vunits = & + (/'J/Kg','J/Kg','J/Kg','J/Kg','J/Kg','J/Kg'/) + character(len=*), dimension(nall), parameter :: vtitles = & + (/'Kinetic Energy ', & + 'Available Potential Energy', & + 'Potential Energy ', & + 'Latent Heat Energy ', & + 'Total Dry Energy ', & + 'Total Wet Energy '/) + CONTAINS @@ -175,9 +202,9 @@ subroutine scale_by_totene_(x,eps_eer,anorm,jnorm,projlon,projlat,projlev,& x%ts = 0.0 x%delp = 0.0 do k=1,x%grid%km - x%delp(:,:,k) = x%ps * sqrt(pfac) * w3d(:,:,k)! * pfac + x%delp(:,:,k) = x%ps * pfac * w3d(:,:,k) enddo - x%ps = x%ps * sqrt(pfac) * w2d + x%ps = x%ps * pfac * w2d if (optene_>0.or.normlz_) then call dotp_(x,dot,anorm,jnorm,nymd,nhms) endif @@ -433,8 +460,8 @@ subroutine horiz_grid_ (jn1, jweights, glats) tlat=tlat+rlat glats(j,1)=pi180*ulat glats(j,2)=pi180*tlat - slats(j,1)=sin(ulat) - slats(j,2)=sin(tlat) + slats(j,1)=dsin(real(ulat,8)) + slats(j,2)=dsin(real(tlat,8)) enddo ! jweights(1,1)=0.d0 ! not used @@ -474,8 +501,420 @@ subroutine dotp_(x,dot,anorm,jnorm,nymd,nhms) write (lu, '(6f20.12)') dot close (lu) endif + call get_ene_field_(x,nymd,nhms) end subroutine dotp_ + subroutine get_ene_field_(x,nymd,nhms) + + use m_GFIO_PutFld,only : GFIO_PutFld + implicit none + + integer, intent(in) :: nymd,nhms + type(dyn_vect) x + + real, allocatable :: energy_field(:,:,:,:) + + integer k,im,jm,km,ier + + im = x%grid%im + jm = x%grid%jm + km = x%grid%km + allocate(energy_field(im,jm,km,nall)) + + energy_field = 0.0 + + energy_field(:,:,:,nkxe) = x%u*x%u + x%v*x%v + energy_field(:,:,:,nape) = x%pt*x%pt + energy_field(:,:,:,nqxe) = x%q(:,:,:,1)*x%q(:,:,:,1) + energy_field(:,:,:,ngpe) = x%delp*x%delp + + energy_field(:,:,:,nape) = energy_field(:,:,:,nape) + energy_field(:,:,:,ngpe) + energy_field(:,:,:,ntxe) = energy_field(:,:,:,nape) + energy_field(:,:,:,nkxe) + energy_field(:,:,:,ntwe) = energy_field(:,:,:,nqxe) + energy_field(:,:,:,ntxe) + + call GFIO_PutFld ( 'gmao_pert_energy', 'GMAO', 'enepert.nc4', & + nymd, nhms, 240000, & + im,jm,km,x%grid%ptop,x%grid%ks,x%grid%ak,x%grid%bk, & + nall, vnames, vtitles, vunits, & + energy_field, ier, untag=.true. ) + + print *, 'Energy partition: ' + print *, 'Kinetic Energy: ', sum(energy_field(:,:,:,nkxe)) + print *, 'Moist Static Energy: ', sum(energy_field(:,:,:,nqxe)) + print *, 'Potential Energy: ', sum(energy_field(:,:,:,ngpe)) + print *, 'Avail. Potential Energy: ', sum(energy_field(:,:,:,nape)) + print *, 'Total dry Energy: ', sum(energy_field(:,:,:,ntxe)) + print *, 'Total wet Energy: ', sum(energy_field(:,:,:,ntwe)) + + deallocate(energy_field) + + end subroutine get_ene_field_ + +!................................................................. + + subroutine becov_qsat_(qsat,temp,pmk,lat2,lon2,icesat) +! +! input argument list: +! temp - virtual temperature (K) +! pmk - mean-layer pressure (Pa) +! lat2 - number of in the sub-domain array +! lon2 - number of longitudes in the sub-domain array +! icesat - logical flag: T=include ice and ice-water effects, +! depending on t, in qsat and esat calcuations. +! otherwise, compute esat and qsat with respect to water surface +! depending on t, in qsat and esat calcuations. +! otherwise, compute esat and qsat with respect to water surface +! +! output argument list: +! qsat - specific humidity (input), saturation specific humidity (output) +! 10Jun2020 Todling pulled it from NCEP_bkgecov into here +! (a) 3d into 2d +! (b) note that routine is invariant to lat/lon and lon/lat +! (c) note that routine is invariant wrt vertical grid +! orientation +! + use m_realkinds, only : fp_kind => kind_r4 +! use m_const, only: fv=>zvir +! use m_const, only: rv=>rvap +! use m_const, only: rd=>rgas +! use m_const, only: cvap=>cpv +! use m_const, only: hvap=>alhl + implicit none + + logical,intent(in):: icesat + integer,intent(in):: lat2,lon2 + real(fp_kind),intent(inout),dimension(:,:):: qsat + real(fp_kind),intent(in),dimension(:,:):: temp + real(fp_kind),intent(in),dimension(:,:):: pmk + + real,parameter :: rd = 2.8705e+2_fp_kind ! gas constant of dry air (J/kg/K) + real,parameter :: rv = 4.6150e+2_fp_kind ! gas constant of h2o vapor (J/kg/K) + real,parameter :: fv = rv/rd-1._fp_kind ! used in virtual temp. equation (adim) + real,parameter :: cvap = 1.8460e+3_fp_kind ! specific heat of h2o vapor (J/kg/K) + real,parameter :: hvap = 2.5000e+6_fp_kind ! latent heat of h2o condensation (J/kg) + + real,parameter :: cliq = 4.1855e+3_fp_kind ! specific heat of liquid h2o (J/kg/K) + real,parameter :: psat = 6.1078e+2_fp_kind ! pressure at h2o triple point (Pa) + real,parameter :: csol = 2.1060e+3_fp_kind ! specific heat of solid h2o (ice)(J/kg/K) + real,parameter :: ttp = 2.7316e+2_fp_kind ! temperature at h2o triple point (K) + real,parameter :: hfus = 3.3358e+5_fp_kind ! latent heat of h2o fusion (J/kg) + + real,parameter :: zero=0.0_fp_kind + real,parameter :: one=1.0_fp_kind + + real,parameter :: dldt=cvap-cliq + real,parameter :: xa=-dldt/rv + real,parameter :: xb=xa+hvap/(rv*ttp) + real,parameter :: hsub=hvap+hfus + real,parameter :: dldti=cvap-csol + real,parameter :: xai=-dldti/rv + real,parameter :: xbi=xai+hsub/(rv*ttp) + real,parameter :: tmix=ttp-20.0_fp_kind + real,parameter :: eps=rd/rv + real,parameter :: omeps = 1._fp_kind-eps + integer k,j,i + real(fp_kind) pw,q,tdry,tr,es,qs,esi,esw + real(fp_kind) w,pscl,esmax +! + pscl = 1.00_fp_kind ! input pressure in Pa as required + + if (icesat) then +! do k = 1,nsig + do j = 1,lon2 + do i = 1,lat2 + + pw = pmk(i,j) + pw = pscl*pw +! maximum vapor pressure 5% of atmospheric pressure + esmax=0.05*pw + + q = qsat(i,j) + if (q.lt.zero) q=zero + + tdry = temp(i,j)/(one+fv*q) + tr = ttp/tdry + if (tdry >= ttp) then + es = psat * (tr**xa) * exp(xb*(one-tr)) + elseif (tdry < tmix) then + es = psat * (tr**xai) * exp(xbi*(one-tr)) + else + w = (tdry - tmix) / (ttp - tmix) + es = w * psat * (tr**xa) * exp(xb*(one-tr)) & + + (one-w) * psat * (tr**xai) * exp(xbi*(one-tr)) + endif + + es = min(es,esmax) + qs = eps * es / (pw - omeps * es) + + if (qs.lt.qsat(i,j)) then + tdry = temp(i,j)/(one+fv*qs) + tr = ttp/tdry + if (tdry >= ttp) then + es = psat * (tr**xa) * exp(xb*(one-tr)) + elseif (tdry < tmix) then + es = psat * (tr**xai) * exp(xbi*(one-tr)) + else + w = (tdry - tmix) / (ttp - tmix) + es = w * psat * (tr**xa) * exp(xb*(one-tr)) & + + (one-w) * psat * (tr**xai) * exp(xbi*(one-tr)) + endif + + es = min(es,esmax) + qs = eps * es / (pw - omeps * es) + + tdry = temp(i,j)/(one+fv*qs) + tr = ttp/tdry + if (tdry >= ttp) then + es = psat * (tr**xa) * exp(xb*(one-tr)) + elseif (tdry < tmix) then + es = psat * (tr**xai) * exp(xbi*(one-tr)) + else + w = (tdry - tmix) / (ttp - tmix) + es = w * psat * (tr**xa) * exp(xb*(one-tr)) & + + (one-w) * psat * (tr**xai) * exp(xbi*(one-tr)) + endif + es = min(es,esmax) + qs = eps * es / (pw - omeps * es) + + end if + + qsat(i,j) = qs + + end do + end do +! end do + +! +! Compute saturation values with respect to water surface + else +! do k = 1,nsig + do j = 1,lon2 + do i = 1,lat2 + + pw = pmk(i,j) + pw = pscl*pw +! maximum vapor pressure 5% of atmospheric pressure + esmax=0.05*pw + + q = qsat(i,j) + if (q.lt.zero) q=zero + + tdry = temp(i,j)/(one+fv*q) + tr = ttp/tdry + es = psat * (tr**xa) * exp(xb*(one-tr)) + es = min(es,esmax) + qs = eps * es / (pw - omeps * es) + + if (qs.lt.qsat(i,j)) then + tdry = temp(i,j)/(one+fv*qs) + tr = ttp/tdry + es = psat * (tr**xa) * exp(xb*(one-tr)) + es = min(es,esmax) + qs = eps * es / (pw - omeps * es) + tdry = temp(i,j)/(one+fv*qs) + tr = ttp/tdry + es = psat * (tr**xa) * exp(xb*(one-tr)) + es = min(es,esmax) + qs = eps * es / (pw - omeps * es) + + end if + qsat(i,j) = qs + + + end do + end do +! end do + + endif + + return + end subroutine becov_qsat_ + +!................................................................. + + subroutine gsi_qsat_(qsat,tsen,prsl,lat2,lon2,nsig,ice,ntop) +!$$$ subprogram documentation block +! . . . . +! subprogram: genqsat +! prgmmr: derber org: np23 date: 1998-01-14 +! +! abstract: obtain saturation specific humidity for given temperature. +! +! program history log: +! 1998-01-14 derber +! 1998-04-05 weiyu yang +! 1999-08-24 derber, j., treadon, r., yang, w., first frozen mpp version +! 1903-10-07 Wei Gu, bug fixes,if qs<0,then set qs=0; merge w/ GSI by R Todling +! 2003-12-23 kleist, use guess pressure, adapt module framework +! 2004-05-13 kleist, documentation +! 2004-06-03 treadon, replace ggrid_g3 array with ges_* arrays +! 2005-02-23 wu, output dlnesdtv +! 2005-11-21 kleist, derber add dmax array to decouple moisture from temp and +! pressure for questionable qsat +! 2006-02-02 treadon - rename prsl as ges_prsl +! 2006-09-18 derber - modify to limit saturated values near top +! 2006-11-22 derber - correct bug: es kind_r4 + use m_const, only: fv=>zvir + use m_const, only: rv=>rvap + use m_const, only: rd=>rgas + use m_const, only: cvap=>cpv + use m_const, only: hvap=>alhl + use m_const, only: hfus=>alhf + use m_const, only: cliq=>capwtr + use m_const, only: csol=>capice +! use constants, only: xai,tmix,xb,omeps,eps,xbi,one,xa,psat,ttp + implicit none + + logical ,intent(in ) :: ice + integer ,intent(in ) :: lat2,lon2,nsig + real(r_kind),dimension(lat2,lon2,nsig),intent( out) :: qsat + real(r_kind),dimension(lat2,lon2,nsig),intent(in ) :: tsen,prsl + integer,optional ,intent(in ) :: ntop + +! real,parameter :: rd = 2.8705e+2_r_kind ! gas constant of dry air (J/kg/K) +! real,parameter :: rv = 4.6150e+2_r_kind ! gas constant of h2o vapor (J/kg/K) +! real,parameter :: fv = rv/rd-1._r_kind ! used in virtual temp. equation (adim) +! real,parameter :: cvap = 1.8460e+3_r_kind ! specific heat of h2o vapor (J/kg/K) +! real,parameter :: hvap = 2.5000e+6_r_kind ! latent heat of h2o condensation (J/kg) + +! real,parameter :: cliq = 4.1855e+3_r_kind ! specific heat of liquid h2o (J/kg/K) + real,parameter :: psat = 6.1078e+2_r_kind ! pressure at h2o triple point (Pa) +! real,parameter :: csol = 2.1060e+3_r_kind ! specific heat of solid h2o (ice)(J/kg/K) + real,parameter :: ttp = 2.7316e+2_r_kind ! temperature at h2o triple point (K) +! real,parameter :: hfus = 3.3358e+5_r_kind ! latent heat of h2o fusion (J/kg) + + real,parameter :: zero=0.0_r_kind + real,parameter :: one=1.0_r_kind + + real,parameter :: dldt=cvap-cliq + real,parameter :: xa=-dldt/rv + real,parameter :: xb=xa+hvap/(rv*ttp) + real,parameter :: hsub=hvap+hfus + real,parameter :: dldti=cvap-csol + real,parameter :: xai=-dldti/rv + real,parameter :: xbi=xai+hsub/(rv*ttp) + real,parameter :: tmix=ttp-20.0_r_kind + real,parameter :: eps=rd/rv + real,parameter :: omeps = 1._r_kind-eps + +! Declare local parameters + integer k,j,i,nbot,ntop_ + real(r_kind) pw,tdry,tr,es,es2 + real(r_kind) w,onep3,esmax + real(r_kind) esi,esw + real(r_kind),dimension(lat2):: mint,estmax + integer,dimension(lat2):: lmint + + onep3 = 1.0_r_kind + ntop_ = nsig ! GSI top level index + if(present(ntop)) then + ntop_ = ntop + endif + nbot = nsig-ntop_+1 + + do j=1,lon2 + do i=1,lat2 + mint(i)=340._r_kind + lmint(i)=ntop_ + end do + do k=1,nsig + do i=1,lat2 + if((prsl(i,j,k) < 30._r_kind .and. & + prsl(i,j,k) > 0._r_kind) .and. & + tsen(i,j,k) < mint(i))then + lmint(i)=k + mint(i)=tsen(i,j,k) + end if + end do + end do + do i=1,lat2 + tdry = mint(i) + if( abs(tdry) < 1.0e-8_r_kind ) tdry = 1.0e-8_r_kind + tr = ttp/tdry + if (tdry >= ttp .or. .not. ice) then + estmax(i) = psat * (tr**xa) * exp(xb*(one-tr)) + elseif (tdry < tmix) then + estmax(i) = psat * (tr**xai) * exp(xbi*(one-tr)) + else + w = (tdry - tmix) / (ttp - tmix) + estmax(i) = w * psat * (tr**xa) * exp(xb*(one-tr)) & + + (one-w) * psat * (tr**xai) * exp(xbi*(one-tr)) + endif + end do + + do k = 1,nsig + do i = 1,lat2 + tdry = tsen(i,j,k) + if( abs(tdry) < 1.0e-8_r_kind ) tdry = 1.0e-8_r_kind + tr = ttp/tdry + if (tdry >= ttp .or. .not. ice) then + es = psat * (tr**xa) * exp(xb*(one-tr)) + elseif (tdry < tmix) then + es = psat * (tr**xai) * exp(xbi*(one-tr)) + else + esw = psat * (tr**xa) * exp(xb*(one-tr)) + esi = psat * (tr**xai) * exp(xbi*(one-tr)) + w = (tdry - tmix) / (ttp - tmix) +! es = w * esw + (one-w) * esi + es = w * psat * (tr**xa) * exp(xb*(one-tr)) & + + (one-w) * psat * (tr**xai) * exp(xbi*(one-tr)) + + endif + + pw = onep3*prsl(i,j,k) + esmax = es + if (nbot==1) then + if(lmint(i) < k)then + esmax=0.1_r_kind*pw + esmax=min(esmax,estmax(i)) + end if + else + if(lmint(i) > k)then + esmax=0.1_r_kind*pw + esmax=min(esmax,estmax(i)) + end if + end if + es2=min(es,esmax) + qsat(i,j,k) = eps * es2 / (pw - omeps * es2) + + end do + end do + end do + return + end subroutine gsi_qsat_ + !................................................................. end module m_dyn_util diff --git a/GMAO_hermes/m_set_eta.F90 b/GMAO_hermes/m_set_eta.F90 index 06048f8f..8e29f1f5 100644 --- a/GMAO_hermes/m_set_eta.F90 +++ b/GMAO_hermes/m_set_eta.F90 @@ -22,7 +22,7 @@ #ifdef HERMES module m_set_eta - use, intrinsic :: iso_fortran_env, only: REAL32, REAL64 + use, intrinsic :: iso_fortran_env, only: REAL32, REAL64 PRIVATE PUBLIC set_eta PUBLIC get_ref_plevs diff --git a/GMAO_hermes/m_spline.f90 b/GMAO_hermes/m_spline.f90 index 0ade1406..09dfbb44 100644 --- a/GMAO_hermes/m_spline.f90 +++ b/GMAO_hermes/m_spline.f90 @@ -75,10 +75,10 @@ subroutine spline_interp_r4_ ( xi, xo, yi, yo ) real(kind=REAL32) :: yi(:) real(kind=REAL32) :: yo(:) - real(kind=REAL64), allocatable, dimension(:) :: b(:), c(:), d(:) - real(kind=REAL64), allocatable, dimension(:) :: xxi(:) - real(kind=REAL64), allocatable, dimension(:) :: yyi(:) - real(kind=REAL64), allocatable, dimension(:) :: xxo(:) + real(kind=REAL64), allocatable :: b(:), c(:), d(:) + real(kind=REAL64), allocatable :: xxi(:) + real(kind=REAL64), allocatable :: yyi(:) + real(kind=REAL64), allocatable :: xxo(:) integer k,ni,no logical reverse_ diff --git a/GMAO_mpeu/CMakeLists.txt b/GMAO_mpeu/CMakeLists.txt index a34c8e47..986ceaa7 100644 --- a/GMAO_mpeu/CMakeLists.txt +++ b/GMAO_mpeu/CMakeLists.txt @@ -1,52 +1,55 @@ esma_set_this() +add_subdirectory(mpi0) + set(srcs get_zeits.c m_mpif.F m_random.F m_FileResolv.f90 - m_date.F90 - m_datetime.F90 - m_IndexBin_char.F90 - m_IndexBin_integer.F90 - m_IndexBin_logical.F90 - m_List.F90 - m_MergeSorts.F90 - m_Filename.F90 - m_Group.F90 - m_Permuter.F90 - m_SortingTools.F90 - m_String.F90 - m_StrTemplate.F90 - m_chars.F90 - m_die.F90 - m_dropdead.F90 - m_flow.F90 - m_inpak90.F90 - m_intkinds.F90 - m_ioutil.F90 - m_mall.F90 - m_mergedList.F90 - m_mpif90.F90 - m_mpout.F90 - m_parDOT.F90 - m_rankMerge.F90 - m_realkinds.F90 - m_showDistrib.F90 - m_stdio.F90 - m_zeit.F90 - m_sysclocks.F90 - m_ior4.F90 - m_rGrADS.F90 - m_wGrADS.F90 - m_GrADS.F90 + m_date.F90 + m_datetime.F90 + m_IndexBin_char.F90 + m_IndexBin_integer.F90 + m_IndexBin_logical.F90 + m_List.F90 + m_MergeSorts.F90 + m_Filename.F90 + m_Group.F90 + m_Permuter.F90 + m_SortingTools.F90 + m_String.F90 + m_StrTemplate.F90 + m_chars.F90 + m_die.F90 + m_dropdead.F90 + m_flow.F90 + m_inpak90.F90 + m_intkinds.F90 + m_ioutil.F90 + m_mall.F90 + m_mergedList.F90 + m_mpif90.F90 + m_mpout.F90 + m_parDOT.F90 + m_rankMerge.F90 + m_realkinds.F90 + m_showDistrib.F90 + m_stdio.F90 + m_zeit.F90 + m_sysclocks.F90 + m_ior4.F90 + m_rGrADS.F90 + m_wGrADS.F90 + m_GrADS.F90 m_fpe.F90 ) -esma_add_library(${this} SRCS ${srcs}) +esma_add_library(${this} SRCS ${srcs} DEPENDENCIES MPI::MPI_Fortran) -# Other dependencies -target_link_libraries(${this} PUBLIC ${MPI_Fortran_LIBRARIES}) -target_include_directories(${this} PUBLIC ${MPI_Fortran_INCLUDE_PATH}) +esma_add_library(GMAO_eu SRCS ${srcs} DEPENDENCIES mpi0) +target_include_directories (GMAO_eu PRIVATE $) +file (MAKE_DIRECTORY ${esma_include}/GMAO_eu) +file (MAKE_DIRECTORY ${esma_etc}/GMAO_eu) ############################################################# # Exceptional cases: @@ -56,7 +59,9 @@ set_source_files_properties (m_FileResolv.f90 PROPERTIES COMPILE_FLAGS ${PP}) # NAG notices if the same procedure is called with varying types in the absence # of an explicit interface. target_compile_options (${this} PRIVATE $<$:${MISMATCH}>) +target_compile_options (GMAO_eu PRIVATE $<$:${MISMATCH}>) file (COPY assert.H DESTINATION ${include_${this}}) +file (COPY assert.H DESTINATION ${esma_include}/GMAO_eu) diff --git a/GMAO_mpeu/mpi0/CMakeLists.txt b/GMAO_mpeu/mpi0/CMakeLists.txt new file mode 100644 index 00000000..dbd41197 --- /dev/null +++ b/GMAO_mpeu/mpi0/CMakeLists.txt @@ -0,0 +1,45 @@ +esma_set_this() + +set (srcs + m_SHMEM.F90 + mpi_abort.F90 + mpi_comm_dup.F90 + mpi_comm_free.F90 + mpi_comm_rank.F90 + mpi_comm_size.F90 + mpi_error_string.F90 + mpi_finalize.F90 + mpi_init.F90 + mpi_initialized.F90 + mpi_isend.F90 + mpi_send.F90 + mpi_sendrecv.F90 + mpi_recv.F90 + mpi_irecv.F90 + mpi_waitall.F90 + mpi_wtick.F90 + mpi_wtime.F90 + mpi_barrier.F90 + mpi_bcast.F90 + mpi_gather.F90 + mpi_gatherv.F90 + mpi_scatter.F90 + mpi_scatterv.F90 + mpi_allgather.F90 + mpi_allgatherv.F90 + mpi_alltoall.F90 + mpi_alltoallv.F90 + mpi_reduce.F90 + mpi_allreduce.F90 + mpi_reduce_scatter.F90 + mpi0_copy.F90 + mpi_zzz.F90 + mpi_wait.F90 + mpi_comm_split.F90 + m_mpi0.F + Const_MPItype.H + ../get_zeits.c + ) + +esma_add_library(${this} SRCS ${srcs}) +target_include_directories (${this} PRIVATE $) diff --git a/GMAO_mpeu/mpi0/mpi_zzz.F90 b/GMAO_mpeu/mpi0/mpi_zzz.F90 index bcfd5d1d..99fff138 100644 --- a/GMAO_mpeu/mpi0/mpi_zzz.F90 +++ b/GMAO_mpeu/mpi0/mpi_zzz.F90 @@ -1,4 +1,4 @@ -#if defined (sysOSF1) || defined(sysLinux) +#if defined (sysOSF1) || defined(sysLinux) || defined(sysDarwin) ! ! Added because the compiler requires the presence of these procedures, ! although they are not actually used, but only declared by the system diff --git a/GMAO_ods/CMakeLists.txt b/GMAO_ods/CMakeLists.txt index ce068dd9..4bd74130 100644 --- a/GMAO_ods/CMakeLists.txt +++ b/GMAO_ods/CMakeLists.txt @@ -2,7 +2,7 @@ esma_set_this () set (MODSRC m_ods.f90 m_roms.f90 m_odsmeta.f m_ods_structure.f m_ods_obsdiags.F90 - m_saber.f m_odsxsup.f90 m_Sndx.F90 m_ODS_Sample.f m_mraob.f90 + m_saber.f m_odsxsup.f90 m_Sndx.F90 m_ODS_Sample.f m_mraob.f90 m_obs_stats.F90 ) set (ODSSRC @@ -31,24 +31,14 @@ set (ODSSRC ods_julhr.f ods_ncp_itoi2.f ods_resetp.f odsnxtime.f ods_eget.f ods_dcget.f ods_dconv.f ods_dcscan.f ods_drad.f ods_dsbuv.f ods_dpcp.f ods_rmdupl.f - ods_do3lev.f + ods_do3lev.f ods_diagnc4.f90 ) if (CMAKE_Fortran_COMPILER_ID MATCHES Intel) string (REPLACE "${OPTREPORT0}" "${BIG_ENDIAN}" CMAKE_Fortran_FLAGS_RELEASE ${CMAKE_Fortran_FLAGS_RELEASE}) - string (REPLACE "${FTZ}" "" CMAKE_Fortran_FLAGS_RELEASE ${CMAKE_Fortran_FLAGS_RELEASE}) - string (REPLACE "${ALIGN_ALL}" "" CMAKE_Fortran_FLAGS_RELEASE ${CMAKE_Fortran_FLAGS_RELEASE}) - string (REPLACE "${NO_ALIAS}" "" CMAKE_Fortran_FLAGS_RELEASE ${CMAKE_Fortran_FLAGS_RELEASE}) -else () - set_target_properties (${this} PROPERTIES COMPILE_FLAGS ${BIG_ENDIAN}) - set_target_properties (saber2ods.x PROPERTIES COMPILE_FLAGS ${BIG_ENDIAN}) - set_target_properties (dconv2ods.x PROPERTIES COMPILE_FLAGS ${BIG_ENDIAN}) - set_target_properties (odsmatch PROPERTIES COMPILE_FLAGS ${BIG_ENDIAN}) - set_target_properties (odslist PROPERTIES COMPILE_FLAGS ${BIG_ENDIAN}) - set_target_properties (odsselect PROPERTIES COMPILE_FLAGS ${BIG_ENDIAN}) - set_target_properties (odsshuffle PROPERTIES COMPILE_FLAGS ${BIG_ENDIAN}) - set_target_properties (odsstats PROPERTIES COMPILE_FLAGS ${BIG_ENDIAN}) - set_target_properties (odsemean PROPERTIES COMPILE_FLAGS ${BIG_ENDIAN}) + string (REPLACE "${FTZ}" "" CMAKE_Fortran_FLAGS_RELEASE ${CMAKE_Fortran_FLAGS_RELEASE}) + string (REPLACE "${ALIGN_ALL}" "" CMAKE_Fortran_FLAGS_RELEASE ${CMAKE_Fortran_FLAGS_RELEASE}) + string (REPLACE "${NO_ALIAS}" "" CMAKE_Fortran_FLAGS_RELEASE ${CMAKE_Fortran_FLAGS_RELEASE}) endif () esma_add_library (${this} @@ -57,39 +47,48 @@ esma_add_library (${this} INCLUDES ${INC_NETCDF} ) -ecbuild_add_executable (TARGET ods_scan.x SOURCES ods_scan.f LIBS ${this} ${NETCDF_LIBRARIES}) -ecbuild_add_executable (TARGET dconv2ods.x SOURCES dconv2ods.f LIBS ${this} ${NETCDF_LIBRARIES}) -ecbuild_add_executable (TARGET ods_blank.x SOURCES ods_blank.f90 LIBS ${this} ${NETCDF_LIBRARIES}) -ecbuild_add_executable (TARGET ods_maker.x SOURCES ods_maker.f90 LIBS ${this} ${NETCDF_LIBRARIES}) -ecbuild_add_executable (TARGET ods_sample.x SOURCES ods_sample.f LIBS ${this} ${NETCDF_LIBRARIES}) +ecbuild_add_executable (TARGET ods_scan.x SOURCES ods_scan.f LIBS ${this} ${NETCDF_LIBRARIES}) +ecbuild_add_executable (TARGET dconv2ods.x SOURCES dconv2ods.f LIBS ${this} ${NETCDF_LIBRARIES}) +ecbuild_add_executable (TARGET ods_blank.x SOURCES ods_blank.f90 LIBS ${this} ${NETCDF_LIBRARIES}) +ecbuild_add_executable (TARGET ods_maker.x SOURCES ods_maker.f90 LIBS ${this} ${NETCDF_LIBRARIES}) +ecbuild_add_executable (TARGET ods_sample.x SOURCES ods_sample.f LIBS ${this} ${NETCDF_LIBRARIES}) ecbuild_add_executable (TARGET ods_synX2Y.x SOURCES ods_synX2Y.f90 LIBS ${this} ${NETCDF_LIBRARIES}) -ecbuild_add_executable (TARGET ods_tally.x SOURCES ods_tally.f90 LIBS ${this} ${NETCDF_LIBRARIES}) -ecbuild_add_executable (TARGET saber2ods.x SOURCES saber2ods.f LIBS ${this} ${NETCDF_LIBRARIES}) -ecbuild_add_executable (TARGET odslist SOURCES odslist.f LIBS ${this} ${NETCDF_LIBRARIES}) -ecbuild_add_executable (TARGET odsmatch SOURCES odsmatch.f LIBS ${this} ${NETCDF_LIBRARIES}) -ecbuild_add_executable (TARGET odsselect SOURCES odsselect.f LIBS ${this} ${NETCDF_LIBRARIES}) -ecbuild_add_executable (TARGET odsshuffle SOURCES odsshuffle.f LIBS ${this} ${NETCDF_LIBRARIES}) -ecbuild_add_executable (TARGET odsstats SOURCES odsstats.f LIBS ${this} ${NETCDF_LIBRARIES}) -ecbuild_add_executable (TARGET odsemean SOURCES odsemean.f LIBS ${this} ${NETCDF_LIBRARIES}) +ecbuild_add_executable (TARGET ods_tally.x SOURCES ods_tally.f90 LIBS ${this} ${NETCDF_LIBRARIES}) +ecbuild_add_executable (TARGET saber2ods.x SOURCES saber2ods.f LIBS ${this} ${NETCDF_LIBRARIES}) +ecbuild_add_executable (TARGET odslist SOURCES odslist.f LIBS ${this} ${NETCDF_LIBRARIES}) +ecbuild_add_executable (TARGET odsmatch SOURCES odsmatch.f LIBS ${this} ${NETCDF_LIBRARIES}) +ecbuild_add_executable (TARGET odsselect SOURCES odsselect.f LIBS ${this} ${NETCDF_LIBRARIES}) +ecbuild_add_executable (TARGET odsshuffle SOURCES odsshuffle.f LIBS ${this} ${NETCDF_LIBRARIES}) +ecbuild_add_executable (TARGET odsstats SOURCES odsstats.f LIBS ${this} ${NETCDF_LIBRARIES}) +ecbuild_add_executable (TARGET odsemean SOURCES odsemean.f LIBS ${this} ${NETCDF_LIBRARIES}) -if (EXTENDED_SOURCE) - set_target_properties (${this} PROPERTIES COMPILE_FLAGS ${EXTENDED_SOURCE}) - set_target_properties (saber2ods.x PROPERTIES COMPILE_FLAGS ${EXTENDED_SOURCE}) - set_target_properties (dconv2ods.x PROPERTIES COMPILE_FLAGS ${EXTENDED_SOURCE}) - set_target_properties (odsmatch PROPERTIES COMPILE_FLAGS ${EXTENDED_SOURCE}) - set_target_properties (odslist PROPERTIES COMPILE_FLAGS ${EXTENDED_SOURCE}) - set_target_properties (odsselect PROPERTIES COMPILE_FLAGS ${EXTENDED_SOURCE}) - set_target_properties (odsshuffle PROPERTIES COMPILE_FLAGS ${EXTENDED_SOURCE}) - set_target_properties (odsstats PROPERTIES COMPILE_FLAGS ${EXTENDED_SOURCE}) - set_target_properties (odsemean PROPERTIES COMPILE_FLAGS ${EXTENDED_SOURCE}) -endif() +set (targets_for_extra_flags + ${this} + saber2ods.x + dconv2ods.x + odsmatch + odslist + odsselect + odsshuffle + odsstats + odsemean + ) + +foreach (target ${targets_for_extra_flags}) + if (EXTENDED_SOURCE) + set_target_properties (${target} PROPERTIES COMPILE_OPTIONS ${EXTENDED_SOURCE}) + endif() + if (NOT CMAKE_Fortran_COMPILER_ID MATCHES Intel) + set_target_properties (${target} PROPERTIES COMPILE_OPTIONS ${BIG_ENDIAN}) + endif () +endforeach () install( PROGRAMS unique_instruments.csh obimp_summary.pl diag2ods DESTINATION bin ) -file (GLOB rc_files *.rc) +file (GLOB rc_files CONFIGURE_DEPENDS *.rc) install ( FILES ${rc_files} odslist.odt DESTINATION etc @@ -100,15 +99,19 @@ install ( DESTINATION lib/Python/pyods ) -include(UseF2Py) -add_f2py_module(pyods_ - SOURCES pyods_.F90 - LIBRARIES GMAO_ods GMAO_mpeu ${NETCDF_LIBRARIES} - INCLUDEDIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/lib ${BASEDIR}/lib ${include_${this}} ${INC_NETCDF} - DESTINATION lib/Python/pyods - USE_MPI - ) -add_dependencies(pyods_ ${this}) +if (USE_F2PY) + find_package(F2PY2) + if (F2PY2_FOUND) + esma_add_f2py2_module(pyods_ + SOURCES pyods_.F90 + LIBRARIES GMAO_ods GMAO_mpeu ${NETCDF_LIBRARIES} + INCLUDEDIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/lib ${BASEDIR}/lib ${include_${this}} ${INC_NETCDF} + DESTINATION lib/Python/pyods + USE_MPI + ) + add_dependencies(pyods_ ${this}) + endif () +endif () separate_arguments(ODSMETA_ARGS NATIVE_COMMAND "sed -e 's/integer, parameter//g' -e 's/:://g' -e 's/\!/ #/g' -e 's/^[ ]*//g'") add_custom_command ( diff --git a/GMAO_ods/conv-kx.readme b/GMAO_ods/conv-kx.readme index 9be39a18..c4f1852e 100644 --- a/GMAO_ods/conv-kx.readme +++ b/GMAO_ods/conv-kx.readme @@ -81,19 +81,34 @@ ! GPS KX are assigned by satellite ID 3 MetOp-B GRAS 4 MetOp-A GRAS + 5 MetOp-C GRAS 41 CHAMP 42 TerraSAR-X 43 TanDEM-X + 44 PAZ 421 Oceansat-2 440 Megha-Tropiques 722 GRACE-A 723 GRACE-B + 724 COSMIC-2 P1 + 725 COSMIC-2 P2 + 726 COSMIC-2 P3 + 727 COSMIC-2 P4 + 728 COSMIC-2 P5 + 729 COSMIC-2 P6 740 COSMIC-1 741 COSMIC-2 742 COSMIC-3 743 COSMIC-4 744 COSMIC-5 745 COSMIC-6 + 750 COSMIC-2 E1 + 751 COSMIC-2 E2 + 752 COSMIC-2 E3 + 753 COSMIC-2 E4 + 754 COSMIC-2 E5 + 755 COSMIC-2 E6 786 C/NOFS CORISS 820 SAC-C 821 SAC-D + 825 KOMPSAT-5 diff --git a/GMAO_ods/diag2ods b/GMAO_ods/diag2ods index 60d4f5c8..c132335b 100644 --- a/GMAO_ods/diag2ods +++ b/GMAO_ods/diag2ods @@ -41,6 +41,7 @@ # 02Apr2014 Todling Add -psigo as opt to allow writing out ods files w/ prescribed sigo # 04Nov2015 Todling Correct handling of omf files # 18Dec2016 Todling Add handle for reduced-diag files from GSI (ensemble observers) +# 28Aug2019 Sienkiewicz add -nc4 switch to process 'nc4' files instead of 'bin' #----------------------------------------------------------------------------- use Env; # make env vars readily available @@ -48,7 +49,6 @@ use FindBin; # so we can find where this script resides use File::Basename; # for basename(), dirname() use File::Copy "cp"; # for cp() use Getopt::Long; # command line options -use Shell qw(cat rm); # cat command use Time::Local; # time functions # look for perl packages in the following locations @@ -57,7 +57,7 @@ use lib ( "$FindBin::Bin", "$FVROOT/bin", "$ESMADIR/$ARCH/bin" ); # Command line options # -------------------- - GetOptions( "h", "i=s", "o=s", "m=s", "omf", "sens", "reduce_diag", "psigo", "type=s", "log=s", "res=s", "dir=s", "single", "ncpus=i", "rc=s" ); + GetOptions( "h", "i=s", "o=s", "m=s", "omf", "sens", "reduce_diag", "psigo", "type=s", "log=s", "res=s", "dir=s", "single", "ncpus=i", "rc=s", "nc4" ); usage() if $opt_h; @@ -114,12 +114,12 @@ sub d2o_all { #---------------# # child process # #---------------# - @files = glob("$filepath/*diag_${grp}*${res0}*${nymdhh}.bin") + @files = glob("$filepath/*diag_${grp}*${res0}*${nymdhh}.$suffix") or print "($myname):No match\n"; foreach $file (@files) { d2o($file,$xcmd[0],$res0) }; if ( $dooma || $miter > 1 ) { - @files = glob("$filepath/*diag_${grp}*${res1}*${nymdhh}.bin") + @files = glob("$filepath/*diag_${grp}*${res1}*${nymdhh}.$suffix") or print "($myname):No match\n"; foreach $file (@files) { d2o($file,$xcmd[1],$res1) }; } @@ -196,9 +196,9 @@ sub matchOMA { die ">>>> ERROR <<< running odsmatch" if ( $rc ); print " $0: odsmatch \$rc = $rc\n"; print "rm $expid.${grp}_${res0}.${nymdhh}.ods \n"; - rm("$expid.${grp}_${res0}.${nymdhh}.ods"); + unlink("$expid.${grp}_${res0}.${nymdhh}.ods"); print "rm $expid.${grp}_${res1}.${nymdhh}.ods \n"; - rm("$expid.${grp}_${res1}.${nymdhh}.ods"); + unlink("$expid.${grp}_${res1}.${nymdhh}.ods"); } exit; } @@ -227,7 +227,7 @@ sub matchOMA { die ">>>> ERROR <<< creating single ods file" if ( $rc ); print " $0: odsselect \$rc = $rc\n"; print "rm ${odsfnbase}_${grp}.${nymdhh}.ods \n"; - rm("${odsfnbase}_${grp}.${nymdhh}.ods"); + unlink("${odsfnbase}_${grp}.${nymdhh}.ods"); } } @@ -301,7 +301,7 @@ sub imp0hr { die ">>>> ERROR <<< running odsmatch during imp0hr" if ( $rc ); print " $0: odsmatch \$rc = $rc\n"; print "rm $expid.selgood_${grp}.${nymdhh}.ods \n"; - rm("$expid.selgood_${grp}.${nymdhh}.ods"); + unlink("$expid.selgood_${grp}.${nymdhh}.ods"); } exit; } @@ -534,7 +534,13 @@ sub init { @xcmd = ( "" , "" ); } $res0 = $resd[0]; - $res1 = $resd[1]; + $res1 = $resd[1]; + + if ( $opt_nc4 ) { + $suffix = "nc4"; + } else { + $suffix = "bin"; + } if ( $opt_type ) { @dgrps = ( $opt_type ); @@ -553,8 +559,8 @@ sub init { # Clean up # -------- - rm("$expid.${res0}_${nymdhh}.ods") if ( -e "$expid.${res0}_${nymdhh}.ods"); - rm("$expid.${res1}_${nymdhh}.ods") if ( -e "$expid.${res1}_${nymdhh}.ods"); + unlink("$expid.${res0}_${nymdhh}.ods") if ( -e "$expid.${res0}_${nymdhh}.ods"); + unlink("$expid.${res1}_${nymdhh}.ods") if ( -e "$expid.${res1}_${nymdhh}.ods"); return 0; } @@ -566,12 +572,12 @@ sub unique_instruments { my (@names, $type, @list); if ( $opt_m ) { - @names = (<$filepath/*diag_*_ans_*.*bin>); + @names = (<$filepath/*diag_*_ans_*.*$suffix>); } else { if ( $opt_omf ) { - @names = (<$filepath/*diag_*ges.*bin>); + @names = (<$filepath/*diag_*ges.*$suffix>); } else { - @names = (<$filepath/*diag_*anl.*bin>); + @names = (<$filepath/*diag_*anl.*$suffix>); } } foreach (@names) { @@ -743,6 +749,8 @@ OPTIONS -m total number of analysis iterations (miter from gsi.rc) (default: ignore) + -nc4 look for netcdf4 files instead of .bin files + -ncpus number of processes to run in parallel (default: 1 - serial run) diff --git a/GMAO_ods/kx_register.tbl b/GMAO_ods/kx_register.tbl new file mode 100644 index 00000000..314fafe8 --- /dev/null +++ b/GMAO_ods/kx_register.tbl @@ -0,0 +1,618 @@ +# kx_register.tbl:: +# +# kx: observations platform IDs, which should be uniquely assigned to support +# post-processing applications, e.g. "semperpy". +# source: source/producer ODS files where corresponding KX values are assigned. +# +#-- defined in GSI resource file "convinfo" +# ictype: (or type), platform +# otype: observation type +# icsub: (icsubtype), additional code +# +# see gsi: convinfo +# kx source ictype otype icsub + 003 gsi_conv 003 "gps_bnd,gps_ref" 0 # MetOp-B GRAS (gps) + 004 gsi_conv 004 "gps_bnd,gps_ref" 0 # MetOp-A GRAS (gps) + 005 gsi_conv 005 "gps_bnd,gps_ref" 0 # MetOp-A GRAS (gps) --- conflict 005 + +#-- defined in GSI reource OBS_INPUT:: +# dplat: platform +# dtype: observation type +# isat: a reference number used in GMAO_ods for now. With explicit assignment +# of registered kx values, this reference number is expect to be removed. +# +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 005 gsi_diag tirosn hirs2 5 # hirs2_tirosn --- conflict 005 + 006 gsi_diag n06 hirs2 6 # hirs2_n06 + 007 gsi_diag n07 hirs2 7 # hirs2_n07 + 008 gsi_diag n08 hirs2 8 # hirs2_n08 + 009 gsi_diag n09 hirs2 9 # hirs2_n09 + 010 gsi_diag n10 hirs2 10 # hirs2_n10 + 011 gsi_diag n11 hirs2 11 # hirs2_n11 + 012 gsi_diag n12 hirs2 12 # hirs2_n12 + 014 gsi_diag n14 hirs2 14 # hirs2_n14 + 015 gsi_diag n15 hirs3 15 # hirs3_n15 + 016 gsi_diag n16 hirs3 16 # hirs3_n16 + 017 gsi_diag n17 hirs3 17 # hirs3_n17 + 018 gsi_diag n18 hirs4 18 # hirs4_n18 + 019 gsi_diag n19 hirs4 19 # hirs4_n19 + 025 gsi_diag metop-a hirs4 25 # hirs4_metop-a + 026 gsi_diag metop-b hirs4 26 # hirs4_metop-b + +# see gsi: convinfo +# kx source ictype otype icsub + 041 gsi_conv 041 "gps_bnd,gps_ref" 0 # CHAMP (gps) + 042 gsi_conv 042 "gps_bnd,gps_ref" 0 # TerraSAR-X (gps) + 043 gsi_conv 043 "gps_bnd,gps_ref" 0 # TanDEM-X (gps) + 044 gsi_conv 044 "gps_bnd,gps_ref" 0 # PAZ (gps) + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 049 gsi_diag aqua airs 0 # airs281_aqua + 053 gsi_diag g08_prep sndr 8 # sndr_g08 + 055 gsi_diag g10_prep sndr 10 # sndr_g10 + 056 gsi_diag g11_prep sndr 11 # sndr_g11 + 057 gsi_diag g12_prep sndr 12 # sndr_g12 + 061 gsi_diag g11 sndrd1 11 # sndrD1_g11 + 062 gsi_diag g12 sndrd1 12 # sndrD1_g12 + 063 gsi_diag g13 sndrd1 13 # sndrD1_g13 + 064 gsi_diag g14 sndrd1 14 # sndrD1_g14 + 065 gsi_diag g15 sndrd1 15 # sndrD1_g15 + 071 gsi_diag g11 sndrd2 11 # sndrD2_g11 + 072 gsi_diag g12 sndrd2 12 # sndrD2_g12 + 073 gsi_diag g13 sndrd2 13 # sndrD2_g13 + 074 gsi_diag g14 sndrd2 14 # sndrD2_g14 + 075 gsi_diag g15 sndrd2 15 # sndrD2_g15 + 081 gsi_diag g11 sndrd3 11 # sndrD3_g11 + 082 gsi_diag g12 sndrd3 12 # sndrD3_g12 + 083 gsi_diag g13 sndrd3 13 # sndrD3_g13 + 084 gsi_diag g14 sndrd3 14 # sndrD3_g14 + 085 gsi_diag g15 sndrd3 15 # sndrD3_g15 + 091 gsi_diag g11 sndrd4 11 # sndrD4_g11 + 092 gsi_diag g12 sndrd4 12 # sndrD4_g12 + 093 gsi_diag g13 sndrd4 13 # sndrD4_g13 + 094 gsi_diag g14 sndrd4 14 # sndrD4_g14 + 095 gsi_diag g15 sndrd4 15 # sndrD4_g15 + +# see gsi: convinfo +# kx source ictype otype icsub + 100 gsi_conv 100 dw 0 # ? + 101 gsi_conv 101 dw 0 # ? + 102 gsi_conv 102 "pm2_5,pm10" 0 # ? + 112 gsi_conv 112 tcp 0 # ? + 120 gsi_conv 120 "ps,q,t" 0 # RAWINSONDE (Tv,z,q) + 126 gsi_conv 126 t 0 # RASS Profiler (Tv) + 130 gsi_conv 130 "q,t" 0 # AIREP/PIREP (T) + 131 gsi_conv 131 "q,t" 0 # AMDAR (T) + 132 gsi_conv 132 "ps,q,t" 0 # FLT LVL RECON AND DROPSONDE (Tv,q,ps) + 133 gsi_conv 133 "q,t" 0 # MDCRS (ACARS) (T,q) + 134 gsi_conv 134 "q,t" 0 # TAMDAR AIRCRAFT (T,q) + 135 gsi_conv 135 "q,t" 0 # CANADIAN AMDAR (T) + 152 gsi_conv 152 pw 0 # SSM/I SUPEROB NN3 (PW) + 153 gsi_conv 153 pw 0 # GPS Integrated precip water (PW) + 156 gsi_conv 156 pw 0 # ? + 157 gsi_conv 157 pw 0 # ? + 158 gsi_conv 158 pw 0 # ? + 159 gsi_conv 159 pw 0 # ? + 180 gsi_conv 180 "ps,q,t" 0 # SFC OCEAN with stn P (Tv,q,ps,SST) + 180 gsi_conv 180 "ps,q,t" 1 # ? + 181 gsi_conv 181 "ps,q,t,sst" 0 # Surface land/METAR with stn pres (Tv,q,ps,SST) + 182 gsi_conv 182 "ps,q,t,sst" 0 # Splash lvl dropwinsonde (Tv,q,ps) + 183 gsi_conv 183 "ps,q,t,sst" 0 # Sfc land,ocean,METAR w/o stn pres (Tv,q,ps,SST) + 184 gsi_conv 184 sst 0 # ? + 185 gsi_conv 185 sst 0 # ? + 186 gsi_conv 186 sst 0 # ? + 187 gsi_conv 187 "ps,q,t,sst" 0 # Sfc METAR with altimeter setting (Tv,q,ps,SST) + 188 gsi_conv 188 sst 0 # SURFACE MESONET (Tv,q,ps,SST) + 189 gsi_conv 189 sst 0 # ? + 190 gsi_conv 190 sst 0 # ? + 191 gsi_conv 191 "ps,sst" 0 # AUST PAOB MEAN SLP BOGUS (ps) + 192 gsi_conv 192 sst 0 # Sfc land synoptic missing SLP,ps (Tv,q,ps) + 193 gsi_conv 193 sst 0 # Sfc land METAR missing SLP,altim. (Tv,q,ps) + 194 gsi_conv 194 sst 0 # Sfc marine missing SLP,stnP (Tv,q,ps) + 195 gsi_conv 195 sst 0 # Sfc mesonet missing ps, altim. (Tv,q,ps) + 196 gsi_conv 196 sst 0 # ? + 197 gsi_conv 197 sst 0 # ? + 198 gsi_conv 198 sst 0 # ? + 199 gsi_conv 199 "ps,t,sst" 0 # Drifting buoy (Tv,q,ps) + 200 gsi_conv 200 sst 0 # ? + 201 gsi_conv 201 "dw,sst" 0 # ? + 202 gsi_conv 202 "dw,sst" 0 # ? + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 205 gsi_diag tirosn msu 5 # msu_tirosn + 206 gsi_diag n06 msu 6 # msu_n06 + 207 gsi_diag n07 msu 7 # msu_n07 + 208 gsi_diag n08 msu 8 # msu_n08 + 209 gsi_diag n09 msu 9 # msu_n09 + +# see gsi: convinfo +# kx source ictype otype icsub + 210 gsi_conv 210 uv 0 # Synthetic tropical cyclone (U,V) + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 210 gsi_diag n10 msu 10 # msu_n10 + 211 gsi_diag n11 msu 11 # msu_n11 -- conflict 211 + 211 gsi_diag trmm pcp_tmi 0 # pcp_tmi -- conflict 211 + 212 gsi_diag n12 msu 12 # msu_n12 -- conflict 212 + 212 gsi_diag trmm_lnd pcp_tmi 1 # pcp_tmi -- conflict 212 + 213 gsi_diag trmm_ocn pcp_tmi 2 # pcp_tmi + 214 gsi_diag n14 msu 14 # msu_n14 + +# see gsi: convinfo +# kx source ictype otype icsub + 220 gsi_conv 220 uv 0 # Rawinsonde (U,V) + 221 gsi_conv 221 uv 0 # Pibal wind (U,V) + 222 gsi_conv 222 "" -1 # CLASS sounding (U,V) + 223 gsi_conv 223 uv 0 # Wind profiler (U,V) + 224 gsi_conv 224 uv 0 # NEXRAD VAD (U,V) + 227 gsi_conv 227 "" -1 # MAP/CAP profiler (U,V) + 228 gsi_conv 228 uv 0 # JMA wind profiler U,V (-) + 229 gsi_conv 229 uv 0 # Wind profiler from PIBAL bulletins (U,V) + 230 gsi_conv 230 uv 0 # AIREP/PIREP (U,V) + 231 gsi_conv 231 uv 0 # AMDAR (U,V) + 232 gsi_conv 232 uv 0 # Recon/Dropwisonde (U,V) + 233 gsi_conv 233 uv 0 # MDCRS (ACARS) (U,V) + 234 gsi_conv 234 uv 0 # TAMDAR aircraft (U,V) + 235 gsi_conv 235 uv 0 # Canadian AMDAR (U,V) + 240 gsi_conv 240 uv 0 # NESDIS short wave IR CTW (U,V) + 240 gsi_conv 240 uv 257 # ? + 240 gsi_conv 240 uv 259 # ? + 241 gsi_conv 241 uv 0 # INDIAN IR/VIS CTW (U,V) + 242 gsi_conv 242 uv 0 # JMA VIS CTW (U,V) + 242 gsi_conv 242 uv 171 # ? + 242 gsi_conv 242 uv 172 # ? + 242 gsi_conv 242 uv 173 # ? + 243 gsi_conv 243 uv 0 # EUMETSAT VIS CTW (U,V) + 243 gsi_conv 243 uv 54 # ? + 243 gsi_conv 243 uv 55 # ? + 243 gsi_conv 243 uv 56 # ? + 243 gsi_conv 243 uv 57 # ? + 244 gsi_conv 244 uv 0 # AVHRR/POES IR CTW (U,V) + 244 gsi_conv 244 uv 3 # ? + 244 gsi_conv 244 uv 4 # ? + 244 gsi_conv 244 uv 206 # ? + 244 gsi_conv 244 uv 207 # ? + 244 gsi_conv 244 uv 209 # ? + 244 gsi_conv 244 uv 223 # ? + 245 gsi_conv 245 uv 0 # NESDIS IR CTW (U,V) + 245 gsi_conv 245 uv 257 # ? + 245 gsi_conv 245 uv 259 # ? + 246 gsi_conv 246 uv 0 # NESDIS imager cloud top (U,V) + 246 gsi_conv 246 uv 257 # ? + 246 gsi_conv 246 uv 259 # ? + 247 gsi_conv 247 uv 0 # NESDIS imager deep layer (U,V) + 247 gsi_conv 247 uv 257 # ? + 247 gsi_conv 247 uv 259 # ? + 248 gsi_conv 248 uv 0 # NESDIS sounder cloud top (U,V) + 249 gsi_conv 249 uv 0 # NESDIS sounder deep layer (U,V) + 250 gsi_conv 250 uv 0 # JMA WV CTW (U,V) + 250 gsi_conv 250 uv 171 # ? + 250 gsi_conv 250 uv 172 # ? + 250 gsi_conv 250 uv 173 # ? + 251 gsi_conv 251 uv 0 # NESDIS VIS CTW (U,V) + 251 gsi_conv 251 uv 257 # ? + 251 gsi_conv 251 uv 259 # ? + 252 gsi_conv 252 uv 0 # JMA IR CTW (U,V) + 252 gsi_conv 252 uv 171 # ? + 252 gsi_conv 252 uv 172 # ? + 252 gsi_conv 252 uv 173 # ? + 253 gsi_conv 253 uv 0 # EUMETSAT IR CTW (U,V) + 253 gsi_conv 253 uv 54 # ? + 253 gsi_conv 253 uv 55 # ? + 253 gsi_conv 253 uv 56 # ? + 253 gsi_conv 253 uv 57 # ? + 254 gsi_conv 254 uv 0 # EUMETSAT WV cloud top (U,V) + 254 gsi_conv 254 uv 54 # ? + 254 gsi_conv 254 uv 55 # ? + 254 gsi_conv 254 uv 56 # ? + 254 gsi_conv 254 uv 57 # ? + 255 gsi_conv 255 "" -1 # NESDIS picture triplet CTW (U,V) + 256 gsi_conv 256 uv 0 # Indian WV CTW (U,V) + 257 gsi_conv 257 uv 0 # MODIS IR CTW (U,V) + 257 gsi_conv 257 uv 783 # ? + 257 gsi_conv 257 uv 784 # ? + 258 gsi_conv 258 uv 0 # MODIS cloud top WV CTW (U,V) + 258 gsi_conv 258 uv 783 # ? + 258 gsi_conv 258 uv 784 # ? + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 258 gsi_diag - pcp_amsu 0 # - + 259 gsi_conv 259 uv 0 # MODIS deep layer WV CTW (U,V) + 259 gsi_conv 259 uv 783 # ? + 259 gsi_conv 259 uv 784 # ? + 260 gsi_conv 260 uv 0 # VIIRS IR CTW (U,V) + 260 gsi_conv 260 uv 224 # ? + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 260 gsi_diag - pcp_stage3 0 # - + 261 gsi_diag g11 goes_img 11 # imgr_g11 + 262 gsi_diag g12 goes_img 12 # imgr_g12 + 263 gsi_diag g13 goes_img 13 # imgr_g13 + 264 gsi_diag dmsp pcp_ssmi 0 # pcp_ssmi -- conflict 264 + 264 gsi_diag g14 goes_img 14 # imgr_g14 -- conflict 264 + 265 gsi_diag g15 goes_img 15 # imgr_g15 + +# see gsi: convinfo +# kx source ictype otype icsub + 270 gsi_conv 270 uv 0 # ? + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 272 gsi_diag dmsp08 pcp_ssmi 8 # pcp_ssmi + 274 gsi_diag dmsp10 pcp_ssmi 10 # pcp_ssmi + 275 gsi_diag dmsp11 pcp_ssmi 11 # pcp_ssmi + 277 gsi_diag dmsp13 pcp_ssmi 13 # pcp_ssmi + 278 gsi_diag dmsp14 pcp_ssmi 14 # pcp_ssmi + 279 gsi_diag dmsp15 pcp_ssmi 15 # pcp_ssmi + +# see gsi: convinfo +# kx source ictype otype icsub + 280 gsi_conv 280 uv 0 # Surface marine with stn pres (U,V) + 280 gsi_conv 280 uv 1 # ? + 281 gsi_conv 281 uv 0 # Surface land/METAR with stn pres (U,V) + 282 gsi_conv 282 uv 0 # Atlas buoy (U,V) + 283 gsi_conv 283 spd 0 # SSM/I neural net wind speed (spd) + 284 gsi_conv 284 uv 0 # Surface ocn/land METAR w/o sfcP (U,V) + 285 gsi_conv 285 uv 0 # Quikscat scatterometer wind (U,V) + 286 gsi_conv 286 uv 0 # ERS scatterometer wind (U,V) + 287 gsi_conv 287 uv 0 # Sfc METAR with altimeter setting (U,V) + 288 gsi_conv 288 "" -1 # Sfc Mesonet (U,V) + 289 gsi_conv 289 uv 0 # WINDSAT scatterometer wind (U,V) + 290 gsi_conv 290 uv 3 # ASCAT scatterometer wind (U,V) MetOp-B + 290 gsi_conv 290 uv 4 # ASCAT scatterometer wind (U,V) MetOp-A + 290 gsi_conv 290 uv 5 # ASCAT scatterometer wind (U,V) MetOp-C + 291 gsi_conv 291 uv 0 # OSCAT nonsuperobed scatterometer (U,V) + 292 gsi_conv 292 "" -1 # Sfc land synoptic missing SLP,ps (U,V) + 293 gsi_conv 293 "" -1 # Sfc land METAR missing SLP,altim. (U,V) + 294 gsi_conv 294 "" -1 # Sfc marine missing SLP,stnP (U,V) + 295 gsi_conv 295 "" -1 # Sfc mesonet missing ps, altim. (U,V) + 296 gsi_conv 296 uv 0 # ? + 297 gsi_conv 297 spd 0 # CYGNSS sea surface wind speed (spd) + 299 gsi_conv 299 "" -1 # Drifting buoy (U,V) + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 300 gsi_diag aqua amsua 0 # amsua_aqua + +#-- loosely defined in kx_list.rc +# platform: platforms +# kt: observation types +# (tbd): not defined +# +# see kx_list.rc +# kx source platform kt (tbd) + 301 -aerosol- -plat1- logaod 0 # Log(eps+aod) + 302 -aerosol- -plat2- logaod 0 # Log(eps+aod) + +# see gsi: convinfo +# kx source ictype otype icsub + 302 gsi_conv 302 o3lev 0 # ? -- conflict 302 + 303 gsi_conv 303 o3lev 0 # ? + 304 gsi_conv 304 o3lev 0 # ? + 305 gsi_conv 305 o3lev 0 # ? + 306 gsi_conv 306 o3lev 0 # ? + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 310 gsi_diag aura mls 0 # + +# see gsi: convinfo +# kx source ictype otype icsub + 311 gsi_conv 311 t 0 # ? -- conflict 311 + +# see kx_list.rc +# kx source platform kt (tbd) + 311 -aerosol- -plat3- logaod 0 # Log(eps+aod) -- conflict 311 + 312 -aerosol- -plat4- logaod 0 # Log(eps+aod) + 313 -aerosol- -plat5- logaod 0 # Log(eps+aod) + 314 -aerosol- -plat6- logaod 0 # Log(eps+aod) + +# see gsi: convinfo +# kx source ictype otype icsub + 315 gsi_conv 315 mls20 0 # -- conflict 315 + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 315 gsi_diag n15 amsua 15 # amsua_n15 -- conflict 315 + 316 gsi_diag n16 amsua 16 # amsua_n16 + 317 gsi_diag n17 amsua 17 # amsua_n17 + 318 gsi_diag n18 amsua 18 # amsua_n18 + 319 gsi_diag n19 amsua 19 # amsua_n19 + 320 gsi_diag aura mls22 0 # + +# see kx_list.rc +# kx source platform kt (tbd) + 323 -aerosol- -plat7- logaod 0 # Log(eps+aod) + 324 -aerosol- -plat8- logaod 0 # Log(eps+aod) + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 325 gsi_diag aura mls30 0 # -- conflict 325 + 325 gsi_diag metop-a amsua 25 # amsua_metop-a -- conflict 325 + 326 gsi_diag metop-b amsua 26 # amsua_metop-b + 330 gsi_diag aura mls55 0 # + 335 gsi_diag npp "ompslp,ompsnm,ompsnp" 0 # ??? + 355 gsi_diag tirosn ssu 5 # ssu_tirosn + 356 gsi_diag n06 ssu 6 # ssu_n06 + 357 gsi_diag n07 ssu 7 # ssu_n07 + 358 gsi_diag n08 ssu 8 # ssu_n08 + 359 gsi_diag n09 ssu 9 # ssu_n09 + 361 gsi_diag n11 ssu 11 # ssu_n11 + +# see kx_list.rc +# kx source platform kt (tbd) + 363 -aerosol- -plat9- logaod 0 # Log(eps+aod) + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 364 gsi_diag n14 ssu 14 # ssu_n14 + 415 gsi_diag n15 amsub 15 # amsub_n15 + 416 gsi_diag n16 amsub 16 # amsub_n16 + 417 gsi_diag n17 amsub 17 # amsub_n17 + +# see gsi: convinfo +# kx source ictype otype icsub + 421 gsi_conv 421 "gps_bnd,gps_ref" 0 # Oceansat-2 (gps) + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 427 gsi_diag npp ompsnm 0 # + 437 gsi_diag npp ompsnp 0 # + +# see gsi: convinfo +# kx source ictype otype icsub + 440 gsi_conv 440 "gps_bnd,gps_ref" 0 # Megha-Tropiques (gps) -- conflict 440 + 440 gsi_conv 440 toms 0 # -- conflict 440 + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 441 gsi_diag nim07 tomseff 1 # + 442 gsi_diag ep tomseff 2 # + +# see gsi: convinfo +# kx source ictype otype icsub + 445 gsi_conv 445 gome 0 # + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 449 gsi_diag aura omi 0 # -- conflict 449 + 449 gsi_diag aura omieff 0 # -- conflict 449 + +# see gsi: convinfo +# kx source ictype otype icsub + 450 gsi_conv 450 sbuv2 0 # -- conflict 450 + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 450 gsi_diag aqua hsb 0 # hsb_aqua -- conflict 450 + 451 gsi_diag nim07 sbuv2 1 # + 461 gsi_diag n11 sbuv2 11 # + 464 gsi_diag n14 sbuv2 14 # + 466 gsi_diag n16 sbuv2 16 # + 467 gsi_diag n17 sbuv2 17 # + 468 gsi_diag n18 sbuv2 18 # + 469 gsi_diag n19 sbuv2 19 # + 470 gsi_diag metop-a gome 25 # + 471 gsi_diag metop-b gome 26 # + +#-- defined by ODAS_OBS +# platform: extracted from their descriptions +# var_id: (or kt) observation types +# string names are introduced to replace numerical values in the future +# data_id: (or ks) used as ODS KX values now +# +# See ODAS_OBS.xlsx +# kx source platform var_id(kt) data_id(ks) + 501 odas_obs Tao "sst,sss" 501 # Tao Temperature and Synthetic Salinity (**) + 501 odas_obs Tao 101 501 # Tao Temperature + 501 odas_obs Tao 102 501 # Tao Synthetic Salinity + 502 odas_obs Pirata 101 502 # Pirata Temperature + 502 odas_obs Pirata 102 502 # Pirata Synthetic Salinity + 503 odas_obs XBT 101 503 # XBT Temperature + 503 odas_obs XBT 102 503 # XBT Synthetic Salinity + 504 odas_obs RAMA 101 504 # RAMA Temperature + 504 odas_obs RAMA 102 504 # RAMA Salinity + 505 odas_obs ADCP "103,104" 505 # ADCP + 506 odas_obs Current-Meter "103,104" 506 # Current Meter + 507 odas_obs Aquarius 102 507 # Aquarius SSS (*** 522?) + 508 odas_obs Argo 101 508 # Argo Temperature + 508 odas_obs Argo 102 508 # Argo Salinity + 509 odas_obs Levitus 101 509 # Levitus Temperature + 509 odas_obs Levitus 102 509 # Levitus Salinity + 510 odas_obs GEOSAT "105,109" 510 # GEOSAT + 510 odas_obs Geosat 109 510 # (g2) Geosat (*) + 511 odas_obs ERS "105,109" 511 # ERS + 511 odas_obs ERS-1 109 511 # (e1) ERS-1 (*) + 512 odas_obs ENVISAT "105,109" 512 # ENVISAT + 512 odas_obs Envisat 109 512 # (en) Envisat (*) + 513 odas_obs CTD 101 513 # CTD Temperature + 513 odas_obs CTD 102 513 # CTD Salinity + 514 odas_obs Poseidon "105,109" 514 # Poseidon + 514 odas_obs Topex "105,109" 514 # Topex + 514 odas_obs Topex 109 514 # (tp) Topex (*) + 515 odas_obs Jason-1 "105,109" 515 # Jason-1 + 515 odas_obs Jason-1 109 515 # (j1) Jason-1 (*) + 516 odas_obs Reynolds 101 516 # Reynolds SST + 517 odas_obs Jason-2 "105,109" 517 # Jason-2 + 517 odas_obs Jason-2 109 517 # (j2) Jason-2 (*) + 518 odas_obs NSIDC 106 518 # NSIDC AICE + 519 odas_obs CMIP5 106 519 # CMIP5 AICE + 520 odas_obs CMIP5 101 520 # CMIP5 SST + 521 odas_obs Levitus 102 521 # Levitus SSS + 522 odas_obs Aqaurius 102 522 # Aqaurius SSS (*** 507?) + 523 odas_obs Reynolds 106 523 # Reynolds AICE + 524 odas_obs MODS 111 524 # MODS Chlorphyll + 525 odas_obs OSTIA 101 525 # OSTIA SST + 526 odas_obs OSTIA 106 526 # OSTIA AICE + 527 odas_obs IB-HICE 107 527 # IB-HICE + 528 odas_obs PIOMAS 107 528 # PIOMAS HICE + 529 odas_obs IB-VICE 107 529 # IB-VICE + 530 odas_obs Cyrosat 107 530 # Cyrosat HICE (?) + 532 odas_obs Cryosat-2 "105,109" 532 # Cryosat-2 + 532 odas_obs Cryosat-2 109 532 # (c2) Cryosat-2 (*) + 533 odas_obs EnviSAT-new "105,109" 533 # EnviSAT-new + 533 odas_obs Envisat-N 109 533 # (enn) Envisat-N (*) + 534 odas_obs Altica "105,109" 534 # Altica + 534 odas_obs Altica 109 534 # (a1) Altica (*) + 534 odas_obs Saral 109 534 # (a1) Saral + 535 odas_obs Jason-1G "105,109" 535 # Jason-1 G + 535 odas_obs Jason-1G 109 535 # (j1g) Jason-1 g (*) + 536 odas_obs ERS-2 109 536 # (e2) ERS-2 + 537 odas_obs HY02 109 537 # (h2) HY02 + 538 odas_obs Jason1-N 109 538 # (j1n) Jason1-N (* Jason-1N?) + 539 odas_obs Topex-N 109 539 # (tpn) Topex-N + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 547 gsi_diag aqua amsre_low 0 # amsre_aqua(low) + 548 gsi_diag aqua amsre_mid 0 # amsre_aqua(mid) + 549 gsi_diag aqua amsre_hig 0 # amsre_aqua(hi) + 550 gsi_diag gcom_w1 amsr2 0 # amsr2_gcom-w1 + +# See ODAS_OBS.xlsx +# kx source platform var_id(kt) data_id(ks) + 600 odas_obs MODIS_GSFC_A 101 600 # MODIS_GSFC_A + 601 odas_obs MODIS_A 101 601 # MODIS_A + 602 odas_obs AVHRR18_G -1 602 # AVHRR18_G + 603 odas_obs -reserved- -1 603 # -reserved- + 604 odas_obs -reserved- -1 604 # -reserved- + 605 odas_obs -reserved- -1 605 # -reserved- + 606 odas_obs -reserved- -1 606 # -reserved- + 607 odas_obs -reserved- -1 607 # -reserved- + 608 odas_obs -reserved- -1 608 # -reserved- + 609 odas_obs -reserved- -1 609 # -reserved- + 610 odas_obs -reserved- -1 610 # -reserved- + 611 odas_obs -reserved- -1 611 # -reserved- + 612 odas_obs -reserved- -1 612 # -reserved- + 613 odas_obs -reserved- -1 613 # -reserved- + 614 odas_obs -reserved- -1 614 # -reserved- + 615 odas_obs -reserved- -1 615 # -reserved- + 616 odas_obs -reserved- -1 616 # -reserved- + 617 odas_obs -reserved- -1 617 # -reserved- + 618 odas_obs -reserved- -1 618 # -reserved- -- conflict 618 + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 618 gsi_diag n18 avhrr 18 # avhrr3_n18 -- conflict 618 + 619 odas_obs -reserved- -1 619 # -reserved- -- conflict 619 + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 619 gsi_diag n19 avhrr 19 # avhrr3_n19 -- conflict 619 + +# See ODAS_OBS.xlsx +# kx source platform var_id(kt) data_id(ks) + 620 odas_obs -reserved- -1 620 # -reserved- + 621 odas_obs -reserved- -1 621 # -reserved- + 622 odas_obs -reserved- -1 622 # -reserved- + 623 odas_obs -reserved- -1 623 # -reserved- + 624 odas_obs -reserved- -1 624 # -reserved- + 625 odas_obs -reserved- -1 625 # -reserved- --- conflict 625 + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 625 gsi_diag metop-a avhrr 25 # avhrr3_metop-a --- conflict 625 + +# See ODAS_OBS.xlsx +# kx source platform var_id(kt) data_id(ks) + 626 odas_obs -reserved- -1 626 # -reserved- + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 626 gsi_diag metop-b avhrr 26 # avhrr3_metop-b + +# See ODAS_OBS.xlsx +# kx source platform var_id(kt) data_id(ks) + 627 odas_obs -reserved- -1 627 # -reserved- + 628 odas_obs -reserved- -1 628 # -reserved- + 629 odas_obs -reserved- -1 629 # -reserved- + 630 odas_obs -reserved- -1 630 # -reserved- + 631 odas_obs -reserved- -1 631 # -reserved- + 632 odas_obs -reserved- -1 632 # -reserved- + 633 odas_obs -reserved- -1 633 # -reserved- + 634 odas_obs -reserved- -1 634 # -reserved- + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 705 gsi_diag trmm tmi 0 # tmi_trmm + 706 gsi_diag gpm gmi 0 # gmi_gpm + 708 gsi_diag f08 ssmi 8 # ssmi_f08 + 710 gsi_diag f10 ssmi 10 # ssmi_f10 + 711 gsi_diag f11 ssmi 11 # ssmi_f11 + 713 gsi_diag f13 ssmi 13 # ssmi_f13 + 714 gsi_diag f14 ssmi 14 # ssmi_f14 + 715 gsi_diag f15 ssmi 15 # ssmi_f15 + 716 gsi_diag f16 ssmis 16 # ssmis_f16 + 717 gsi_diag f17 ssmis 17 # ssmis_f17 + 718 gsi_diag f18 ssmis 18 # ssmis_f18 + 719 gsi_diag f19 ssmis 19 # ssmis_f19 + 720 gsi_diag f20 ssmis 20 # ssmis_f20 + +# see gsi: convinfo +# kx source ictype otype icsub + 722 gsi_conv 722 "gps_bnd,gps_ref" 0 # GRACE-A (gps) + 723 gsi_conv 723 "gps_bnd,gps_ref" 0 # GRACE-B (gps) + 724 gsi_conv 724 "gps_bnd,gps_ref" 0 # COSMIC-2 P1 + 725 gsi_conv 725 "gps_bnd,gps_ref" 0 # COSMIC-2 P2 + 726 gsi_conv 726 "gps_bnd,gps_ref" 0 # COSMIC-2 P3 + 727 gsi_conv 727 "gps_bnd,gps_ref" 0 # COSMIC-2 P4 + 728 gsi_conv 728 "gps_bnd,gps_ref" 0 # COSMIC-2 P5 + 729 gsi_conv 729 "gps_bnd,gps_ref" 0 # COSMIC-2 P6 + 740 gsi_conv 740 "gps_bnd,gps_ref" 0 # COSMIC-1 (gps) + 741 gsi_conv 741 "gps_bnd,gps_ref" 0 # COSMIC-2 (gps) + 742 gsi_conv 742 "gps_bnd,gps_ref" 0 # COSMIC-3 (gps) + 743 gsi_conv 743 "gps_bnd,gps_ref" 0 # COSMIC-4 (gps) + 744 gsi_conv 744 "gps_bnd,gps_ref" 0 # COSMIC-5 (gps) + 745 gsi_conv 745 "gps_bnd,gps_ref" 0 # COSMIC-6 (gps) + 750 gsi_conv 750 "gps_bnd,gps_ref" 0 # COSMIC-2 E1 (gps) + 751 gsi_conv 751 "gps_bnd,gps_ref" 0 # COSMIC-2 E2 (gps) + 752 gsi_conv 752 "gps_bnd,gps_ref" 0 # COSMIC-2 E3 (gps) + 753 gsi_conv 753 "gps_bnd,gps_ref" 0 # COSMIC-2 E4 (gps) + 754 gsi_conv 754 "gps_bnd,gps_ref" 0 # COSMIC-2 E5 (gps) + 755 gsi_conv 755 "gps_bnd,gps_ref" 0 # COSMIC-2 E6 (gps) + 786 gsi_conv 786 "gps_bnd,gps_ref" 0 # C/NOFS CORISS (gps) + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 818 gsi_diag n18 mhs 18 # mhs_n18 + 819 gsi_diag n19 mhs 19 # mhs_n19 + +# see gsi: convinfo +# kx source ictype otype icsub + 820 gsi_conv 820 "gps_bnd,gps_ref" 0 # SAC-C (gps) + 821 gsi_conv 821 "gps_bnd,gps_ref" 0 # SAC-D (gps) + 825 gsi_conv 825 "gps_bnd,gps_ref" 0 # KOMPSAT-5 (gps) --- conflict 825 + +# see gsi.rc: OBS_INPUT:: +# kx source dplat dtype isat + 825 gsi_diag metop-a mhs 25 # mhs_metop-a --- conflict 825 + 826 gsi_diag metop-b mhs 26 # mhs_metop-b + 875 gsi_diag metop-a iasi 25 # iasi616_metop-a + 876 gsi_diag metop-b iasi 26 # iasi616_metop-b + 877 gsi_diag metop-c iasi 27 # iasi616_metop-c + 900 gsi_diag npp atms 0 # atms_npp + 920 gsi_diag n20 atms 20 # atms_n20 + 921 gsi_diag n21 atms 21 # atms_n21 + 940 gsi_diag npp cris-fsr 0 # cris-fsr_npp + 950 gsi_diag npp cris 0 # cris_npp + 960 gsi_diag n20 cris-fsr 20 # cris-fsr_n20 + 961 gsi_diag n21 cris-fsr 21 # cris-fsr_n21 + 970 gsi_diag n20 cris 20 # cris_n20 + 971 gsi_diag n21 cris 21 # cris_n21 + 988 gsi_diag m08 seviri 8 # seviri_m08 + 989 gsi_diag m09 seviri 9 # seviri_m09 + 990 gsi_diag m10 seviri 10 # seviri_m10 + 991 gsi_diag m10 seviri 11 # seviri_m11 + 998 gsi_diag "?" acos 0 # ? + 999 gsi_diag "?" mopitt 0 # ? + +# see gsi: convinfo +# kx source ictype otype icsub + 999 gsi_conv 999 "dw,rw,srw" 0 # ? +#. diff --git a/GMAO_ods/m_obs_stats.F90 b/GMAO_ods/m_obs_stats.F90 new file mode 100644 index 00000000..2f89ef55 --- /dev/null +++ b/GMAO_ods/m_obs_stats.F90 @@ -0,0 +1,295 @@ +module m_obs_stats + +use m_die, only: die + +implicit none + +private + +public :: obs_stats_init +public :: obs_stats_collect +public :: obs_stats_final +public :: obs_stats_write + +public :: obs_stats + +! All internal from here down + +character(len=*), parameter :: myname = "obs_stats" + +integer, parameter :: mychar = 30 + +type obs_stats + + character(len=mychar) :: expid + character(len=mychar) :: forecast + character(len=mychar) :: source + character(len=mychar) :: verification + + integer :: ns + integer, pointer :: counter(:) => null() + integer, pointer :: nymdhh(:) => null() + character(len=mychar), pointer :: domain(:) => null() ! global,tropics,n.hem,etc + real, pointer :: boundary(:,:) => null() ! end points of domain east,north,south,west + real, pointer :: level(:) => null() ! level/channel + character(len=mychar), pointer :: levtype(:) => null() ! level or channel: pl or ch + character(len=mychar), pointer :: varname(:) => null() ! variable name: tv, u, tb, bend, etc + integer, pointer :: step(:) => null() ! hours: 0 from analysis, but could be 24 if omf from 24 hr fcsts + character(len=mychar), pointer :: sname(:) => null() ! rms,efficiency,etc + real, pointer :: svalue(:) => null() ! actual value of statistic + +end type obs_stats + +interface obs_stats_init + module procedure init_ +end interface +interface obs_stats_collect + module procedure collect_ +end interface +interface obs_stats_final + module procedure final_ +end interface +interface obs_stats_write + module procedure write_ +end interface + +contains + + subroutine init_ ( ns, stats, expid, fcst, source, verif ) + + implicit none + + integer, intent(in) :: ns ! number of stats entries + type(obs_stats), intent(inout) :: stats + character(len=*),intent(in) :: expid + character(len=*),intent(in) :: fcst + character(len=*),intent(in) :: source + character(len=*),intent(in) :: verif + + stats%expid = expid + stats%forecast = fcst + stats%source = source + stats%verification = verif + + stats%ns=ns + allocate(stats%counter(ns)) + allocate(stats%nymdhh(ns)) + allocate(stats%domain(ns)) + allocate(stats%boundary(ns,4)) + allocate(stats%level(ns)) + allocate(stats%levtype(ns)) + allocate(stats%varname(ns)) + allocate(stats%step(ns)) + allocate(stats%sname(ns)) + allocate(stats%svalue(ns)) + + end subroutine init_ + + subroutine final_ ( stats ) + + implicit none + + type(obs_stats), intent(inout) :: stats + + stats%expid = "null" + stats%forecast = "null" + stats%source = "null" + stats%verification = "null" + + deallocate(stats%svalue) + deallocate(stats%sname) + deallocate(stats%step) + deallocate(stats%varname) + deallocate(stats%levtype) + deallocate(stats%level) + deallocate(stats%boundary) + deallocate(stats%domain) + deallocate(stats%nymdhh) + deallocate(stats%counter) + + end subroutine final_ + + subroutine collect_(nymd,nhms,hour,varname,sfctype,sname,levtype,level, & + regnames,regbounds,& + svalue,stats, & + fakevars) + implicit none + + integer,intent(in) :: nymd, nhms + integer,intent(in) :: hour + character(len=*),intent(in) :: varname(:) + character(len=*),intent(in) :: sname(:) + character(len=*),intent(in) :: levtype(:) + character(len=*),intent(in) :: regnames(:) + logical,intent(in) :: sfctype(:) + real,intent(in) :: level(:) + real,intent(in) :: regbounds(:,:) + real,intent(in) :: svalue(:,:,:,:) + + character(len=*),intent(in), optional :: fakevars(:) + + character(len=*), parameter :: myname_ = myname//"*collect_" + type(obs_stats), intent(inout) :: stats + + integer nlevs,kk,nv,ir,ns,ic,nhmdhh,nfake + +!count|date|domain_name|east|expver|forecast|level|levtype|north|variable|source|south|statistic|step|type|value|verify|west +!0.0|2020031900|global|180.0000|sapoes00rtXEC.21z|gmao|1000.000|pl|90.00000|p|gmao|-90.00000|cor|0|fc|0.9695317|gmao|-180.0000 +! fixed for now: + stats%counter = 0 + nfake = 0 + if(present(fakevars)) then + nfake = size(fakevars) + endif + + if(size(svalue,1)/=size(regnames)) then + call die (myname_,': inconsistent region dims, aborting ', 99) + endif + if(size(svalue,3)/=size(varname)) then + call die (myname_,': inconsistent varname dims, aborting ', 99) + endif + if(size(svalue,4)/=size(sname)) then + call die (myname_,': inconsistent statistic dims, aborting ', 99) + endif + if(size(sfctype)/=size(varname)) then + call die (myname_,': inconsistent sfc/varname dims, aborting ', 99) + endif + +! from arg list: + stats%nymdhh = nymd*100 + nhms/10000 + + nlevs = size(svalue,2) + ic=0 + do ns = 1,size(svalue,4) ! number of statistic types + do nv = 1,size(svalue,3) ! variables + do ir = 1,size(svalue,1) ! regions + do kk = 1,nlevs ! levels + if(sfctype(nv).and.kk>1) cycle + ic = ic + 1 + if ( ic > stats%ns ) then + call die (myname_,': inconsistent dims, aborting ', 99) + endif + + stats%step(ic) = hour + stats%sname(ic) = sname(ns) + stats%varname(ic) = varname(nv) + stats%svalue(ic) = svalue(ir,kk,nv,ns) + stats%level(ic) = level(kk) + stats%levtype(ic) = levtype(1) ! to be revisited + stats%domain(ic) = regnames(ir) ! to be revisited + stats%boundary(ic,1) = 180.0 ! east + stats%boundary(ic,2) =-180.0 ! west + stats%boundary(ic,3) = regbounds(2,ir) ! north + stats%boundary(ic,4) = regbounds(1,ir) ! souhh + + enddo + enddo + enddo + enddo + if (nfake>0) then ! place h as fake variable to satisfy wired scorecard plotting program + nlevs = size(svalue,2) + do ns = 1,size(svalue,4) ! number of statistic types + do nv = 1,nfake ! number of fake variables + do ir = 1,size(svalue,1) ! regions + do kk = 1,nlevs ! levels + ic = ic + 1 + if ( ic > stats%ns ) then + call die (myname_,': inconsistent dims, aborting ', 99) + endif + + stats%step(ic) = hour + stats%sname(ic) = sname(ns) + stats%varname(ic) = fakevars(nv) + stats%svalue(ic) = 1e15 + stats%level(ic) = level(kk) + stats%levtype(ic) = levtype(1) + stats%domain(ic) = regnames(ir) + stats%boundary(ic,1) = 180.0 + stats%boundary(ic,2) =-180.0 + stats%boundary(ic,3) = regbounds(2,ir) + stats%boundary(ic,4) = regbounds(1,ir) + enddo + enddo + enddo + enddo + endif + + end subroutine collect_ + + subroutine write_(outfile,stats) + + use m_ioutil, only: luavail + implicit none + + character(len=*) outfile + type(obs_stats), intent(in) :: stats + + character(len=256) record + character(len=mychar) cdate,cstat,czlev,cstep,ceast,cwest,cnorth,csouth + integer iii,luout + + luout=luavail() + open(luout,file=trim(outfile),form='formatted') + ! the following is in alphabetic order + write(luout,'(5a)') 'count|date|domain_name|east|', & + 'expver|forecast|level|levtype|', & + 'north|variable|source|south|', & + 'statistic|step|type|value|', & + 'verify|west' + do iii=1,stats%ns +! if (abs(stats%svalue(iii))>1.e14) cycle + write( cstat,*) stats%svalue(iii) +! write( cdate,'(i10.10)') stats%nymdhh(iii) + write( cdate,*) stats%nymdhh(iii) + write( czlev,*) stats%level(iii) + write( cstep,*) stats%step(iii) + write( ceast,*) stats%boundary(iii,1) + write( cwest,*) stats%boundary(iii,2) + write(cnorth,*) stats%boundary(iii,3) + write(csouth,*) stats%boundary(iii,4) +#ifdef _DEBUG_ +print*, trim(adjustl(cdate)) +print*, trim(adjustl(stats%domain(iii))) +print*, trim(adjustl(ceast)) +print*, trim(adjustl(stats%expid)) +print*, trim(adjustl(stats%source)) +print*, trim(adjustl(czlev)) +print*, trim(adjustl(stats%levtype(iii))) +print*, trim(adjustl(cnorth)) +print*, trim(adjustl(stats%varname(iii))) +print*, trim(adjustl(stats%source)) +print*, trim(adjustl(csouth)) +print*, trim(adjustl(stats%sname(iii))) +print*, trim(adjustl(cstep)) +print*, 'fc' +print*, trim(adjustl(cstat)) +print*, trim(adjustl(stats%verification)) +print*, trim(adjustl(cwest)) ! west +#endif + write(record,'(f3.1,34a)') 0.0, '|', & ! count (dummy for this code) + trim(adjustl(cdate)),'|', & ! date + trim(adjustl(stats%domain(iii))),'|', & ! domain_name + trim(adjustl(ceast)),'|', & ! east + trim(adjustl(stats%expid)),'|', & ! expver + trim(adjustl(stats%source)),'|', & ! forecast + trim(adjustl(czlev)),'|', & ! level + trim(adjustl(stats%levtype(iii))),'|', & ! levtype + trim(adjustl(cnorth)),'|', & ! north + trim(adjustl(stats%varname(iii))),'|', & ! variable + trim(adjustl(stats%source)),'|', & ! source=forecast + trim(adjustl(csouth)),'|', & ! south + trim(adjustl(stats%sname(iii))),'|', & ! statistic + trim(adjustl(cstep)),'|', & ! step + 'fc','|', & ! type + trim(adjustl(cstat)),'|', & ! value + trim(adjustl(stats%verification)),'|', & ! verify + trim(adjustl(cwest)) ! west + write(luout,'(a)') trim(adjustl(record)) + + enddo + close(luout) + + end subroutine write_ + + +end module m_obs_stats diff --git a/GMAO_ods/m_ods.f90 b/GMAO_ods/m_ods.f90 index b55d2bdd..b53f0089 100644 --- a/GMAO_ods/m_ods.f90 +++ b/GMAO_ods/m_ods.f90 @@ -534,6 +534,7 @@ subroutine ODS_Get1_ ( fname, nymd, nhms, ftype, ods, rc, & ! ! !USES ! + use netcdf Implicit NONE ! !INPUT PARAMETERS: @@ -600,13 +601,14 @@ subroutine ODS_Get1_ ( fname, nymd, nhms, ftype, ods, rc, & ! 25Jun2003 Todling Defining nsyn only in case it's been read ok. ! 28Apr2004 Todling Overload of ODS to read GSI-diag-out files ! 14Jun2004 Todling Added ncf opt-arg to avoid errmsg from Open. +! 16Apr2019 Sienkiewicz Add check for nc4diag, treat as ncf ! ! !EOP !------------------------------------------------------------------------- character(len=*), parameter :: myname = 'ods_get1_' - integer id, ier, nkt, nkt1, nkx, nqc, ncr, nsyn, nobs, khms + integer id, ier, nkt, nkt1, nkx, nqc, ncr, nsyn, nobs, khms, n4id integer jday, syn_hour, ods_nget integer first_jday, first_nymd, first_nhms logical fexists, dconv @@ -624,9 +626,21 @@ subroutine ODS_Get1_ ( fname, nymd, nhms, ftype, ods, rc, & else inquire ( file=trim(fname), exist=fexists ) if ( fexists ) then - if ( .not. dconv ) then - call ODS_Open ( id, fname, 'r', ier ) ! open the file - if ( ier .ne. 0 ) dconv = .true. + if ( .not. dconv ) then +! Check if file is netCDF, and if so check for date_time global (for nc4diag) +! --------------------------------------------------------------------------- + ier = nf90_open(path=trim(fname), mode = nf90_nowrite, ncid = n4id ) + if (ier /= nf90_noerr) then + dconv = .true. + else + ier = nf90_inquire_attribute(n4id,NF90_GLOBAL,'date_time') + if (ier == nf90_noerr) dconv = .true. + ier = nf90_close(n4id) + if ( .not. dconv ) then + call ODS_Open ( id, fname, 'r', ier ) ! open the file + if ( ier .ne. 0 ) dconv = .true. + end if + endif endif else diff --git a/GMAO_ods/obimp_summary.pl b/GMAO_ods/obimp_summary.pl index cdd4e385..d38a439e 100755 --- a/GMAO_ods/obimp_summary.pl +++ b/GMAO_ods/obimp_summary.pl @@ -18,7 +18,6 @@ use FindBin; # so we can find where this script resides use File::Basename; # for basename(), dirname() use File::Copy "cp"; # for cp() -use Shell qw(rm); # rm commands use Getopt::Long; # command line options # look for perl packages in the following locations @@ -76,7 +75,7 @@ sub imp_summary { $ic = $ic + 1; } # foreach typ } # sum exists - rm("odsstats_sum.txt"); + unlink("odsstats_sum.txt"); } # imp files $ic = 0; @@ -98,9 +97,9 @@ sub imp_summary { if ( -e "odsstats_all.txt" ) { print "mv odsstats_all.txt $outfile \n"; cp("odsstats_all.txt","$outfile"); - rm("odsstats_all.txt"); - rm("odsstats_sum.txt"); - rm("odsstats_numneg.txt"); + unlink("odsstats_all.txt"); + unlink("odsstats_sum.txt"); + unlink("odsstats_numneg.txt"); } } # kt-summary @@ -145,7 +144,7 @@ sub init { $outfile = "obimp_summary.txt"; if( $opt_o ) { $outfile = $opt_o }; - if( -e "$outfile" ) { rm("$outfile") }; + if( -e "$outfile" ) { unlink("$outfile") }; if( $opt_type ) { # location of input files $obimtyp = $opt_type; diff --git a/GMAO_ods/ods_dcget.f b/GMAO_ods/ods_dcget.f index c9042145..eb0a5d52 100644 --- a/GMAO_ods/ods_dcget.f +++ b/GMAO_ods/ods_dcget.f @@ -17,6 +17,7 @@ subroutine ods_dcget ( fname, nymd, nhms, ods, rc ) use m_odsxsup, only : ncepQCXval use m_Sndx, only : setSndx use m_ods_obsdiags, only : ods_obsdiags_getparam + use netcdf Implicit NONE @@ -64,7 +65,8 @@ subroutine ods_dcget ( fname, nymd, nhms, ods, rc ) ! 28Jan2014 - Todling - read sensitivity slot indicator (ioff) from header ! 02Apr2014 - Todling - gather ob variance error for possible output option ! 12Nov2014 - Weir - add mopitt terra and acos/gosat+oco2 support -! 2018-05-25 wargan - added OMPS +! 2018-05-25 wargan - added OMPS +! 2019-04-15 Sienkiewicz - add handling of netcdf4 diag files. ! !EOP !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -108,11 +110,29 @@ subroutine ods_dcget ( fname, nymd, nhms, ods, rc ) integer, allocatable, dimension(:) :: iouse real(4), allocatable, dimension(:) :: pobs,gross,tnoise + integer :: status, ncid + character(len=20) isis ! sensor/instrument/satellite id ex.amsua_n15 character(len=10) dplat ! sattelite platform id - rc = 0 ! all is well to start with + rc = 0 ! all is well to start with + +! First determine whether this is a netCDF4 diag file +! --------------------------------------------------- + status = nf90_open(path=trim(fname), mode = nf90_nowrite, ncid = ncid ) + if ( status == nf90_noerr ) then + status = nf90_inquire_attribute(ncid,NF90_GLOBAL,'date_time') + if ( status /= nf90_noerr ) then + rc = 1 + print *, myname_, ': error reading nc4 diag file' + return + end if + status = nf90_close(ncid) + call ods_diagnc4 ( fname, nymd, nhms, ods, rc ) + return + end if + ! Inquire whether this is diag file w/ history of omx, osens, ... ! --------------------------------------------------------------- @@ -355,7 +375,8 @@ subroutine ods_dcget ( fname, nymd, nhms, ods, rc ) & trim(satype)/='acos'.and. trim(satype)/='mopitt' .and. & trim(satype)/='gome' .and. trim(satype)/='ompslpuv' .and. & trim(satype)/='ompslpvis' .and. trim(satype)/='ompsnm'.and. - & trim(satype)/='ompsnp' ) then + & trim(satype)/='ompsnp' .and. trim(satype)/='ompsnmeff' .and. + & trim(satype)/='ompsnpnc') then ! Radiance data: ! ------------- @@ -435,7 +456,7 @@ subroutine ods_dcget ( fname, nymd, nhms, ods, rc ) end if call ozone_getisat_(satype,dplat,isis,isat) - if(verbose) print *, 'will read *'//trim(dplat)//'* for ', satype, ' isat = ', isat, ' nchanl = ', nchanl + if(verbose) print *, 'will read *'//trim(dplat)//'* for ', satype, ' isat = ', isat ios = 0 ndiag = ioff0 diff --git a/GMAO_ods/ods_dconv.f b/GMAO_ods/ods_dconv.f index b0a4d10a..cbf1db8e 100644 --- a/GMAO_ods/ods_dconv.f +++ b/GMAO_ods/ods_dconv.f @@ -159,7 +159,8 @@ subroutine ods_dconv ( var, cdiagbuf, data, ninfo, nobs, obs(kobs) = data(17,i) ! observation omf(kobs) = data(18,i) ! omf used in the analysis oma(kobs) = undef - xm(kobs) = obs(kobs)-omf(kobs)+data(19,i) ! original obs w/o bias correction +! xm(kobs) = obs(kobs)-omf(kobs)+data(19,i) ! original obs w/o bias correction + xm(kobs) = data(7,i) ! height qch(kobs) = 0 ! no info available qcx(kobs) = 0 diff --git a/GMAO_ods/ods_dcscan.f b/GMAO_ods/ods_dcscan.f index de0fdf73..4eea354a 100644 --- a/GMAO_ods/ods_dcscan.f +++ b/GMAO_ods/ods_dcscan.f @@ -182,7 +182,9 @@ subroutine ods_dcscan ( verbose, fname, idate, mobs, conv, satype, rc ) & .not. trim(satype)=='mopitt' .and. & .not. trim(satype)=='acos' .and. & .not. trim(satype)=='ompsnm' .and. - & .not. trim(satype)=='ompsnp') then + & .not. trim(satype)=='ompsnmeff' .and. + & .not. trim(satype)=='ompsnp' .and. + & .not. trim(satype)=='ompsnpnc') then print*, myname, ': Unrecognized sensor on diag_ file: satype = ', trim(satype) goto 302 endif diff --git a/GMAO_ods/ods_diagnc4.f90 b/GMAO_ods/ods_diagnc4.f90 new file mode 100644 index 00000000..95f4b5fd --- /dev/null +++ b/GMAO_ods/ods_diagnc4.f90 @@ -0,0 +1,1167 @@ +module diagnc4_read + use netcdf + implicit none + +! Integer types + integer, parameter, public :: i_byte = selected_int_kind(1) ! byte integer + integer, parameter, public :: i_short = selected_int_kind(4) ! short integer + integer, parameter, public :: i_long = selected_int_kind(8) ! long integer + integer, parameter, private :: llong_t = selected_int_kind(16) ! llong integer + integer, parameter, public :: i_llong = max( llong_t, i_long ) + +! Expected 8-bit byte sizes of the integer kinds + integer, parameter, public :: num_bytes_for_i_byte = 1 + integer, parameter, public :: num_bytes_for_i_short = 2 + integer, parameter, public :: num_bytes_for_i_long = 4 + integer, parameter, public :: num_bytes_for_i_llong = 8 + +! Define arrays for default definition + integer, parameter, private :: num_i_kinds = 4 + integer, parameter, dimension( num_i_kinds ), private :: integer_types = (/ & + i_byte, i_short, i_long, i_llong /) + integer, parameter, dimension( num_i_kinds ), private :: integer_byte_sizes = (/ & + num_bytes_for_i_byte, num_bytes_for_i_short, & + num_bytes_for_i_long, num_bytes_for_i_llong /) + integer, parameter, private :: default_integer = 3 ! 1=byte, + ! 2=short, + ! 3=long, + ! 4=llong + integer, parameter, public :: i_kind = integer_types( default_integer ) + integer, parameter, public :: r_single = selected_real_kind(6) ! single precision + integer, parameter, public :: r_double = selected_real_kind(15) ! double precision + + interface get_1d_var + module procedure get_1d_double_var_ + module procedure get_1d_real_var_ + module procedure get_1d_int_var_ + module procedure get_1d_char_var_ + end interface get_1d_var + + +contains + + integer function get_dim(ncid,name,rc) + integer, intent(in) :: ncid + character(len = *),intent(in) :: name + integer, intent(out):: rc + integer :: dimid + integer :: status + integer :: length + + rc = 0 + status = nf90_inq_dimid(ncid,name,dimid) + if (status /= nf90_noerr) then + rc = 2 + status = nf90_close(ncid) + return + end if + status = nf90_inquire_dimension(ncid,dimid,len=length) + if (status /= nf90_noerr) then + rc = 2 + status = nf90_close(ncid) + return + end if + get_dim = length + return + end function get_dim + + subroutine get_1d_double_var_(ncid,name,values,rc) + integer, intent(in) :: ncid + character(len = *),intent(in) :: name + real(r_double) ,intent(out):: values(:) + integer ,intent(out):: rc + integer :: status + integer :: varid + rc = 0 + status = nf90_inq_varid(ncid,name,varid) + if (status /= nf90_noerr) then + print *,'inquire error reading ', name + rc = 2 + status = nf90_close(ncid) + return + end if + status = nf90_get_var(ncid, varid, values) + if (status /= nf90_noerr) then + print *,'error reading ', name + rc = 2 + status = nf90_close(ncid) + return + end if + return + end subroutine get_1d_double_var_ + + subroutine get_1d_real_var_(ncid,name,values,rc) + integer, intent(in) :: ncid + character(len = *),intent(in) :: name + real(r_single) ,intent(out):: values(:) + integer ,intent(out):: rc + integer :: status + integer :: varid + rc = 0 + status = nf90_inq_varid(ncid,name,varid) + if (status /= nf90_noerr) then + print *,'inquire error reading ', name + rc = 2 + status = nf90_close(ncid) + return + end if + status = nf90_get_var(ncid, varid, values) + if (status /= nf90_noerr) then + print *,'error reading ', name + rc = 2 + status = nf90_close(ncid) + return + end if + return + end subroutine get_1d_real_var_ + + subroutine get_1d_int_var_(ncid,name,ivalues,rc) + integer, intent(in) :: ncid + character(len = *),intent(in) :: name + integer(i_kind) ,intent(out):: ivalues(:) + integer ,intent(out):: rc + integer :: status + integer :: varid + rc = 0 + status = nf90_inq_varid(ncid,name,varid) + if (status /= nf90_noerr) then + print *,'inquire error reading ', name + rc = 2 + status = nf90_close(ncid) + return + end if + status = nf90_get_var(ncid, varid, ivalues) + if (status /= nf90_noerr) then + print *,'error reading ', name + rc = 2 + status = nf90_close(ncid) + return + end if + return + end subroutine get_1d_int_var_ + + subroutine get_1d_char_var_(ncid,name,cvalues,rc) + integer, intent(in) :: ncid + character(len = *),intent(in) :: name + character(len = *),intent(out):: cvalues(:) + integer ,intent(out):: rc + integer :: status + integer :: varid + rc = 0 + status = nf90_inq_varid(ncid,name,varid) + if (status /= nf90_noerr) then + print *,'inquire error reading ', name + rc = 2 + status = nf90_close(ncid) + return + end if + status = nf90_get_var(ncid, varid, cvalues) + if (status /= nf90_noerr) then + print *,'error reading ', name + rc = 2 + status = nf90_close(ncid) + return + end if + return + end subroutine get_1d_char_var_ + + subroutine get_2d_int_var(ncid,name,values,rc) + integer, intent(in) :: ncid + character(len = *),intent(in) :: name + integer(i_kind) ,intent(out):: values(:,:) + integer ,intent(out):: rc + integer :: status + integer :: varid + rc = 0 + status = nf90_inq_varid(ncid,name,varid) + if (status /= nf90_noerr) then + print *,'inquire error reading ', name + rc = 2 + status = nf90_close(ncid) + return + end if + status = nf90_get_var(ncid, varid, values) + if (status /= nf90_noerr) then + print *,'error reading ', name,', status= ',status + rc = 2 + status = nf90_close(ncid) + return + end if + end subroutine get_2d_int_var + + subroutine get_2d_double_var(ncid,name,values,rc) + integer, intent(in) :: ncid + character(len = *),intent(in) :: name + real(r_double) ,intent(out):: values(:,:) + integer ,intent(out):: rc + integer :: status + integer :: varid + rc = 0 + status = nf90_inq_varid(ncid,name,varid) + if (status /= nf90_noerr) then + print *,'inquire error reading ', name + rc = 2 + status = nf90_close(ncid) + return + end if + status = nf90_get_var(ncid, varid, values) + if (status /= nf90_noerr) then + print *,'error reading ', name,', status=',status + rc = 2 + status = nf90_close(ncid) + return + end if + end subroutine get_2d_double_var + +end module diagnc4_read + +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +!----------------------------------------------------------------------- +!BOP +! +! !ROUTINE: ods_diagnc4: get data from diag\_nc4 file and convert to ODS +! +! !INTERFACE: + +subroutine ods_diagnc4(fname, nymd, nhms, ods, rc) + +! !USES + + use m_odsmeta + use m_ods + use m_odsxsup, only : getodsmeta +! use netcdf + use diagnc4_read + use m_Sndx, only : setSndx + use m_ods_obsdiags, only : ods_obsdiags_getparam, ods_obsdiags + + + implicit none + +! !INPUT PARAMETERS: + + character(len=*), intent(in) :: fname ! GSI diag_ file name + integer, intent(in) :: nymd ! year-month-day, e.g., 19990701 + integer, intent(in) :: nhms ! hour-min-sec, e.g., 120000 + +! !OUTPUT PARAMETERS: + + type(ods_vect), intent(inout) :: ods ! ODS vector + + integer, intent(out) :: rc ! Error return code: + +! !DESCRIPTION: get data from GSI diag\_nc4 files and convert to ODS +! +! !REVISION HISTORY: +! 2019-04-16 - Sienkiewicz - Initial code from standalone nc4diag2ods +! 2019-04-22 - Sienkiewicz - added 'spd' and 'sst' processing +! 2019-05-21 - Sienkiewicz - replace nc_diag_read routines +! 2019-08-28 - Sienkiewicz - polymorphic get_1d_var, initial implementation +! of sensitivity processing +!EOP +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + integer input_id + real(r_single) zero_single,tiny_single + real small_num + logical verbose + logical satknown + real, parameter :: undef = 1.e15 + integer nchan_dim, nspot, i, j, jj, n, knt, isat, kidsat, ii + integer clen, stlen + integer statks + integer status + integer idimid, varid + character(len=5) :: statid + + logical :: lobsdiagsave, lobssens, ladjsigo + integer miter + + character(len=20) isis + character(len=10) dplat,satype,diag_type + + integer iiuse, inldpt, itldpt, iobssen + integer iunldpt, ivnldpt, iutldpt, ivtldpt, iuobssen, ivobssen + integer ndiag, ioff + integer, allocatable :: obs_iuse(:,:) + real(r_single) :: nlomx(2), tlomx(2), obimp(2) + real(r_single), allocatable :: pdata(:,:) + real(r_double), allocatable :: u_obs_nldepart(:,:), u_obs_tldepart(:,:), & + u_obs_obssen(:,:), v_obs_nldepart(:,:), v_obs_tldepart(:,:), v_obs_obssen(:,:), & + obs_nldepart(:,:), obs_tldepart(:,:), obs_obssen(:,:) + logical passed + + integer, parameter :: nnln = 8 + character(len=*), parameter :: nlnqct(nnln)=(/ ' dw', ' ps', 'tcp', ' q', & + 'spd', ' t', ' uv', 'sst'/) + integer, parameter :: noz = 15 + character(len=*), parameter :: oztype(noz)=(/'sbuv2', 'omi', 'mls', & + 'mls20', 'mls22', 'mls30', 'mls55', 'tomseff', 'omieff', 'o3lev', & + 'gome','ompslpuv','ompslpvis','ompsnm','ompsnp'/) + +! ODS variables +! ------------- + integer nobs_ods, nobs, nobs1, nobs2 + integer ierr + integer(i_kind), allocatable :: ivals(:),iuse(:) + real(r_single), allocatable :: rvals(:),rvals2(:),sigo(:),o3pres(:) + real(r_double), allocatable :: varchn(:) + character(len=3) obsclass + character(len=:), dimension(:), allocatable :: ob_class + character(len=:), dimension(:), allocatable :: station + integer nymdh,nymdf,nhmsf + integer iks + + tiny_single = tiny(zero_single) + small_num = 10. * tiny_single + ladjsigo = .true. + verbose = .true. + + nymdh = 0 + + rc = 0 + + +! Inquire whether this is diag file w/ history of omx, osens, ... +! --------------------------------------------------------------- + call ods_obsdiags_getparam ( 'lobsdiagsave', lobsdiagsave ) + call ods_obsdiags_getparam ( 'lobssens', lobssens ) + call ods_obsdiags_getparam ( 'miter', miter ) + call ods_obsdiags_getparam ( 'ladjsigo', ladjsigo ) + +! Initialize the nc_diag reader +! ----------------------------- + + status = nf90_open(path= trim(fname), mode= nf90_nowrite, & + ncid = input_id) + if (status /= nf90_noerr) then + rc=1 + print *,'Unable to read file ',trim(fname) + return + end if + + +! Get the date_time value and check against the 'requested' +! --------------------------------------------------------- + status = nf90_inquire_attribute(input_id,NF90_GLOBAL,'date_time') + if ( status /= nf90_noerr ) then + print *,'Unable to find date/time in file ',trim(fname) + rc = 1 + status = nf90_close(input_id) + return + end if + status = nf90_get_att(input_id,NF90_GLOBAL,'date_time',nymdh) + if ( status /= nf90_noerr ) then + print *,'Unable to read date/time from file ',trim(fname) + rc = 1 + status = nf90_close(input_id) + return + end if + + nymdf = nymdh / 100 + nhmsf = mod(nymdh,100)*10000 + if (nymdf/=nymd .or. nhmsf/=nhms) then + rc = 1 + print*, 'Date/Time requested not found in nc4 file' + print*, ' nymd , nhms =',nymd ,nhms + print*, ' nymdf, nhmsf=',nymdf,nhmsf + status = nf90_close(input_id) + return + end if + +! Start reading the data from the file +! ------------------------------------ + nobs = get_dim(input_id,'nobs',rc) + if (rc /= 0) return + +! Check for the observation type. +! ------------------------------- + status = nf90_inquire_attribute(input_id,NF90_GLOBAL,'Satellite') + if (status == nf90_noerr) then + print *,'found Satellite attribute' + +! Processing radiance or ozone type +! --------------------------------- + status = nf90_get_att(input_id,NF90_GLOBAL,'Observation_type', satype) + if (status /= nf90_noerr) then + print *,'Unable to read Observation_type metadata' + rc = 1 + status = nf90_close(input_id) + return + end if + status = nf90_get_att(input_id,NF90_GLOBAL,'Satellite_Sensor', isis) + if (status /= nf90_noerr) then + print *,'Unable to read Satellite_Sensor metadata' + rc = 1 + status = nf90_close(input_id) + return + end if + status = nf90_get_att(input_id,NF90_GLOBAL,'Satellite', dplat) + if (status /= nf90_noerr) then + print *,'Unable to read Satellite metadata' + rc = 1 + status = nf90_close(input_id) + return + end if + + if( any(trim(satype) == oztype )) then + diag_type = 'ozone' + call ozone_getisat_(satype,dplat,isis,isat) + print *,'ozone: ',satype,dplat,isis,isat + else + diag_type = 'radiance' + call getsatid_(isat) + endif + nobs_ods = nobs + print *,' diag type = ',diag_type, ' sensor = ',isis,' nobs = ',nobs_ods + + satknown = .false. + kidsat = isat + do n = 1,nsats + if (trim(sats(n))==trim(satype)) then + satknown = .true. + kidsat = kidsat + idsats(n) + exit + else + cycle + endif + enddo + if (.not. satknown .or. kidsat == 0) then + print *,'Cannot identify satellite type:' + print *,'isis = ',isis,' dplat = ',dplat,' satype = ',satype,' isat =',isat + status = nf90_close(input_id) + rc=3 + return + end if + + else if ( nf90_inq_dimid(input_id,'Observation_Class_maxstrlen',idimid) == nf90_noerr ) then + +! +! We -ought- to be able to get the type from a global (assuming the diag file +! is homogeneous) but for now will take it from the first element of the +! observation class array. +!!TO_DO - add global variable with observation class to non-radiance diag files? + + + status = nf90_inquire_dimension(input_id,idimid,len=clen) + if (status /= nf90_noerr) then + print *, 'problem getting obs class string length' + rc=1 + status = nf90_close(input_id) + return + end if + + allocate(character(len=clen) :: ob_class(nobs)) + status = nf90_inq_varid(input_id,'Observation_Class',varid) + if (status /= nf90_noerr) then + print *,'error getting Observation Class' + rc = 1 + status = nf90_close(input_id) + return + end if + status = nf90_get_var(input_id, varid, ob_class) + if (status /= nf90_noerr) then + print *,'error getting Observation Class' + rc = 1 + status = nf90_close(input_id) + return + end if + obsclass = ob_class(1)(clen-2:clen) + if ( obsclass == ' uv') then + diag_type = 'uvconv' + nobs1 = nobs+1 + nobs2 = nobs*2 + nobs_ods = nobs2 + else + diag_type = 'conv' + nobs_ods = nobs + end if + print *,' diag type = ',diag_type,'ob_class = ',ob_class(1),' nobs = ',nobs_ods + else + print *,'missing info, can''t convert obstype, ',trim(fname) + rc = 4 + status = nf90_close(input_id) + return + end if + + call ODS_Init (ods, nobs_ods, ierr) + if (ierr /= 0) then + print *, 'error initializing ODS vector, ierr = ',ierr + rc = 7 + status = nf90_close(input_id) + return + end if + + allocate(ivals(nobs),rvals(nobs),rvals2(nobs),sigo(nobs),stat=ierr) + if (ierr /= 0) then + print *, 'error alllocating arrays for reading data, ierr= ',ierr + rc = 7 + status = nf90_close(input_id) + return + end if + +! Fields common to all data types - latitude, longitude, obs, omf +! --------------------------------------------------------------- + call get_1d_var(input_id,'Latitude',rvals,rc) + if (rc /= 0) return + ods%data%lat(1:nobs) = rvals + call get_1d_var(input_id,'Longitude',rvals,rc) + if (rc /= 0) return + where( rvals > 180) rvals = rvals - 360. + ods%data%lon(1:nobs) = rvals + + if (diag_type == 'uvconv') then + call get_1d_var(input_id,'u_Observation',rvals,rc) + if (rc /= 0) return + ods%data%obs(1:nobs) = rvals + call get_1d_var(input_id,'u_Obs_Minus_Forecast_adjusted',rvals,rc) + if (rc /= 0) return + ods%data%omf(1:nobs) = rvals + call get_1d_var(input_id,'v_Observation',rvals,rc) + if (rc /= 0) return + ods%data%obs(nobs1:nobs_ods) = rvals + call get_1d_var(input_id,'v_Obs_Minus_Forecast_adjusted',rvals,rc) + if (rc /= 0) return + ods%data%omf(nobs1:nobs_ods) = rvals + + ods%data%lat(nobs1:nobs_ods) = ods%data%lat(1:nobs) + ods%data%lon(nobs1:nobs_ods) = ods%data%lon(1:nobs) + else + call get_1d_var(input_id,'Observation',rvals,rc) + if (rc /= 0) return + ods%data%obs = rvals + call get_1d_var(input_id,'Obs_Minus_Forecast_adjusted',rvals,rc) + if (rc /= 0) return + ods%data%omf = rvals + end if + ods%data%oma = undef + ods%data%qchist = 0 + +! Processing for radiance types +! ----------------------------- + if ( diag_type == 'radiance' ) then + + nchan_dim = get_dim(input_id,'nchans',rc) + if (rc /= 0) return + + call get_1d_var(input_id,'Obs_Time',rvals,rc) + if (rc /= 0) return + ods%data%time = int(rvals * 60.) ! use 'int' to match diag_bin time + call get_1d_var(input_id,'Channel_Index',ivals,rc) + if (rc /= 0) return + ods%data%lev = float(ivals) + call get_1d_var(input_id,'Obs_Minus_Forecast_unadjusted',rvals,rc) + if (rc /= 0) return + ods%data%xm=rvals-ods%data%omf + + call get_1d_var(input_id,'Inverse_Observation_Error',rvals,rc) + if (rc /= 0) return + + sigo = undef + +! Check if original or adjusted (final) sigO value is requested +! ------------------------------------------------------------- + if (ladjsigo) then + where (rvals > small_num) sigo = 1.0/rvals + else + allocate(varchn(nchan_dim)) + call get_1d_var(input_id,'error_variance',varchn,rc) + if (rc /= 0) return + + varchn = sqrt(varchn) + where (rvals > small_num) sigo = varchn(ods%data%lev) + deallocate(varchn) + end if + ods%data%Xvec = sigo ! radiance Xvec + + allocate(iuse(nchan_dim)) + call get_1d_var(input_id,'use_flag',iuse,rc) + if (rc /= 0) return + ivals = 0 + where(rvals <= small_num) ivals = 2 + call get_1d_var(input_id,'QC_Flag',rvals,rc) + if (rc /= 0) return + where( rvals < 0 ) ivals = 1 + do i = 1,nchan_dim + if (iuse(i) == -1) where(ods%data%lev == i) ivals=1 + end do + ods%data%qcexcl = ivals + deallocate(iuse) + + nspot = nobs/nchan_dim + knt = 0 + do i = 1,nspot + do j = 1,nchan_dim + knt = knt + 1 + ods%data%ks(knt) = i + end do + end do + + ods%data%kt = 40 + ods%data%kx = kidsat + +! Processing for ozone types +! -------------------------- + else if ( diag_type == 'ozone') then + + ods%data%kx = kidsat + + call get_1d_var(input_id,'Time',rvals,rc) + if (rc /= 0) return + ods%data%time = int(rvals * 60.) + + call get_1d_var(input_id,'Reference_Pressure',rvals,rc) + if (rc /= 0) return + ods%data%lev = rvals + + + select case(satype) + +! Level ozone observation processing +! ---------------------------------- + case('o3lev','mls','mls20','mls22','mls30','mls55') + ods%data%kt = kto3mx + do i = 1,nobs + ods%data%ks(i) = i + end do + +! Layer (and total) ozone observation processing +! ---------------------------------------------- + case default + + ods%data%kt = kto3 + iks = 1 + ods%data%xm(1) = 0.0 + do i = 1,nobs + ods%data%ks(i) = iks + if (ods%data%lev(i) == 0.0) then + ods%data%kt(i) = kttco3 ! total ozone + ods%data%lev(i) = undef + ods%data%xm(i) = 0.0 + iks = iks + 1 + else + ods%data%kt(i) = kto3 ! layer ozone + if (i < nobs) ods%data%xm(i+1) = ods%data%lev(i) + end if + end do + + end select + + sigo = undef + ivals = 0 + call get_1d_var(input_id,'Inverse_Observation_Error',rvals,rc) + if (rc /= 0) return + where(rvals > small_num) + sigo = 1./rvals + elsewhere + ivals = 2 + endwhere + ods%data%Xvec = sigo ! ozone Xvec + ods%data%qcexcl = ivals + + + + else if ( diag_type == 'uvconv' .or. diag_type == 'conv' ) then + +! Process conventional data types (including GPS) +! ------------------------------------------------ + stlen = get_dim(input_id, 'Station_ID_maxstrlen',rc) + if (rc /= 0) return + allocate(character(len=stlen) :: station(nobs)) + call get_1d_var(input_id,'Station_ID',station,rc) + if (rc /= 0) return + + call get_1d_var(input_id,'Time',rvals,rc) + if (rc /= 0) return + ods%data%time(1:nobs) = int(rvals * 60,) + + call get_1d_var(input_id,'Observation_Type',ivals,rc) + if (rc /= 0) return + ods%data%kx(1:nobs) = ivals + + call get_1d_var(input_id,'Pressure',rvals,rc) + if (rc /= 0) return + ods%data%lev(1:nobs) = rvals + + ivals = 0 + call get_1d_var(input_id, 'Analysis_Use_Flag',rvals,rc) + if (rc /= 0) return + where( rvals < 0 ) ivals = X_PASSIVE + + sigo = undef + call get_1d_var(input_id,'Errinv_Final',rvals,rc) + if (rc /= 0) return + call get_1d_var(input_id,'Nonlinear_QC_Rel_Wgt',rvals2,rc) + if (rc /= 0) return +! +! use nonlin QC mark where rel weight < 1 (overrides X_PASSIVE) +! -------------------------------------------------------------- + if( any(obsclass == nlnqct) ) where(rvals2 < 1 ) ivals = X_NCEP_NLNQC + +! Check if original or adjusted (final) sigO value is requested +! ------------------------------------------------------------- + if (ladjsigo) then ! use adjusted sigo + rvals2 = rvals + else ! use input sigo + call get_1d_var(input_id,'Errinv_Input',rvals2,rc) + if (rc /= 0) return + end if + + where (rvals > small_num) + sigo = 1./rvals2 + elsewhere + sigo = undef + ivals = 2 ! rejected by QC + endwhere + ods%data%qcexcl(1:nobs) = ivals + ods%data%Xvec(1:nobs) = sigo ! conventional Xvec + + if (diag_type == 'uvconv') then + ods%data%time(nobs1:nobs_ods) = ods%data%time(1:nobs) + ods%data%kx(nobs1:nobs_ods) = ods%data%kx(1:nobs) + ods%data%lev(nobs1:nobs_ods) = ods%data%lev(1:nobs) + ods%data%qcexcl(nobs1:nobs_ods) = ods%data%qcexcl(1:nobs) + ods%data%Xvec(nobs1:nobs_ods) = ods%data%Xvec(1:nobs) ! v-component Xvec + end if + + select case( obsclass ) + + case ('gps') +!!TO_DO - need GPS rdiag(19) 'hob' vertical grid location, to use +!! for adjusting error with pressure values == 0.0 + call get_1d_var(input_id,'GPS_Type',rvals,rc) + if (rc /= 0) return + + if(rvals(1) == 0) then ! assuming homogeneous file + ods%data%kt= ktGPSr + call get_1d_var(input_id,'Model_Elevation',rvals,rc) + if (rc /= 0) return + ods%data%xm = rvals + else + ods%data%kt= ktGPSb + call get_1d_var(input_id,'Height',rvals,rc) + if (rc /= 0) return + ods%data%xm = rvals + endif + +! fix for pressure = 0. + if (any(ods%data%lev == 0.0)) then + status = nf90_inq_varid(input_id,'Vertical_Grid_Location',varid) + if (status == nf90_noerr) then + call get_1d_var(input_id,'Vertical_Grid_Location',rvals,rc) + if (rc /= 0) return + do i = 1,nobs + if (ods%data%lev(i) == 0.0) then + if (rvals(i) < 1.) then + ods%data%lev(i) = 1050. ! obs below model sfc + else + ods%data%lev(i) = 0.01 ! obs above model top + endif + endif + end do + end if + end if + + case (' ps', 'tcp') ! surface pressure + ods%data%kt= ktps2m + ods%data%lev = undef + call get_1d_var(input_id,'Height',rvals,rc) + if (rc /= 0) return + ods%data%xm = rvals + + case(' q') + ods%data%kt= ktqq ! specific humidity + ods%data%obs = 1.e3*ods%data%obs + ods%data%omf = 1.e3*ods%data%omf + call get_1d_var(input_id,'Forecast_Saturation_Spec_Hum',rvals,rc) + if (rc /= 0) return + ods%data%xm = 1.e3*rvals + where(sigo /= undef) ods%data%Xvec = 1.e3*sigo ! adjust Q Xvec + + case ('spd') + ods%data%kt= ktus10 ! define it as 10m speeds + ods%data%lev = undef + call get_1d_var(input_id,'Height',rvals,rc) + if (rc /= 0) return + ods%data%xm = rvals + + case('sst') + ods%data%kt= ktSST + ods%data%lev = undef +! (use Station_Elevation to match diag_bin processing) + call get_1d_var(input_id,'Station_Elevation',rvals,rc) + if (rc /= 0) return + ods%data%xm = rvals + + case (' t') ! virtual temperature + ods%data%kt= ktTv + where(ods%data%kx==311) ods%data%kx=304 + call get_1d_var(input_id,'Obs_Minus_Forecast_unadjusted',rvals,rc) + if (rc /= 0) return + ods%data%xm=rvals-ods%data%omf ! fill in bias correction as xm + + case(' uv') ! vector wind + ods%data%kt(1:nobs) = ktuu + ods%data%kt(nobs1:nobs_ods) = ktvv + call get_1d_var(input_id,'Height',rvals,rc) + if (rc /= 0) return + ods%data%xm(1:nobs) = rvals + ods%data%xm(nobs1:nobs_ods) = rvals + + case(' pw') ! total column water + ods%data%kt = ktTPW + call get_1d_var(input_id,'Prep_QC_Mark',rvals,rc) + if (rc /= 0) return + ods%data%xm = rvals + + case default + print *,'can''t handle var = ',trim(ob_class(1)), nobs, ' observations' + rc = 4 + status = nf90_close(input_id) + return + end select + +! Set sounding index as in diag_bin processing +! -------------------------------------------- + + call setsndx (ods%data%ks(1:nobs),ods%data%kx(1:nobs),station(1:nobs)) + +! Set ks to actual station id for radiosondes +! ------------------------------------------- + do i = 1, nobs + if (ods%data%kx(i)==120 .OR. ods%data%kx(i)==220 .or. & ! radiosondes + ods%data%kx(i)==901 .OR. ods%data%kx(i)==902) then ! lagragian ballon data + +! Normally the station id is a 5-digit number ... +! ------------------------------------------- + statid = station(i)(1:5) + read(statid,'(i5)',err=999) statks + if (statks > 0 ) then + ods%data%ks(i) = statks + else ! if invalid numeric id, treat like non-numeric id + ! RT: code will never be here! + do ii =1,len(station(i)) + ods%data%ks(i) = ods%data%ks(i)+ii*iachar(station(i)(ii:ii)) ! arbitrary scheme to use a number better than 99999 + enddo + print*, 'ods_diagnc4: YES CODE PASSES HERE SOMETIMES!' + endif + cycle + +! ... but if not, make sure this ks is distinct from any other station id +! ----------------------------------------------------------------------- +999 continue + + do ii =1,len(station(i)) + ods%data%ks(i) = ods%data%ks(i)+ii*iachar(station(i)(ii:ii)) ! arbitrary scheme to use a number better than 99999 + enddo + if (verbose) print *,'Non-numeric station id ', statid, ' for kx = ', ods%data%kx(i), 'assigned ks =', ods%data%ks(i) + + end if + end do + + deallocate(station) + + deallocate(ob_class) + + end if + + if ( diag_type == 'uvconv' ) then + ods%data%ks(nobs1:nobs_ods) = ods%data%ks(1:nobs) + end if + + call getodsmeta( ods ) + +! The initial implementation of sensitivity calculation attempts to put the +! sensitivity data into an array arranged in the same way as the data in the +! binary files (except of course with only the sensitivity information) and +! calls the same m_ods_obsdiags routines in the same way to produce the same +! result (hopefully) as for the binary diag files. Later on more efficient +! routines to process the data can be worked out. + + if (lobsdiagsave) then + + iiuse = get_dim(input_id,'ObsDiagSave_iuse_arr_dim',rc) + if (rc /= 0) then + print *,'problem getting iuse dimension, exiting' + return + end if + + if (iiuse /= miter) then + print *,'iuse array inconsistent with miter, exiting' + rc = 10 + return + end if + + if (diag_type == 'uvconv') then + iunldpt = get_dim(input_id,'u_ObsDiagSave_nldepart_arr_dim',rc) + if (rc /= 0) then + print *,'problem getting nldepart dimension, exiting' + return + end if + iutldpt = get_dim(input_id,'u_ObsDiagSave_tldepart_arr_dim',rc) + if (rc /= 0) then + print *,'problem getting tldepart dimension, exiting' + return + end if + iuobssen = get_dim(input_id,'u_ObsDiagSave_obssen_arr_dim',rc) + if (rc /= 0) then + print *,'problem getting obssen dimension, exiting' + return + end if + + ivnldpt = get_dim(input_id,'v_ObsDiagSave_nldepart_arr_dim',rc) + if (rc /= 0) then + print *,'problem getting nldepart dimension, exiting' + return + end if + ivtldpt = get_dim(input_id,'v_ObsDiagSave_tldepart_arr_dim',rc) + if (rc /= 0) then + print *,'problem getting tldepart dimension, exiting' + return + end if + ivobssen = get_dim(input_id,'v_ObsDiagSave_obssen_arr_dim',rc) + if (rc /= 0) then + print *,'problem getting obssen dimension, exiting' + return + end if + +! allocate arrays for reading in sensitivity information + allocate(obs_iuse(iiuse,nobs),u_obs_nldepart(iunldpt,nobs), & + u_obs_tldepart(iutldpt,nobs),u_obs_obssen(iuobssen,nobs), & + v_obs_nldepart(ivnldpt,nobs),v_obs_tldepart(ivtldpt,nobs),& + v_obs_obssen(ivobssen,nobs),pdata(7*miter+2,nobs),stat=ierr) + if (ierr /= 0) then + print *, 'error alllocating arrays for reading data, ierr= ',ierr + rc = 7 + status = nf90_close(input_id) + return + end if +! read arrays with sensitivity information + call get_2d_int_var(input_id,'ObsDiagSave_iuse',obs_iuse,rc) + if (rc /= 0) return + call get_2d_double_var(input_id,'u_ObsDiagSave_nldepart',u_obs_nldepart,rc) + if (rc /= 0) return + call get_2d_double_var(input_id,'u_ObsDiagSave_tldepart',u_obs_tldepart,rc) + if (rc /= 0) return + call get_2d_double_var(input_id,'u_ObsDiagSave_obssen',u_obs_obssen,rc) + if (rc /= 0) return + call get_2d_double_var(input_id,'v_ObsDiagSave_nldepart',v_obs_nldepart,rc) + if (rc /= 0) return + call get_2d_double_var(input_id,'v_ObsDiagSave_tldepart',v_obs_tldepart,rc) + if (rc /= 0) return + call get_2d_double_var(input_id,'v_ObsDiagSave_obssen',v_obs_obssen,rc) + if (rc /= 0) return + + ioff = 0 + do jj = 1,miter + ioff = ioff + 1 + pdata(ioff,1:nobs) = obs_iuse(jj,1:nobs) + enddo + do jj = 1,miter+1 + ioff = ioff + 1 + pdata(ioff,1:nobs) = u_obs_nldepart(jj,1:nobs) + ioff = ioff + 1 + pdata(ioff,1:nobs) = v_obs_nldepart(jj,1:nobs) + end do + do jj = 1,miter + ioff = ioff + 1 + pdata(ioff,1:nobs) = u_obs_tldepart(jj,1:nobs) + ioff = ioff + 1 + pdata(ioff,1:nobs) = v_obs_tldepart(jj,1:nobs) + end do + do jj = 1,miter + ioff = ioff + 1 + pdata(ioff,1:nobs) = u_obs_obssen(jj,1:nobs) + ioff = ioff + 1 + pdata(ioff,1:nobs) = v_obs_obssen(jj,1:nobs) + end do + + do i = 1,nobs + ods%data%Xvec(i) = 0.0 + ods%data%Xvec(i+nobs) = 0.0 + call ods_obsdiags(nlomx, tlomx, obimp, pdata, 0, i, & + 7*miter+2, nobs, undef, passed) + if (passed) then + ods%data%Xvec(i) = obimp(1) + ods%data%Xvec(i+nobs) = obimp(2) + ods%data%qcexcl(i) = 0 + ods%data%qcexcl(i+nobs) = 0 + end if + end do + + deallocate(obs_iuse, u_obs_nldepart, u_obs_tldepart, & + u_obs_obssen, v_obs_nldepart, v_obs_tldepart, & + v_obs_obssen, pdata) + + else +! get dimensions for sensitivity variables + inldpt = get_dim(input_id,'ObsDiagSave_nldepart_arr_dim',rc) + if (rc /= 0) then + print *,'problem getting nldepart dimension, exiting' + return + end if + itldpt = get_dim(input_id,'ObsDiagSave_tldepart_arr_dim',rc) + if (rc /= 0) then + print *,'problem getting tldepart dimension, exiting' + return + end if + iobssen = get_dim(input_id,'ObsDiagSave_obssen_arr_dim',rc) + if (rc /= 0) then + print *,'problem getting obssen dimension, exiting' + return + end if + +! allocate arrays for reading in sensitivity information + allocate(obs_iuse(iiuse,nobs),obs_nldepart(inldpt,nobs), & + obs_tldepart(itldpt,nobs),obs_obssen(iobssen,nobs), & + pdata(4*miter+1,nobs),stat=ierr) + if (ierr /= 0) then + print *, 'error alllocating arrays for reading data, ierr= ',ierr + rc = 7 + status = nf90_close(input_id) + return + end if +! read arrays with sensitivity information + call get_2d_int_var(input_id,'ObsDiagSave_iuse',obs_iuse,rc) + if (rc /= 0) return + call get_2d_double_var(input_id,'ObsDiagSave_nldepart',obs_nldepart,rc) + if (rc /= 0) return + call get_2d_double_var(input_id,'ObsDiagSave_tldepart',obs_tldepart,rc) + if (rc /= 0) return + call get_2d_double_var(input_id,'ObsDiagSave_obssen',obs_obssen,rc) + if (rc /= 0) return + + ioff = 0 + do jj = 1,miter + ioff = ioff + 1 + pdata(ioff,1:nobs) = obs_iuse(jj,1:nobs) + enddo + do jj = 1,miter+1 + ioff = ioff + 1 + pdata(ioff,1:nobs) = obs_nldepart(jj,1:nobs) + end do + do jj = 1,miter + ioff = ioff + 1 + pdata(ioff,1:nobs) = obs_tldepart(jj,1:nobs) + end do + do jj = 1,miter + ioff = ioff + 1 + pdata(ioff,1:nobs) = obs_obssen(jj,1:nobs) + end do + + do i = 1,nobs + ods%data%Xvec(i) = 0.0 + call ods_obsdiags(nlomx(1), tlomx(1), obimp(1), pdata, 0, i, & + 4*miter+1, nobs, undef, passed) + if (passed) then + ods%data%Xvec(i) = obimp(1) + ods%data%qcexcl(i) = 0 + end if + end do + + deallocate(obs_iuse, obs_nldepart, obs_tldepart, obs_obssen, pdata) + + end if + end if + + status = nf90_close(input_id) + + deallocate(ivals, rvals, rvals2, sigo) + + return + +contains + + subroutine getsatid_(myisat) +! RT: some heck that needs more work +! RT: this needs serious attention as it is becoming a huge heck now (3/30/09) + implicit none + integer, intent(out) :: myisat + integer ios + + myisat = 0 ! take fixed sat index as in idsats + +! select case( trim(ladjust(dplat)) ) +! case ('aura') +! myisat = 999 +! return +! end select + +! first handle precip types + i = index('pcp',isis(1:3)) + if (i>0) then + i = index('trmm',dplat(1:4)) + if (i>0) then + if (dplat(6:8) == 'lnd') then + myisat = 1 + else if (dplat(6:8) == 'ocn') then + myisat = 2 + else + myisat = 0 + end if + return + else + read(dplat(5:6),'(i2)',iostat=ios)myisat + return + end if + end if + +! Need to distinguish between AMSUA from AQUA and METOP for example +! (NOAA sats are already distinguished) + i = index('metop',dplat(1:5)) + if(i>0)then + myisat = 25 + iachar(dplat(7:7)) - iachar('a') + return + endif + i = index('tiros',dplat(1:5)) + if(i>0)then + myisat = 5 + return + endif +! i = index('aqua',dplat(1:4)) +! if(i>0)then +! return +! endif +! the "word" fgnm stands for the platforms dmsp/goes/noaa/meteosat this needs generalization +! e.g. dmsp -> f15 goes -> g12 noaa -> n18 meteosat -> m09 + i = index('fgnm',dplat(1:1)) + if(i>0)then + read(dplat(2:3),'(i2)',iostat=ios)myisat + endif + + end subroutine getsatid_ + + subroutine ozone_getisat_(dtype,dplat,dsis,myisat) + implicit none + character(len=*),intent(in):: dtype,dplat,dsis + integer,intent(out):: myisat + + myisat=0 ! for a default isat value. + + if(len_trim(dplat)==3 .and. & + verify(dplat(1:1),'fgnm')==0 .and. & + verify(dplat(2:3),'0123456789')==0) then +! the "word" fgnm stands for the platforms dmsp/goes/noaa/meteosat this needs generalization +! e.g. dmsp -> f15 goes -> g12 noaa -> n18 meteosat -> m09 + read(dplat(2:3),'(i2)') myisat + + else + select case(dplat) + case('aura') + myisat = 0 + case('nim07') + myisat = 1 + case('ep') + myisat = 2 + case('metop-a') + myisat = 25 + case('metop-b') + myisat = 26 + case default + if(dplat(1:6)=='metop-') myisat = 25 + iachar(dplat(7:7)) - iachar('a') + end select + endif + end subroutine ozone_getisat_ + +end subroutine ods_diagnc4 diff --git a/GMAO_ods/odslist.f b/GMAO_ods/odslist.f index 932c6cd1..dcacbe42 100644 --- a/GMAO_ods/odslist.f +++ b/GMAO_ods/odslist.f @@ -239,9 +239,13 @@ program odslist subroutine init ( infile, NFILES_MAX, nfiles, . synhour, nonames, nosort, outfile, ncf ) +!!USES: + + use m_ods_obsdiags, only : ods_obsdiags_setparam + implicit NONE + ! !INPUT PARAMETERS: ! - implicit NONE integer, intent(in) :: nfiles_max ! ! !OUTPUT PARAMETERS: @@ -261,6 +265,8 @@ subroutine init ( infile, NFILES_MAX, nfiles, ! !REVISION HISTORY: ! ! 21Sep98 - D.Dee Initial code +! 3Apr19 - Sienkiewicz - added '-prepsigo' (use with -ncf) +! to write original sigo ! !EOP !BOC @@ -270,6 +276,9 @@ subroutine init ( infile, NFILES_MAX, nfiles, integer iret, i, lv, iarg, argc, iargc character*255 argv character*2 HH + logical adjsigo + + adjsigo = .true. ! Parse command line ! ------------------ @@ -292,6 +301,8 @@ subroutine init ( infile, NFILES_MAX, nfiles, nosort = .TRUE. elseif (index(argv,'-ncf') .gt. 0 ) then ncf = .TRUE. + elseif (index(argv,'-prepsigo') .gt. 0) then + adjsigo = .FALSE. elseif (index(argv,'-synhour') .gt. 0 ) then if ( iarg+1 .gt. argc ) call usage() iarg = iarg + 1 @@ -336,6 +347,10 @@ subroutine init ( infile, NFILES_MAX, nfiles, print * print *, 'Output filename: ', outfile + if (ncf) then + call ods_obsdiags_setparam('ladjsigo',adjsigo) + endif + return end ! subroutine init @@ -465,7 +480,7 @@ subroutine usage() print * print *, 'odslist - Create ASCII Listing from ODS File' print * - print *, 'Usage: odslist [-strip] [-nosort] [-ncf]', + print *, 'Usage: odslist [-strip] [-nosort] [-ncf] [-prepsigo]', . '[-synhour HH] [-o FNAME] odsfile' print * print *, 'where' @@ -478,6 +493,8 @@ subroutine usage() print *, ' (default: do)' print *, '-ncf specify when input files are non-ODS files' print *, ' (default: ignore)' + print *, '-prepsigo write original obs error from prepbufr for -ncf files' + print *, ' (default: write modified error from GSI)' print *, '-synhour HH process synoptic hour HH' print *, ' (default: first on file)' print *, '-o FNAME output file name' diff --git a/GMAO_ods/odsmatch.rc b/GMAO_ods/odsmatch.rc index 707b64eb..2bfb0b86 100644 --- a/GMAO_ods/odsmatch.rc +++ b/GMAO_ods/odsmatch.rc @@ -7,6 +7,9 @@ # 31May2012 - Todling - add new GPS 3,41,421,440,821 # 04Feb2015 - Todling - revamp to account for KT as well as KX; # update GPS instruments +# 11Feb2020 - Todling - add kx=5 for GPS +# 19Mar2020 - Sienkiewicz - add kx=825 for GPS +# 09Jun2021 - Todling - add RO 265(GeoOptics) and 269(Spire) # #list_kx_height_based: 221 223 224 226 229 280:290 299 401 3 4 41:44 440 421 440 722:729 740:745 750:755 786 820 821 @@ -15,7 +18,7 @@ list_height_based:: 33 120 181 187 4 221 223 224 226 229 280:290 299 401 5 221 223 224 226 229 280:290 299 401 - 88 3 4 41:44 440 421 440 722:729 740:745 750:755 786 820 821 - 89 3 4 41:44 440 421 440 722:729 740:745 750:755 786 820 821 + 88 3:5 41:44 265 269 440 421 440 722:729 740:745 750:755 786 820 821 825 + 89 3:5 41:44 265 269 440 421 440 722:729 740:745 750:755 786 820 821 825 :: diff --git a/GMAO_ods/odsmeta.h b/GMAO_ods/odsmeta.h index 7f678bb0..13bfbd48 100644 --- a/GMAO_ods/odsmeta.h +++ b/GMAO_ods/odsmeta.h @@ -124,12 +124,12 @@ integer, parameter :: ktco = 127 ! layer co (ppbv) integer, parameter :: ktxco2 = 126 ! average column co2 (ppmv) - integer, dimension(28), parameter :: ktSurfAll = (/ ktus, ktvs, ktslp, + integer, dimension(29), parameter :: ktSurfAll = (/ ktus, ktvs, ktslp, & ktus10, ktTs10, ktTds, ktrhs, ktqs10, & ktspd2m, ktmxspd2m, ktwgust2m, ktt2m, & ktmxt2m, ktmmnt2m, ktdewt2m, ktrh2m, & ktsphu2m, ktps2m, ktskint, ktpr, kttpw, - & ktSST, ktpr2, + & ktSST, ktpr2, kttco3, & ktANGE, ktSOLZ, ktSOLA, ktSENZ, ktSENA /) integer, dimension(13), parameter :: ktUppaAll = (/ ktuu, ktvv, ktHH, ktww, @@ -318,7 +318,7 @@ 8 'no impact due to advected local '/) - integer, parameter :: nsats = 48 + integer, parameter :: nsats = 51 character(len=*), parameter :: sats(nsats)=(/ . 'hirs2 ', 'hirs3 ', 'hirs4 ', . 'msu ', 'ssu ', 'sndr ', @@ -335,7 +335,8 @@ . 'mls30 ', 'mls55 ', 'ompslp ', . 'tmi ', 'gmi ', 'acos ', . 'mopitt ', 'cris-fsr ', 'ompslpuv ', - . 'ompslpvis ', 'ompsnm ', 'ompsnp ' /) + . 'ompslpvis ', 'ompsnm ', 'ompsnp ', + . 'amsr2 ', 'ompsnmeff ', 'ompsnpnc '/) ! note: numbers below were made up for MHS, and SSU ! note: CRIS and ATMS numbers assigned at will @@ -357,7 +358,8 @@ . 325 , 330 , 335 , . 705 , 706 , 998 , . 999 , 940 , 335 , - . 336 , 427 , 437 /) + . 336 , 427 , 437 , + . 550 , 428 , 438 /) integer, parameter :: npcp = 4 character(len=*), parameter :: pcpt(npcp)=(/ diff --git a/GMAO_ods/odsnxtime.f b/GMAO_ods/odsnxtime.f index 7c9022fe..e699cb70 100644 --- a/GMAO_ods/odsnxtime.f +++ b/GMAO_ods/odsnxtime.f @@ -1,16 +1,16 @@ !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! +! NASA/GSFC, Data Assimilation Office, Code 610.1, GEOS/DAS ! !----------------------------------------------------------------------- !BOP ! -! !ROUTINE: ods_dcget: get data from diag_conv and places in ODS +! !ROUTINE: odsnxtime: read next date/time from ODS (or other diag) file ! ! !INTERFACE: subroutine odsnxtime ( ODSFile, nymd, nhms ) ! !USES: - + use netcdf implicit none include 'ods_stdio.h' @@ -31,6 +31,7 @@ subroutine odsnxtime ( ODSFile, nymd, nhms ) ! 15Apr2004 - Todling - Added prologue; added support for diag_conv ! 20Dec2004 - Dee - Support for diag_sat ! 03Mar2005 - Dee - Fixed a bug introduced with 20Dec2004 revision +! 15Apr2019 - Sienkiewicz - modify check for binary diag, add netcdf4 diag ! !EOP !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -47,6 +48,7 @@ subroutine odsnxtime ( ODSFile, nymd, nhms ) integer latest_jday, latest_hour, latest_jhour integer latest_nymd, latest_nhms integer jday, jhour, jhour2 + integer status, ncid, nymdhh save jhour data jhour / -1 / logical diff_file @@ -65,6 +67,39 @@ subroutine odsnxtime ( ODSFile, nymd, nhms ) ! --------------------- if ( nymd .ne. -1 ) return +! try opening as NetCDF (for nc4-diag or ODS) +! ------------------------------------------- + status = nf90_open(path=trim(ODSFile), mode = nf90_nowrite, ncid = ncid ) + + if (status /= nf90_noerr) then ! not a netCDF file - treat as diag_bin + call ods_dcscan ( .true., ODSFile, idate, mobs, conv, satype, ierr ) + if(ierr==0)then + nymd = idate / 100 + nhms = 10000 * (idate - 100 * nymd) + return + else + write(stderr,'(4a,i5)') myname_, + . ': Cannot open file ', trim(ODSFile), + . ' error code: ',ierr + return + end if + else +! +! determine if nc4/hdf file is nc4-diag by checking for date_time metadata +! ------------------------------------------------------------------------ + status = nf90_inquire_attribute(ncid,NF90_GLOBAL,'date_time') + if ( status == nf90_noerr ) then +! +! treat as nc4-diag file, otherwise continue to ODS processing + status = nf90_get_att(ncid,NF90_GLOBAL,'date_time',nymdhh) + nhms = mod(nymdhh,100)*10000 + nymd = int(nymdhh/100) + status = nf90_close(ncid) + return + end if + status = nf90_close(ncid) ! ODS file, continue processing + end if + ! open the ODS file: ! ----------------- call ODS_Open ( id, ODSFile, 'r', ierr ) diff --git a/GMAO_ods/odsstats.f b/GMAO_ods/odsstats.f index dc570b78..0ff3d9ab 100644 --- a/GMAO_ods/odsstats.f +++ b/GMAO_ods/odsstats.f @@ -37,7 +37,8 @@ program odsstats ! 24Feb2014 Todling Revisit Write_AccumStats (now to file and/or screen) ! 05Aug2014 Todling - Replace oma * xvec w/ amo * xvec (more meaningful) ! - Ability to write out R-scaling factors based on amo*xvec -! 11Dec1018 Todling Add DFS as in Lupu et al. 2011; eq. (10) - see also odsmatch +! 11Dec2018 Todling Add DFS as in Lupu et al. 2011; eq. (10) - see also odsmatch +! 18Dec2020 Todling Add ncf opt to allow running from diag-bin files ! !EOP !BOC @@ -56,9 +57,11 @@ program odsstats ! Local variables ! --------------- + logical :: log_transf = .false. integer nfiles, ifile, lf, isyn, ksyn, nymd, nhms, nkt, nkx, nlv, ncfound integer i, j, ic, nc, nt, ierr, nobs, nsel, synhour, nop, nops integer nymdb, nhmsb + logical aodsigofix character(len=255) :: opers(nomax) ! operations character(len=255) :: oclass(ncmax) ! observations classes @@ -84,10 +87,12 @@ program odsstats integer :: accum_obsneg(ncmax) ! accumulated number of obs with neg attribute integer :: accum_obsneu(ncmax) ! accumulated number of obs with neutral attribute + integer,allocatable:: igood(:) + character*255 infile (NFILES_MAX) ! input filenames character*255 fileout, outfile, outodsfn ! output filename character*80 ftype - logical anotherclass, allkxs, allevs, lstdv + logical anotherclass, allkxs, allevs, lrms, ncf ! storage for ODS: ! --------------- @@ -102,12 +107,12 @@ program odsstats kxtype = 0 kttype = 0 levlst = -1.0 - lstdv = .false. + lrms = .false. ! Parse in command line ! --------------------- call init ( infile, nfiles_max, nfiles, RCfile, outfile, trange, - . latrange, lonrange, verb ) + . latrange, lonrange, verb, aodsigofix, ncf ) ! Read in resource file ! --------------------- @@ -133,6 +138,7 @@ program odsstats obsgms = 0.0 nymdb = -1 nhmsb = -1 + if(ncf) ksyn = 1 ! Loop over input files ! --------------------- @@ -155,7 +161,7 @@ program odsstats if(verb) print *, 'calling ODS_Get' - call ODS_Get ( trim(infile(ifile)), nymd, nhms, ftype, ods, ierr ) + call ODS_Get ( trim(infile(ifile)), nymd, nhms, ftype, ods, ierr, ncf=ncf ) if(verb) print *, 'completed ODS_Get' @@ -194,6 +200,10 @@ program odsstats print *, 'time = ', nhms endif +! A little "QC" to avoid including outliers in stats +! -------------------------------------------------- + if(aodsigofix .and. trim(obvar) == 'dfs' .or. trim(obvar) == 'imp0hr') call aodfix_sigo (ods,log_transf) + ! Loop over observation classes ! ----------------------------- do nc = 1, ncfound @@ -232,18 +242,33 @@ program odsstats . lon_range=lonrange ) endif +! A little "QC" to avoid including outliers in stats +! -------------------------------------------------- + allocate(igood(nsel)) + do i = 1,nsel + igood(i) = i + enddo +! igood = ((/i/),i=1,nsel) + if (.not. ncf) then + if(trim(obvar)/='xvec') call no_outliers (odss,nsel,log_transf,igood) ! sigo must be available in this case + endif + obsnum(nc,nt) = nsel nymda(nt) = nymd nhmsa(nt) = nhms do nop = 1, nops - if(opers(nop)=='sum') call sumattr ( verb, odss, nsel, obvar, obssum(nc,nt) ) - if(opers(nop)=='numneg') call negattr ( verb, odss, nsel, obvar, negsum(nc,nt) ) - if(opers(nop)=='numneu') call neuattr ( verb, odss, nsel, obvar, neusum(nc,nt) ) - if(opers(nop)=='stdev') then - call gmsattr ( verb, odss, nsel, obvar, obsgms(nc,nt) ) - lstdv = .true. + if(opers(nop)=='sum') call sumattr ( verb, odss, nsel, igood, obvar, obssum(nc,nt) ) + if(opers(nop)=='numneg') call negattr ( verb, odss, nsel, igood, obvar, negsum(nc,nt) ) + if(opers(nop)=='numneu') call neuattr ( verb, odss, nsel, igood, obvar, neusum(nc,nt) ) + if(opers(nop)=='rms') then + call gmsattr ( verb, odss, nsel, 1, igood, obvar, obsgms(nc,nt) ) + lrms = .true. + endif + if(opers(nop)=='stddev') then + call gmsattr ( verb, odss, nsel, 2, igood, obvar, obsgms(nc,nt) ) endif enddo + deallocate(igood) ! Accumulate obs counts and impacts ! --------------------------------- @@ -275,7 +300,7 @@ program odsstats if(opers(nop)=='numneg') then ptr => negsum endif - if(opers(nop)=='stdev') then + if(opers(nop)=='rms') then ptr => obsgms endif fileout = trim(outfile) // '_' // trim(opers(nop)) // '.txt' @@ -302,7 +327,7 @@ program odsstats ! ------------------------------ fileout = trim(outfile) // '_' // 'all.txt' call Write_AccumStats ( fileout, accum_obssum, accum_obsgms, accum_obsnum, accum_obsneg, - . accum_obsneu, oclass, ncfound, ncmax, nymdb, nhmsb, lstdv, verb, ierr ) + . accum_obsneu, oclass, ncfound, ncmax, nymdb, nhmsb, lrms, verb, ierr ) CONTAINS @@ -620,188 +645,293 @@ end subroutine rcount_this_ end program odsstats ! program odsstats - subroutine sumattr ( verb, ods, nobs, attr, sum ) + subroutine no_outliers ( ods, nobs, log_transf, igood ) + + use m_odsmeta, only: X_TOO_HIGH + use m_ods + implicit none + integer, intent(inout) :: nobs + logical, intent(in) :: log_transf + integer, intent(inout) :: igood(nobs) + type(ods_vect) ods + real, parameter :: sigtol = 4.0 + real, parameter :: aodsigtol = 3.0 + real :: diag, mean, rms, stddev + integer i,ii, ngood + + if(nobs==0) return + + mean = 0.0; rms = 0.0; ngood = 0 +! if ( trim(attr) == 'dfs' ) then ! calculate DFS [h(xa)-h(xb)]*oma/R + do i=1,nobs + diag=((ods%data%omf(i)-ods%data%oma(i))*ods%data%oma(i))/(ods%data%xvec(i))**2 + mean=mean+diag + rms = rms+diag*diag + enddo +! endif +! do ii = 1,nobs +! mean = mean + ods%data%omf(ii) +! rms = rms + ods%data%omf(ii)*ods%data%omf(ii) +! enddo + mean = mean / nobs + rms = rms / nobs + stddev = sqrt(nobs*(abs(rms - mean*mean))/(nobs-1)) + + ngood = 0 + igood = 0 + do ii=1,nobs + diag=((ods%data%omf(ii)-ods%data%oma(ii))*ods%data%oma(ii))/(ods%data%xvec(ii))**2 + if (ods%data%kt(ii) == 43) then + if( ods%data%qcexcl(ii)==0 .and. +! . (abs(ods%data%omf(ii))>aodsigtol*ods%data%xvec(ii) .or. +! . abs(ods%data%oma(ii))>aodsigtol*ods%data%xvec(ii)) ) then +! . (abs(ods%data%omf(ii))>aodsigtol*stddev .or. +! . abs(ods%data%oma(ii))>aodsigtol*stddev) ) then + . abs(diag)>aodsigtol ) then + ods%data%qcexcl(ii) = X_TOO_HIGH + else + ngood=ngood+1 + igood(ngood) = ii + endif + else + if( ods%data%qcexcl(ii)==0 .and. +! . (abs(ods%data%omf(ii))>sigtol*ods%data%xvec(ii) .or. +! . abs(ods%data%oma(ii))>sigtol*ods%data%xvec(ii)) ) then +! . (abs(ods%data%omf(ii))>sigtol*stddev .or. +! . abs(ods%data%oma(ii))>sigtol*stddev) ) then + . abs(diag)>sigtol ) then + ods%data%qcexcl(ii) = X_TOO_HIGH + else + ngood=ngood+1 + igood(ngood) = ii + endif + endif + enddo + if(ngood0 - do i=1,nobs + do ii=1,nobs + i=igood(ii) imp = (ods%data%omf(i)-ods%data%oma(i))*ods%data%oma(i) - imp = imp/ods%data%xvec(i)*2 - if(impeps) rsum=rsum+1.0 enddo endif if ( trim(attr) == 'imp0hrxm' ) then do i=1,nobs imp = (ods%data%oma(i))**2 - . (ods%data%omf(i))**2 - imp = imp/ods%data%xm(i)*2 - if(imp1) rsum = sqrt(rsum/(nobs-1.0)) + endif end subroutine gmsattr subroutine Write_Stats ( outfile, obssum, obsnum, oclass, ncfound, ncmax, nt, nymd, nhms, verb, stat ) @@ -1083,7 +1270,7 @@ subroutine Write_gsiRfactor ( RCfile, outfile, obssum, oclass, ncfound, ncmax, n end subroutine Write_gsiRfactor - subroutine Write_AccumStats ( fname, obssum, obsgms, obsnum, obsneg, obsneu, oclass, ncfound, ncmax, nymd, nhms, lstdev, + subroutine Write_AccumStats ( fname, obssum, obsgms, obsnum, obsneg, obsneu, oclass, ncfound, ncmax, nymd, nhms, lrms, . verb, stat ) use m_ioutil, only : luavail implicit none @@ -1096,7 +1283,7 @@ subroutine Write_AccumStats ( fname, obssum, obsgms, obsnum, obsneg, obsneu, ocl integer, intent(in) :: obsneg(ncmax) integer, intent(in) :: obsneu(ncmax) integer, intent(in) :: nymd, nhms - logical, intent(in) :: lstdev + logical, intent(in) :: lrms logical, intent(in) :: verb integer, intent(out) :: stat @@ -1114,28 +1301,23 @@ subroutine Write_AccumStats ( fname, obssum, obsgms, obsnum, obsneg, obsneu, ocl ! Write out accumulated results ! ----------------------------- - if (lstdev) then + if (lrms) then do ll=1,nu - write(lu(ll),'(44x,4a)') '#obs ', ' sum ', ' numneg ', ' numneu ', ' stdev' + write(lu(ll),'(a,1p,e11.4,25x,5a)') '#Total: ', sum(obssum), ' obs ', ' sum ', + . ' numneg ', ' numneu ', ' rms' enddo do i = 1, ncfound ! loop ob classes - xstdv = 0.0 n = obsnum(i) - if (n>1) then - xmean = obssum(i)/n - rmean = obsgms(i)/n - tmp = abs(rmean-xmean**2) - xstdv = sqrt(n*tmp/(n-1)) - endif ! intentionally truncate oclass to 20 chars do ll=1,nu write(lu(ll),'(i8.8,1x,i6.6,1x,a20,1x,i11,1x,1p,e11.4,1x,i11,1x,i11,1x,1p,e11.4)') nymd, nhms, - . oclass(i), obsnum(i), obssum(i), obsneg(i), obsneu(i), xstdv + . oclass(i), obsnum(i), obssum(i), obsneg(i), obsneu(i), obsgms(i) enddo enddo else do ll=1,nu - write(lu(ll),'(44x,4a)') '#obs ', ' sum_impact ', ' numneg ', ' numneu ' + write(lu(ll),'(a,1p,e11.4,25x,4a)') '#Total: ', sum(obssum), ' obs ', ' sum_impact ', + . ' numneg ', ' numneu ' do i = 1, ncfound ! loop ob classes ! intentionally truncate oclass to 20 chars write(lu(ll),'(i8.8,1x,i6.6,1x,a20,1x,i11,1x,1p,e11.4,1x,i11,1x,i11)') @@ -1160,7 +1342,7 @@ end subroutine Write_AccumStats ! !INTERFACE: ! subroutine init ( infile, nfiles_max, nfiles, RCfile, outfile, - . trange, latrange, lonrange, verb ) + . trange, latrange, lonrange, verb, aodsigofix, ncf ) ! !USES: @@ -1179,6 +1361,8 @@ subroutine init ( infile, nfiles_max, nfiles, RCfile, outfile, real, intent(out) :: latrange(2) real, intent(out) :: lonrange(2) logical, intent(out) :: verb + logical, intent(out) :: aodsigofix + logical, intent(out) :: ncf ! ! ! !REVISION HISTORY: @@ -1202,6 +1386,8 @@ subroutine init ( infile, nfiles_max, nfiles, RCfile, outfile, latrange = (/-90.,+90./) ! Default: includes obs in all latitude ranges lonrange = (/-180.,+180./) ! Default: includes obs in all longitude ranges verb = .false. + aodsigofix = .false. + ncf = .false. ! Parse command line ! ------------------ @@ -1220,6 +1406,10 @@ subroutine init ( infile, nfiles_max, nfiles, RCfile, outfile, call GetArg ( iArg, outfile ) else if (index(argv,'-verbose' ) .gt. 0 ) then verb = .true. + else if (index(argv,'-ncf' ) .gt. 0 ) then + ncf = .true. + else if (index(argv,'-aodsigofix' ) .gt. 0 ) then + aodsigofix = .true. else if (index(argv,'-rc' ) .gt. 0 ) then if ( iarg+1 .gt. argc ) call usage() iarg = iarg + 1 @@ -1318,6 +1508,7 @@ subroutine usage() print * print *,'-o ID use ID for naming output files' print *,' (default: obsstat.txt)' + print *,'-aodsigofix wire sigO for AOD residuals (see Notes)' print *,'-verbose sets verbose on (default: off)' print *,'-rc RCfile resource file' print *,' (default: obsstat.rc)' @@ -1338,6 +1529,7 @@ subroutine usage() print * print *, ' 1. Known OBS*Operations: (default: sum)' print *, ' sum - sum all variables ' + print *, ' rms - root mean square ' print *, ' stddev - stdandard deviation from mean of variables ' print *, ' numneg - sum all non-negative variables ' print * @@ -1345,6 +1537,11 @@ subroutine usage() print *, ' obs,omf,oma,xm,xvec,xvecxomf,xvecxamo ' print *, ' 2a. xvecxomf,xvecxamo are only meaningful when xvec holds ' print *, ' the sensitivities instead of the impacts.' + print * + print *, ' 3. Earlier versions of the DAS did not fill in the xvec(sigO) slot' + print *, ' from AOD ODS files. This knob allows for calculation of DFS and ' + print *, ' IMP0HR to take place by having the present code wired the typical' + print *, ' (constant) value used in PSAS.' print * stop end diff --git a/GMAO_ods/ozone-kx.readme b/GMAO_ods/ozone-kx.readme index c2dd9ff6..1a4f5ef8 100644 --- a/GMAO_ods/ozone-kx.readme +++ b/GMAO_ods/ozone-kx.readme @@ -6,6 +6,7 @@ # # dtype dplat* isat kx + ompsnm npp 427 tomseff - 0 440 tomseff nim07 1 441 tomseff ep 2 442 @@ -37,6 +38,8 @@ mls30* - 0 325 mls55 - 0 330 mls55 aura 0 330 + ompslp npp 0 335 + ompsnp npp 0 437 # Notes for (*): # diff --git a/GMAO_ods/radiance-kx.readme b/GMAO_ods/radiance-kx.readme index a9c96115..50c4d47f 100644 --- a/GMAO_ods/radiance-kx.readme +++ b/GMAO_ods/radiance-kx.readme @@ -1,4 +1,5 @@ ! Radiance KX 04/20/15 - added tmi_trmm and gmi_gpm KX +! 02/23/18 - added n20, n21 cris, cris-fsr, atms ! ! radiance kx values are assigned using the sum of the value for dtype ! from the sats/idsats lookup table in 'odsmeta.h' and the isat value @@ -24,7 +25,7 @@ hirs4 n19 hirs4_n19 19 19 hirs4 metop-a hirs4_metop-a 25 25 hirs4 metop-b hirs4_metop-b 26 26 - airs aqua airs281_aqua 0 49 + airs aqua airs_aqua 0 49 sndr g08_prep sndr_g08 8 53 sndr g10_prep sndr_g10 10 55 sndr g11_prep sndr_g11 11 56 @@ -71,6 +72,7 @@ amsua n19 amsua_n19 19 319 amsua metop-a amsua_metop-a 25 325 amsua metop-b amsua_metop-b 26 326 + amsua metop-c amsua_metop-c 27 327 ssu tirosn ssu_tirosn 5 355 ssu n06 ssu_n06 6 356 ssu n07 ssu_n07 7 357 @@ -85,6 +87,9 @@ amsre_low aqua amsre_aqua(low) 0 547 amsre_mid aqua amsre_aqua(mid) 0 548 amsre_hig aqua amsre_aqua(hi) 0 549 + amsr2 gcom-w1 amsr2_gcom-w1 0 550 + avhrr n15 avhrr3_n15 15 615 + avhrr n17 avhrr3_n17 17 617 avhrr n18 avhrr3_n18 18 618 avhrr n19 avhrr3_n19 19 619 avhrr metop-a avhrr3_metop-a 25 625 @@ -106,18 +111,30 @@ mhs n19 mhs_n19 19 819 mhs metop-a mhs_metop-a 25 825 mhs metop-b mhs_metop-b 26 826 - iasi metop-a iasi616_metop-a 25 875 - iasi metop-b iasi616_metop-b 26 876 + mhs metop-c mhs_metop-c 27 827 + iasi metop-a iasi_metop-a 25 875 + iasi metop-b iasi_metop-b 26 876 + iasi metop-c iasi_metop-c 27 877 atms npp atms_npp 0 900 + atms n20 atms_n20 20 920 + atms n21 atms_n21 21 921 + cris-fsr npp cris-fsr_npp 0 940 cris npp cris_npp 0 950 + cris-fsr n20 cris-fsr_n20 20 960 + cris-fsr n21 cris-fsr_n21 21 961 + cris n20 cris_n20 20 970 + cris n21 cris_n21 21 971 seviri m08 seviri_m08 8 988 seviri m09 seviri_m09 9 989 seviri m10 seviri_m10 10 990 + seviri m11 seviri_m11 11 991 ! ! ! Note: hsb_aqua, amsre_aqua, imgr_* not really being used ! avhrr* could be expanded for n06-n17, not sure about sats for avhrr_navy ! so that type is not listed, would be avhrr+50 so possibly 656-676 +! +! cris_n20, cris_n21 would be designators for remapped CrIS in MERRA2 ! Precipitation KX - determined as delta from GSI assigned values (211,264) ! add base value (tmi->211, ssmi->264) and isat to get the KX diff --git a/GMAO_perllib/GrADS/Grads.pm b/GMAO_perllib/GrADS/Grads.pm index 17055daf..7935237f 100755 --- a/GMAO_perllib/GrADS/Grads.pm +++ b/GMAO_perllib/GrADS/Grads.pm @@ -104,8 +104,9 @@ sub new { # Constructor # Complement argv with env variables # ---------------------------------- - for my $att qw ( Bin Echo Verb Port Window Opts - TransferFile expTransferFile impTransferFile ) { + + my @temparray = qw ( Bin Echo Verb Port Window Opts TransferFile expTransferFile impTransferFile ); + foreach my $att (@temparray) { my $evar = "GA_" . uc $att; # print qq(env var = $evar = <$ENV{$evar}>\n); $argv->{$att} = "$ENV{$evar}" @@ -272,7 +273,8 @@ sub Open { # generic file opener my $opener = "open"; if ( $FTYPE eq "DEFAULT" ) { $_ = uc $fname; - $opener = "sdfopen" if ( ?^HTTP\://? || /\.HDF$/ || /\.NC.*$/ ); +# $opener = "sdfopen" if ( ?^HTTP\://? || /\.HDF$/ || /\.NC.*$/ ); + $opener = "sdfopen" if ( /^HTTP\:\/\// || /\.HDF$/ || /\.NC.*$/ ); $opener = "xdfopen" if ( /\.DDF$/ ); } elsif ( "$FTYPE" eq "SDF" ) { diff --git a/GMAO_psas/m_GetAI.F90 b/GMAO_psas/m_GetAI.F90 index efaf26fc..a8773c25 100644 --- a/GMAO_psas/m_GetAI.F90 +++ b/GMAO_psas/m_GetAI.F90 @@ -389,7 +389,7 @@ Subroutine GetAI_External(ninc, ainc, alat, alon, alev, akts, & mpirun = ' ' call getenv('MPIRUN',mpirun) ! Unix binding - if(mpirun.eq.' ') Call die(myname_,'env var MPIRUN not set', 99) + !if(mpirun.eq.' ') Call die(myname_,'env var MPIRUN not set', 99) ! Invoke 'solve.x' ! ---------------- diff --git a/GMAO_psas/m_psas.F90 b/GMAO_psas/m_psas.F90 index 55f8bb93..aaef731b 100644 --- a/GMAO_psas/m_psas.F90 +++ b/GMAO_psas/m_psas.F90 @@ -49,7 +49,7 @@ module m_psas ! !INTERFACE: ! subroutine psas_init(I_AM_ROOT, comm, topology) - Use m_mpif90, only : MP_COMM_WORLD, MP_INIT, MP_COMM_RANK + Use m_mpif90, only : MP_COMM_WORLD, MP_INIT, MP_COMM_RANK, MP_initialized Use m_die, only : die, mp_die Integer, Optional, Intent(Out) :: I_AM_ROOT Integer, Optional, Intent(Out) :: comm @@ -71,12 +71,16 @@ subroutine psas_init(I_AM_ROOT, comm, topology) Integer :: rank Integer :: ier Integer :: topology_ + Logical :: init_mpi ! Initialize MPI - must be done first ! ----------------------------------- - Call MP_INIT(ier) - if ( ier /= 0) call mp_die ( myname_, 'MP_INIT()',ier) + call MP_initialized (init_mpi,ier) + if (.not.init_mpi) then + Call MP_INIT(ier) + if ( ier /= 0) call mp_die ( myname_, 'MP_INIT()',ier) + endif Call MP_COMM_RANK(MP_COMM_WORLD, rank, ier) if ( ier /= 0) call mp_die ( myname_, 'MP_COMM_RANK()',ier) If (Present(comm)) comm = MP_COMM_WORLD diff --git a/GMAO_pyobs/CMakeLists.txt b/GMAO_pyobs/CMakeLists.txt index 61052189..c75e17c1 100644 --- a/GMAO_pyobs/CMakeLists.txt +++ b/GMAO_pyobs/CMakeLists.txt @@ -10,23 +10,26 @@ esma_add_library (${this} DEPENDENCIES GMAO_gfio_r4 INCLUDES ${INC_ESMF}) -include(UseF2Py) +if (USE_F2PY) + find_package(F2PY2) + if (F2PY2_FOUND) + esma_add_f2py2_module(binObs_ + SOURCES binObs_py.F + DESTINATION lib/Python/pyobs + INCLUDEDIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/lib ${include_${this}} + ) + add_dependencies(binObs_ ${this}) -add_f2py_module(binObs_ - SOURCES binObs_py.F - DESTINATION lib/Python/pyobs - INCLUDEDIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/lib ${include_${this}} - ) -add_dependencies(binObs_ ${this}) + esma_add_f2py2_module(IGBP_ + SOURCES IGBP_py.F90 + DESTINATION lib/Python/pyobs + ONLY getsimpleveg getdetailedveg + LIBRARIES GMAO_pyobs + INCLUDEDIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/lib ${include_${this}} + ) + add_dependencies(IGBP_ ${this}) + endif () +endif () -add_f2py_module(IGBP_ - SOURCES IGBP_py.F90 - DESTINATION lib/Python/pyobs - ONLY getsimpleveg getdetailedveg - LIBRARIES GMAO_pyobs - INCLUDEDIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/lib ${include_${this}} - ) -add_dependencies(IGBP_ ${this}) - -file (GLOB python_files pyobs/*.py) +file (GLOB python_files CONFIGURE_DEPENDS pyobs/*.py) install (FILES ${python_files} DESTINATION lib/Python/pyobs) diff --git a/GMAO_stoch/CMakeLists.txt b/GMAO_stoch/CMakeLists.txt index 0644e315..2749fc67 100644 --- a/GMAO_stoch/CMakeLists.txt +++ b/GMAO_stoch/CMakeLists.txt @@ -56,5 +56,8 @@ foreach (flag ${flags}) target_compile_options (${this} PRIVATE $<$:${flag}>) endforeach () -set (CMAKE_Fortran_FLAGS_RELEASE "-O1 ${BIG_ENDIAN} ${common_Fortran_flags} ${EXTENDED_SOURCE} ${TRACEBACK} ${ALIGNCOM}") +set (CMAKE_Fortran_FLAGS_RELEASE "-O1 ${BIG_ENDIAN} ${common_Fortran_flags} ${TRACEBACK} ${ALIGNCOM}") +if (EXTENDED_SOURCE) + set_target_properties (${this} PROPERTIES COMPILE_FLAGS ${EXTENDED_SOURCE}) +endif () diff --git a/GMAO_stoch/mod_four.F90 b/GMAO_stoch/mod_four.F90 index 640304a0..6d0b8528 100644 --- a/GMAO_stoch/mod_four.F90 +++ b/GMAO_stoch/mod_four.F90 @@ -194,11 +194,11 @@ subroutine four2fln_gg(workdim,nvarsdim,nvars,four_gr, & indev2 = indlsev(jcap ,l) indod2 = indlsod(jcap+1,l) endif -!$omp parallel do shared(fm,fp,workr,ipt_wr) -!$omp+shared(plnev,plnod,flnev,flnod) -!$omp+shared(indev1,indev2,indod1,indod2,jbasev,jbasod) -!$omp+shared(j,l,lat1,nvar_thread_max) -!$omp+private(thread,k,lat,nvar_1,nvar_2,ip1,ip2,ip3,ip4) +!$omp parallel do shared(fm,fp,workr,ipt_wr) & +!$omp shared(plnev,plnod,flnev,flnod) & +!$omp shared(indev1,indev2,indod1,indod2,jbasev,jbasod) & +!$omp shared(j,l,lat1,nvar_thread_max) & +!$omp private(thread,k,lat,nvar_1,nvar_2,ip1,ip2,ip3,ip4) ! do thread=1,num_threads ! start of thread loop .............. nvar_1 = (thread-1)*nvar_thread_max+1 @@ -317,11 +317,11 @@ subroutine four_to_grid(syn_gr_a_1,syn_gr_a_2,lon_dim_coef, & if ( kind_evod .eq. 8 ) then !------------------------------------ -!$omp parallel do shared(syn_gr_a_1,syn_gr_a_2,lons_lat) -!$omp+shared(lon_dim_coef,lon_dim_grid) -!$omp+shared(lot,num_threads,nvar_thread_max) -!$omp+shared(ibmsign,scale_ibm) -!$omp+private(thread,nvar_1,nvar_2,lot_thread,init,aux1crs) +!$omp parallel do shared(syn_gr_a_1,syn_gr_a_2,lons_lat) & +!$omp shared(lon_dim_coef,lon_dim_grid) & +!$omp shared(lot,num_threads,nvar_thread_max) & +!$omp shared(ibmsign,scale_ibm) & +!$omp private(thread,nvar_1,nvar_2,lot_thread,init,aux1crs) do thread=1,num_threads ! start of thread loop .............. nvar_1=(thread-1)*nvar_thread_max+1 @@ -347,11 +347,11 @@ subroutine four_to_grid(syn_gr_a_1,syn_gr_a_2,lon_dim_coef, & enddo ! fin thread loop ...................................... else !------------------------------------------------------------ -!$omp parallel do shared(syn_gr_a_1,syn_gr_a_2,lons_lat) -!$omp+shared(lon_dim_coef,lon_dim_grid) -!$omp+shared(lot,num_threads,nvar_thread_max) -!$omp+shared(ibmsign,scale_ibm) -!$omp+private(thread,nvar_1,nvar_2,lot_thread,init,aux1crs) +!$omp parallel do shared(syn_gr_a_1,syn_gr_a_2,lons_lat) & +!$omp shared(lon_dim_coef,lon_dim_grid) & +!$omp shared(lot,num_threads,nvar_thread_max) & +!$omp shared(ibmsign,scale_ibm) & +!$omp private(thread,nvar_1,nvar_2,lot_thread,init,aux1crs) do thread=1,num_threads ! start of thread loop .............. nvar_1=(thread-1)*nvar_thread_max+1 @@ -414,11 +414,11 @@ subroutine grid_to_four(anl_gr_a_2,anl_gr_a_1,lon_dim_grid,lon_dim_coef,lons_lat nvar_thread_max=(lot+num_threads-1)/num_threads if ( kind_evod .eq. 8 ) then !------------------------------------ -!$omp parallel do shared(anl_gr_a_1,anl_gr_a_2,lons_lat) -!$omp+shared(lon_dim_coef,lon_dim_grid) -!$omp+shared(lot,num_threads,nvar_thread_max) -!$omp+shared(ibmsign,scale_ibm,rone) -!$omp+private(thread,nvar_1,nvar_2,lot_thread,init,aux1crs) +!$omp parallel do shared(anl_gr_a_1,anl_gr_a_2,lons_lat) & +!$omp shared(lon_dim_coef,lon_dim_grid) & +!$omp shared(lot,num_threads,nvar_thread_max) & +!$omp shared(ibmsign,scale_ibm,rone) & +!$omp private(thread,nvar_1,nvar_2,lot_thread,init,aux1crs) do thread=1,num_threads ! start of thread loop .............. nvar_1=(thread-1)*nvar_thread_max+1 @@ -444,11 +444,11 @@ subroutine grid_to_four(anl_gr_a_2,anl_gr_a_1,lon_dim_grid,lon_dim_coef,lons_lat enddo ! fin thread loop ...................................... else !------------------------------------------------------------ -!$omp parallel do shared(anl_gr_a_1,anl_gr_a_2,lons_lat) -!$omp+shared(lon_dim_coef,lon_dim_grid) -!$omp+shared(lot,num_threads,nvar_thread_max) -!$omp+shared(ibmsign,scale_ibm,rone) -!$omp+private(thread,nvar_1,nvar_2,lot_thread,init,aux1crs) +!$omp parallel do shared(anl_gr_a_1,anl_gr_a_2,lons_lat) & +!$omp shared(lon_dim_coef,lon_dim_grid) & +!$omp shared(lot,num_threads,nvar_thread_max) & +!$omp shared(ibmsign,scale_ibm,rone) & +!$omp private(thread,nvar_1,nvar_2,lot_thread,init,aux1crs) do thread=1,num_threads ! start of thread loop .............. nvar_1=(thread-1)*nvar_thread_max+1 diff --git a/GMAO_transf/CMakeLists.txt b/GMAO_transf/CMakeLists.txt index 7e4e1093..d12a6528 100644 --- a/GMAO_transf/CMakeLists.txt +++ b/GMAO_transf/CMakeLists.txt @@ -82,8 +82,8 @@ set (srcs gmap.F ) -set (CMAKE_Fortran_FLAGS_RELEASE "-O3 ${common_Fortran_flags} ${EXTENDED_SOURCE} ${ALIGNCOM} ${MISMATCH}") -set (CMAKE_Fortran_FLAGS_DEBUG "${GEOS_Fortran_FLAGS_DEBUG} ${EXTENDED_SOURCE}") +set (CMAKE_Fortran_FLAGS_RELEASE "-O3 ${common_Fortran_flags} ${ALIGNCOM} ${MISMATCH}") +set (CMAKE_Fortran_FLAGS_DEBUG "${GEOS_Fortran_FLAGS_DEBUG}") ecbuild_add_executable(TARGET dyn_divo.x SOURCES dyn_divo.F90 LIBS ${this} FFLAGS "${FREAL8}") ecbuild_add_executable(TARGET ec2fv.x SOURCES ec2fv.F90 LIBS ${this} FFLAGS "${FREAL8}") @@ -94,10 +94,13 @@ ecbuild_add_executable(TARGET ss2fv.x SOURCES ss2fv.f90 LIBS ${this} FFLAGS "${F install (PROGRAMS ec2fv.csh DESTINATION bin) #This needs to be worked on -ecbuild_add_executable(TARGET ss2gg.x SOURCES ss2gg.f90 LIBS NCEP_w3_r4i4 NCEP_sp_r4i4 NCEP_bacio_r4i4 NCEP_sigio) +ecbuild_add_executable(TARGET ss2gg.x SOURCES ss2gg.f90 LIBS NCEP_w3_r4i4 NCEP_sp_r4i4 NCEP_bufr_r4i4 NCEP_bacio_r4i4 NCEP_sigio) -esma_add_library(${this} SRCS ${srcs} DEPENDENCIES GMAO_mpeu NCEP_sp_r4i4 NCEP_w3_r8i4 NCEP_sfcio GMAO_hermes NCEP_sigio ${MKL_LIBRARIES}) +esma_add_library(${this} SRCS ${srcs} DEPENDENCIES GMAO_mpeu NCEP_sp_r4i4 NCEP_bufr_r4i4 NCEP_w3_r8i4 NCEP_sfcio GMAO_hermes NCEP_sigio ${MKL_LIBRARIES}) set_target_properties (${this} PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}}) +if (EXTENDED_SOURCE) + set_target_properties (${this} PROPERTIES COMPILE_FLAGS ${EXTENDED_SOURCE}) +endif () string (REPLACE " " ";" flags ${FREAL8}) foreach (flag ${flags}) diff --git a/GMAO_transf/g4tog5.f90 b/GMAO_transf/g4tog5.f90 index 2b7419af..a44b09c5 100644 --- a/GMAO_transf/g4tog5.f90 +++ b/GMAO_transf/g4tog5.f90 @@ -64,6 +64,8 @@ subroutine dyn_g4tog5 ( w_f ) use m_dyn use m_set_eta use m_remap, only: d2a => remap_d2a +! use m_const, only: o3_ppmv2gpg +! use m_const, only: grav implicit NONE @@ -86,10 +88,6 @@ subroutine dyn_g4tog5 ( w_f ) !------------------------------------------------------------------------- integer :: im, jm, km, lm,l, ks, km1 -! real, parameter :: kappa = 287.04/1004.64 ! r/cp -! real, parameter :: zvir = 0.61 ! rh2o/rair - 1. - real, parameter :: grav = 9.806 ! accel. of gravity - real, parameter :: ppmv2du = 1.657e-6 ! ppmv to Dobson units real, parameter :: kPa_per_Pa=.001 ! converts Pa to kPa real, allocatable :: tmpu(:,:,:) real, allocatable :: ak(:), bk(:) @@ -182,7 +180,7 @@ subroutine dyn_g4tog5 ( w_f ) ! w_f%ps = (w_f%ps/1000.0) ! ps to cb ! w_f%phis = w_f%phis/grav ! geopot to m -! w_f%q(:,:,:,2) = ppmv2du * w_f%q(:,:,:,2) ! ozone in D.U. +! w_f%q(:,:,:,2) = o3_ppmv2gpg * w_f%q(:,:,:,2) ! ozone in g/g deallocate(ua,va,coslon,sinlon) ! All done diff --git a/GMAO_transf/m_massadj.F90 b/GMAO_transf/m_massadj.F90 index 3f8a38ce..56b7c8d6 100644 --- a/GMAO_transf/m_massadj.F90 +++ b/GMAO_transf/m_massadj.F90 @@ -143,10 +143,6 @@ subroutine pre_ ( im, jm, km, nq, ak, bk, & real(r_kind) :: lambda(im,jm) real(r_kind) :: ps_corr, delp_min - real(r_kind) :: gmean_ - - - rc = 0 lm = min ( 2, nq ) ! Note: Needs 2 to properly replay GEOS-4.0.3 ! ana.eta files. However, in replay mode @@ -246,7 +242,6 @@ subroutine post_ ( im, jm, km, nq, gid, ptop, & real(r_kind) :: qmax, qmin, gps_a real(r_kind) :: lambda(im,jm) real(r_kind) :: ps_corr, delp_min - real(r_kind) :: gmean_ real(r_kind) :: delpmin_ rc = 0 diff --git a/GMAO_transf/m_xform.f90 b/GMAO_transf/m_xform.f90 index c159640c..ff5bb065 100644 --- a/GMAO_transf/m_xform.f90 +++ b/GMAO_transf/m_xform.f90 @@ -28,6 +28,8 @@ module m_xform use m_const, only : rvap use m_const, only : rgas use m_const, only : undef + use m_const, only : o3_ppmv2gpg + use m_const, only : o3_gpg2ppmv use m_dynp, only : dynp_add implicit none @@ -1158,7 +1160,7 @@ subroutine gg2ll ( ss, gg, im, jm, igrid, ll, docwmr, rc ) ll%o = dum end if ! at this point ll%o is in kg/kg, we need to convert to ppmv - ll%o = 0.6035e6 * ll%o + ll%o = o3_gpg2ppmv * ll%o ! Cloud-water fraction @@ -1333,7 +1335,7 @@ subroutine ll2gg ( fvgg, gg, rlon, rlat, nsig, glon, glat, docwmr, rot, rc ) gxg,lons,lats,SFL,ORD,FLG,undef) gg%o = dumg ! ozone from eta file is in ppmv. we need to convert to kg/kg - gg%o = 1.657e-6 * gg%o + gg%o = o3_ppmv2gpg * gg%o ! Cloud-water fraction diff --git a/LANL_Shared/LANL_cice/.cvsignore b/LANL_Shared/CICE4/.cvsignore similarity index 100% rename from LANL_Shared/LANL_cice/.cvsignore rename to LANL_Shared/CICE4/.cvsignore diff --git a/LANL_Shared/LANL_cice/CMakeLists.txt b/LANL_Shared/CICE4/CMakeLists.txt similarity index 81% rename from LANL_Shared/LANL_cice/CMakeLists.txt rename to LANL_Shared/CICE4/CMakeLists.txt index 513ce220..00f2908f 100644 --- a/LANL_Shared/LANL_cice/CMakeLists.txt +++ b/LANL_Shared/CICE4/CMakeLists.txt @@ -54,4 +54,11 @@ if (CMAKE_SYSTEM_NAME MATCHES Linux) target_compile_definitions(${this} PRIVATE LINUX) endif () +# It turns out the new vectorized Release flags for Intel cause a segfault +# in CICE4. For now, we workaround this by restoring the old non-vectorized +# flags here when building as Release +if (CMAKE_Fortran_COMPILER_ID MATCHES Intel AND CMAKE_BUILD_TYPE MATCHES Release) + set (CMAKE_Fortran_FLAGS_RELEASE "${GEOS_Fortran_FLAGS_NOVECT}") +endif () + ecbuild_add_executable(TARGET makdep SOURCES bld/makdep.c) diff --git a/LANL_Shared/LANL_cice/README_v4.0 b/LANL_Shared/CICE4/README_v4.0 similarity index 100% rename from LANL_Shared/LANL_cice/README_v4.0 rename to LANL_Shared/CICE4/README_v4.0 diff --git a/LANL_Shared/LANL_cice/bld/Macros.AIX.NCAR.bluevista b/LANL_Shared/CICE4/bld/Macros.AIX.NCAR.bluevista similarity index 100% rename from LANL_Shared/LANL_cice/bld/Macros.AIX.NCAR.bluevista rename to LANL_Shared/CICE4/bld/Macros.AIX.NCAR.bluevista diff --git a/LANL_Shared/LANL_cice/bld/Macros.Linux.LANL.coyote b/LANL_Shared/CICE4/bld/Macros.Linux.LANL.coyote similarity index 100% rename from LANL_Shared/LANL_cice/bld/Macros.Linux.LANL.coyote rename to LANL_Shared/CICE4/bld/Macros.Linux.LANL.coyote diff --git a/LANL_Shared/LANL_cice/bld/Macros.Linux.LLNL.atlas b/LANL_Shared/CICE4/bld/Macros.Linux.LLNL.atlas similarity index 100% rename from LANL_Shared/LANL_cice/bld/Macros.Linux.LLNL.atlas rename to LANL_Shared/CICE4/bld/Macros.Linux.LLNL.atlas diff --git a/LANL_Shared/LANL_cice/bld/Macros.Linux.NCAR.bangkok b/LANL_Shared/CICE4/bld/Macros.Linux.NCAR.bangkok similarity index 100% rename from LANL_Shared/LANL_cice/bld/Macros.Linux.NCAR.bangkok rename to LANL_Shared/CICE4/bld/Macros.Linux.NCAR.bangkok diff --git a/LANL_Shared/LANL_cice/bld/Macros.Linux.ORNL.jaguar b/LANL_Shared/CICE4/bld/Macros.Linux.ORNL.jaguar similarity index 100% rename from LANL_Shared/LANL_cice/bld/Macros.Linux.ORNL.jaguar rename to LANL_Shared/CICE4/bld/Macros.Linux.ORNL.jaguar diff --git a/LANL_Shared/LANL_cice/bld/Makefile b/LANL_Shared/CICE4/bld/Makefile similarity index 100% rename from LANL_Shared/LANL_cice/bld/Makefile rename to LANL_Shared/CICE4/bld/Makefile diff --git a/LANL_Shared/LANL_cice/bld/Makefile.UNICOS b/LANL_Shared/CICE4/bld/Makefile.UNICOS similarity index 100% rename from LANL_Shared/LANL_cice/bld/Makefile.UNICOS rename to LANL_Shared/CICE4/bld/Makefile.UNICOS diff --git a/LANL_Shared/LANL_cice/bld/Makefile.std b/LANL_Shared/CICE4/bld/Makefile.std similarity index 100% rename from LANL_Shared/LANL_cice/bld/Makefile.std rename to LANL_Shared/CICE4/bld/Makefile.std diff --git a/LANL_Shared/LANL_cice/bld/makdep.c b/LANL_Shared/CICE4/bld/makdep.c similarity index 100% rename from LANL_Shared/LANL_cice/bld/makdep.c rename to LANL_Shared/CICE4/bld/makdep.c diff --git a/LANL_Shared/LANL_cice/cice/README_v4.0 b/LANL_Shared/CICE4/cice/README_v4.0 similarity index 100% rename from LANL_Shared/LANL_cice/cice/README_v4.0 rename to LANL_Shared/CICE4/cice/README_v4.0 diff --git a/LANL_Shared/LANL_cice/cice/clean_ice b/LANL_Shared/CICE4/cice/clean_ice similarity index 100% rename from LANL_Shared/LANL_cice/cice/clean_ice rename to LANL_Shared/CICE4/cice/clean_ice diff --git a/LANL_Shared/LANL_cice/cice/comp_ice b/LANL_Shared/CICE4/cice/comp_ice similarity index 100% rename from LANL_Shared/LANL_cice/cice/comp_ice rename to LANL_Shared/CICE4/cice/comp_ice diff --git a/LANL_Shared/LANL_cice/cice/ice.log.Linux.LANL.coyote b/LANL_Shared/CICE4/cice/ice.log.Linux.LANL.coyote similarity index 100% rename from LANL_Shared/LANL_cice/cice/ice.log.Linux.LANL.coyote rename to LANL_Shared/CICE4/cice/ice.log.Linux.LANL.coyote diff --git a/LANL_Shared/LANL_cice/cicedoc.pdf b/LANL_Shared/CICE4/cicedoc.pdf similarity index 100% rename from LANL_Shared/LANL_cice/cicedoc.pdf rename to LANL_Shared/CICE4/cicedoc.pdf diff --git a/LANL_Shared/LANL_cice/clean_ice b/LANL_Shared/CICE4/clean_ice similarity index 100% rename from LANL_Shared/LANL_cice/clean_ice rename to LANL_Shared/CICE4/clean_ice diff --git a/LANL_Shared/LANL_cice/comp_ice b/LANL_Shared/CICE4/comp_ice similarity index 100% rename from LANL_Shared/LANL_cice/comp_ice rename to LANL_Shared/CICE4/comp_ice diff --git a/LANL_Shared/LANL_cice/csm_share/README b/LANL_Shared/CICE4/csm_share/README similarity index 100% rename from LANL_Shared/LANL_cice/csm_share/README rename to LANL_Shared/CICE4/csm_share/README diff --git a/LANL_Shared/LANL_cice/csm_share/shr_orb_mod.F90 b/LANL_Shared/CICE4/csm_share/shr_orb_mod.F90 similarity index 100% rename from LANL_Shared/LANL_cice/csm_share/shr_orb_mod.F90 rename to LANL_Shared/CICE4/csm_share/shr_orb_mod.F90 diff --git a/LANL_Shared/LANL_cice/doc/PDF/BL_JGR1999.pdf b/LANL_Shared/CICE4/doc/PDF/BL_JGR1999.pdf similarity index 100% rename from LANL_Shared/LANL_cice/doc/PDF/BL_JGR1999.pdf rename to LANL_Shared/CICE4/doc/PDF/BL_JGR1999.pdf diff --git a/LANL_Shared/LANL_cice/doc/PDF/BL_NCAR2007.pdf b/LANL_Shared/CICE4/doc/PDF/BL_NCAR2007.pdf similarity index 100% rename from LANL_Shared/LANL_cice/doc/PDF/BL_NCAR2007.pdf rename to LANL_Shared/CICE4/doc/PDF/BL_NCAR2007.pdf diff --git a/LANL_Shared/LANL_cice/doc/PDF/CGHM_JPO2004.pdf b/LANL_Shared/CICE4/doc/PDF/CGHM_JPO2004.pdf similarity index 100% rename from LANL_Shared/LANL_cice/doc/PDF/CGHM_JPO2004.pdf rename to LANL_Shared/CICE4/doc/PDF/CGHM_JPO2004.pdf diff --git a/LANL_Shared/LANL_cice/doc/PDF/DB_JCP2000.pdf b/LANL_Shared/CICE4/doc/PDF/DB_JCP2000.pdf similarity index 100% rename from LANL_Shared/LANL_cice/doc/PDF/DB_JCP2000.pdf rename to LANL_Shared/CICE4/doc/PDF/DB_JCP2000.pdf diff --git a/LANL_Shared/LANL_cice/doc/PDF/HD_JPO1997.pdf b/LANL_Shared/CICE4/doc/PDF/HD_JPO1997.pdf similarity index 100% rename from LANL_Shared/LANL_cice/doc/PDF/HD_JPO1997.pdf rename to LANL_Shared/CICE4/doc/PDF/HD_JPO1997.pdf diff --git a/LANL_Shared/LANL_cice/doc/PDF/HD_MWR2002.pdf b/LANL_Shared/CICE4/doc/PDF/HD_MWR2002.pdf similarity index 100% rename from LANL_Shared/LANL_cice/doc/PDF/HD_MWR2002.pdf rename to LANL_Shared/CICE4/doc/PDF/HD_MWR2002.pdf diff --git a/LANL_Shared/LANL_cice/doc/PDF/HZ_MWR1999.pdf b/LANL_Shared/CICE4/doc/PDF/HZ_MWR1999.pdf similarity index 100% rename from LANL_Shared/LANL_cice/doc/PDF/HZ_MWR1999.pdf rename to LANL_Shared/CICE4/doc/PDF/HZ_MWR1999.pdf diff --git a/LANL_Shared/LANL_cice/doc/PDF/Hunke_JCP2001.pdf b/LANL_Shared/CICE4/doc/PDF/Hunke_JCP2001.pdf similarity index 100% rename from LANL_Shared/LANL_cice/doc/PDF/Hunke_JCP2001.pdf rename to LANL_Shared/CICE4/doc/PDF/Hunke_JCP2001.pdf diff --git a/LANL_Shared/LANL_cice/doc/PDF/LAUR-03-2219.pdf b/LANL_Shared/CICE4/doc/PDF/LAUR-03-2219.pdf similarity index 100% rename from LANL_Shared/LANL_cice/doc/PDF/LAUR-03-2219.pdf rename to LANL_Shared/CICE4/doc/PDF/LAUR-03-2219.pdf diff --git a/LANL_Shared/LANL_cice/doc/PDF/LHMJ_JGR07.pdf b/LANL_Shared/CICE4/doc/PDF/LHMJ_JGR07.pdf similarity index 100% rename from LANL_Shared/LANL_cice/doc/PDF/LHMJ_JGR07.pdf rename to LANL_Shared/CICE4/doc/PDF/LHMJ_JGR07.pdf diff --git a/LANL_Shared/LANL_cice/doc/PDF/LH_MWR2004.pdf b/LANL_Shared/CICE4/doc/PDF/LH_MWR2004.pdf similarity index 100% rename from LANL_Shared/LANL_cice/doc/PDF/LH_MWR2004.pdf rename to LANL_Shared/CICE4/doc/PDF/LH_MWR2004.pdf diff --git a/LANL_Shared/LANL_cice/doc/PDF/Lipscomb_JGR2001.pdf b/LANL_Shared/CICE4/doc/PDF/Lipscomb_JGR2001.pdf similarity index 100% rename from LANL_Shared/LANL_cice/doc/PDF/Lipscomb_JGR2001.pdf rename to LANL_Shared/CICE4/doc/PDF/Lipscomb_JGR2001.pdf diff --git a/LANL_Shared/LANL_cice/doc/cicedoc.pdf b/LANL_Shared/CICE4/doc/cicedoc.pdf similarity index 100% rename from LANL_Shared/LANL_cice/doc/cicedoc.pdf rename to LANL_Shared/CICE4/doc/cicedoc.pdf diff --git a/LANL_Shared/LANL_cice/drivers/cice4/CICE.F90 b/LANL_Shared/CICE4/drivers/cice4/CICE.F90 similarity index 100% rename from LANL_Shared/LANL_cice/drivers/cice4/CICE.F90 rename to LANL_Shared/CICE4/drivers/cice4/CICE.F90 diff --git a/LANL_Shared/LANL_cice/drivers/cice4/CICE_FinalMod.F90 b/LANL_Shared/CICE4/drivers/cice4/CICE_FinalMod.F90 similarity index 100% rename from LANL_Shared/LANL_cice/drivers/cice4/CICE_FinalMod.F90 rename to LANL_Shared/CICE4/drivers/cice4/CICE_FinalMod.F90 diff --git a/LANL_Shared/LANL_cice/drivers/cice4/CICE_InitMod.F90 b/LANL_Shared/CICE4/drivers/cice4/CICE_InitMod.F90 similarity index 100% rename from LANL_Shared/LANL_cice/drivers/cice4/CICE_InitMod.F90 rename to LANL_Shared/CICE4/drivers/cice4/CICE_InitMod.F90 diff --git a/LANL_Shared/LANL_cice/drivers/cice4/CICE_RunMod.F90 b/LANL_Shared/CICE4/drivers/cice4/CICE_RunMod.F90 similarity index 100% rename from LANL_Shared/LANL_cice/drivers/cice4/CICE_RunMod.F90 rename to LANL_Shared/CICE4/drivers/cice4/CICE_RunMod.F90 diff --git a/LANL_Shared/LANL_cice/drivers/cice4/CICE_RunMod.F90_debug b/LANL_Shared/CICE4/drivers/cice4/CICE_RunMod.F90_debug similarity index 100% rename from LANL_Shared/LANL_cice/drivers/cice4/CICE_RunMod.F90_debug rename to LANL_Shared/CICE4/drivers/cice4/CICE_RunMod.F90_debug diff --git a/LANL_Shared/LANL_cice/drivers/cice4/ice_constants.F90 b/LANL_Shared/CICE4/drivers/cice4/ice_constants.F90 similarity index 100% rename from LANL_Shared/LANL_cice/drivers/cice4/ice_constants.F90 rename to LANL_Shared/CICE4/drivers/cice4/ice_constants.F90 diff --git a/LANL_Shared/LANL_cice/drivers/cice4/ice_prescribed_mod.F90 b/LANL_Shared/CICE4/drivers/cice4/ice_prescribed_mod.F90 similarity index 100% rename from LANL_Shared/LANL_cice/drivers/cice4/ice_prescribed_mod.F90 rename to LANL_Shared/CICE4/drivers/cice4/ice_prescribed_mod.F90 diff --git a/LANL_Shared/LANL_cice/drivers/esmf/CICE.F90 b/LANL_Shared/CICE4/drivers/esmf/CICE.F90 similarity index 100% rename from LANL_Shared/LANL_cice/drivers/esmf/CICE.F90 rename to LANL_Shared/CICE4/drivers/esmf/CICE.F90 diff --git a/LANL_Shared/LANL_cice/drivers/esmf/CICE_ComponentMod.F90 b/LANL_Shared/CICE4/drivers/esmf/CICE_ComponentMod.F90 similarity index 100% rename from LANL_Shared/LANL_cice/drivers/esmf/CICE_ComponentMod.F90 rename to LANL_Shared/CICE4/drivers/esmf/CICE_ComponentMod.F90 diff --git a/LANL_Shared/LANL_cice/drivers/esmf/CICE_FinalMod.F90 b/LANL_Shared/CICE4/drivers/esmf/CICE_FinalMod.F90 similarity index 100% rename from LANL_Shared/LANL_cice/drivers/esmf/CICE_FinalMod.F90 rename to LANL_Shared/CICE4/drivers/esmf/CICE_FinalMod.F90 diff --git a/LANL_Shared/LANL_cice/drivers/esmf/CICE_InitMod.F90 b/LANL_Shared/CICE4/drivers/esmf/CICE_InitMod.F90 similarity index 100% rename from LANL_Shared/LANL_cice/drivers/esmf/CICE_InitMod.F90 rename to LANL_Shared/CICE4/drivers/esmf/CICE_InitMod.F90 diff --git a/LANL_Shared/LANL_cice/drivers/esmf/CICE_RunMod.F90 b/LANL_Shared/CICE4/drivers/esmf/CICE_RunMod.F90 similarity index 100% rename from LANL_Shared/LANL_cice/drivers/esmf/CICE_RunMod.F90 rename to LANL_Shared/CICE4/drivers/esmf/CICE_RunMod.F90 diff --git a/LANL_Shared/LANL_cice/drivers/esmf/ice_constants.F90 b/LANL_Shared/CICE4/drivers/esmf/ice_constants.F90 similarity index 100% rename from LANL_Shared/LANL_cice/drivers/esmf/ice_constants.F90 rename to LANL_Shared/CICE4/drivers/esmf/ice_constants.F90 diff --git a/LANL_Shared/LANL_cice/ice.log.Linux.LANL.coyote b/LANL_Shared/CICE4/ice.log.Linux.LANL.coyote similarity index 100% rename from LANL_Shared/LANL_cice/ice.log.Linux.LANL.coyote rename to LANL_Shared/CICE4/ice.log.Linux.LANL.coyote diff --git a/LANL_Shared/LANL_cice/mpi/ice_boundary.F90 b/LANL_Shared/CICE4/mpi/ice_boundary.F90 similarity index 100% rename from LANL_Shared/LANL_cice/mpi/ice_boundary.F90 rename to LANL_Shared/CICE4/mpi/ice_boundary.F90 diff --git a/LANL_Shared/LANL_cice/mpi/ice_broadcast.F90 b/LANL_Shared/CICE4/mpi/ice_broadcast.F90 similarity index 100% rename from LANL_Shared/LANL_cice/mpi/ice_broadcast.F90 rename to LANL_Shared/CICE4/mpi/ice_broadcast.F90 diff --git a/LANL_Shared/LANL_cice/mpi/ice_communicate.F90 b/LANL_Shared/CICE4/mpi/ice_communicate.F90 similarity index 100% rename from LANL_Shared/LANL_cice/mpi/ice_communicate.F90 rename to LANL_Shared/CICE4/mpi/ice_communicate.F90 diff --git a/LANL_Shared/LANL_cice/mpi/ice_exit.F90 b/LANL_Shared/CICE4/mpi/ice_exit.F90 similarity index 100% rename from LANL_Shared/LANL_cice/mpi/ice_exit.F90 rename to LANL_Shared/CICE4/mpi/ice_exit.F90 diff --git a/LANL_Shared/LANL_cice/mpi/ice_gather_scatter.F90 b/LANL_Shared/CICE4/mpi/ice_gather_scatter.F90 similarity index 100% rename from LANL_Shared/LANL_cice/mpi/ice_gather_scatter.F90 rename to LANL_Shared/CICE4/mpi/ice_gather_scatter.F90 diff --git a/LANL_Shared/LANL_cice/mpi/ice_global_reductions.F90 b/LANL_Shared/CICE4/mpi/ice_global_reductions.F90 similarity index 100% rename from LANL_Shared/LANL_cice/mpi/ice_global_reductions.F90 rename to LANL_Shared/CICE4/mpi/ice_global_reductions.F90 diff --git a/LANL_Shared/LANL_cice/mpi/ice_timers.F90 b/LANL_Shared/CICE4/mpi/ice_timers.F90 similarity index 100% rename from LANL_Shared/LANL_cice/mpi/ice_timers.F90 rename to LANL_Shared/CICE4/mpi/ice_timers.F90 diff --git a/LANL_Shared/LANL_cice/serial/ice_boundary.F90 b/LANL_Shared/CICE4/serial/ice_boundary.F90 similarity index 100% rename from LANL_Shared/LANL_cice/serial/ice_boundary.F90 rename to LANL_Shared/CICE4/serial/ice_boundary.F90 diff --git a/LANL_Shared/LANL_cice/serial/ice_broadcast.F90 b/LANL_Shared/CICE4/serial/ice_broadcast.F90 similarity index 100% rename from LANL_Shared/LANL_cice/serial/ice_broadcast.F90 rename to LANL_Shared/CICE4/serial/ice_broadcast.F90 diff --git a/LANL_Shared/LANL_cice/serial/ice_communicate.F90 b/LANL_Shared/CICE4/serial/ice_communicate.F90 similarity index 100% rename from LANL_Shared/LANL_cice/serial/ice_communicate.F90 rename to LANL_Shared/CICE4/serial/ice_communicate.F90 diff --git a/LANL_Shared/LANL_cice/serial/ice_exit.F90 b/LANL_Shared/CICE4/serial/ice_exit.F90 similarity index 100% rename from LANL_Shared/LANL_cice/serial/ice_exit.F90 rename to LANL_Shared/CICE4/serial/ice_exit.F90 diff --git a/LANL_Shared/LANL_cice/serial/ice_gather_scatter.F90 b/LANL_Shared/CICE4/serial/ice_gather_scatter.F90 similarity index 100% rename from LANL_Shared/LANL_cice/serial/ice_gather_scatter.F90 rename to LANL_Shared/CICE4/serial/ice_gather_scatter.F90 diff --git a/LANL_Shared/LANL_cice/serial/ice_global_reductions.F90 b/LANL_Shared/CICE4/serial/ice_global_reductions.F90 similarity index 100% rename from LANL_Shared/LANL_cice/serial/ice_global_reductions.F90 rename to LANL_Shared/CICE4/serial/ice_global_reductions.F90 diff --git a/LANL_Shared/LANL_cice/serial/ice_timers.F90 b/LANL_Shared/CICE4/serial/ice_timers.F90 similarity index 100% rename from LANL_Shared/LANL_cice/serial/ice_timers.F90 rename to LANL_Shared/CICE4/serial/ice_timers.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_age.F90 b/LANL_Shared/CICE4/source/ice_age.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_age.F90 rename to LANL_Shared/CICE4/source/ice_age.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_atmo.F90 b/LANL_Shared/CICE4/source/ice_atmo.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_atmo.F90 rename to LANL_Shared/CICE4/source/ice_atmo.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_blocks.F90 b/LANL_Shared/CICE4/source/ice_blocks.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_blocks.F90 rename to LANL_Shared/CICE4/source/ice_blocks.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_calendar.F90 b/LANL_Shared/CICE4/source/ice_calendar.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_calendar.F90 rename to LANL_Shared/CICE4/source/ice_calendar.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_diagnostics.F90 b/LANL_Shared/CICE4/source/ice_diagnostics.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_diagnostics.F90 rename to LANL_Shared/CICE4/source/ice_diagnostics.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_distribution.F90 b/LANL_Shared/CICE4/source/ice_distribution.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_distribution.F90 rename to LANL_Shared/CICE4/source/ice_distribution.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_domain.F90 b/LANL_Shared/CICE4/source/ice_domain.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_domain.F90 rename to LANL_Shared/CICE4/source/ice_domain.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_domain_size.F90 b/LANL_Shared/CICE4/source/ice_domain_size.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_domain_size.F90 rename to LANL_Shared/CICE4/source/ice_domain_size.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_dyn_evp.F90 b/LANL_Shared/CICE4/source/ice_dyn_evp.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_dyn_evp.F90 rename to LANL_Shared/CICE4/source/ice_dyn_evp.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_fileunits.F90 b/LANL_Shared/CICE4/source/ice_fileunits.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_fileunits.F90 rename to LANL_Shared/CICE4/source/ice_fileunits.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_flux.F90 b/LANL_Shared/CICE4/source/ice_flux.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_flux.F90 rename to LANL_Shared/CICE4/source/ice_flux.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_forcing.F90 b/LANL_Shared/CICE4/source/ice_forcing.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_forcing.F90 rename to LANL_Shared/CICE4/source/ice_forcing.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_grid.F90 b/LANL_Shared/CICE4/source/ice_grid.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_grid.F90 rename to LANL_Shared/CICE4/source/ice_grid.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_history.F90 b/LANL_Shared/CICE4/source/ice_history.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_history.F90 rename to LANL_Shared/CICE4/source/ice_history.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_init.F90 b/LANL_Shared/CICE4/source/ice_init.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_init.F90 rename to LANL_Shared/CICE4/source/ice_init.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_itd.F90 b/LANL_Shared/CICE4/source/ice_itd.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_itd.F90 rename to LANL_Shared/CICE4/source/ice_itd.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_kinds_mod.F90 b/LANL_Shared/CICE4/source/ice_kinds_mod.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_kinds_mod.F90 rename to LANL_Shared/CICE4/source/ice_kinds_mod.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_kinds_mod_GEOS.F90 b/LANL_Shared/CICE4/source/ice_kinds_mod_GEOS.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_kinds_mod_GEOS.F90 rename to LANL_Shared/CICE4/source/ice_kinds_mod_GEOS.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_mechred.F90 b/LANL_Shared/CICE4/source/ice_mechred.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_mechred.F90 rename to LANL_Shared/CICE4/source/ice_mechred.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_meltpond.F90 b/LANL_Shared/CICE4/source/ice_meltpond.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_meltpond.F90 rename to LANL_Shared/CICE4/source/ice_meltpond.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_ocean.F90 b/LANL_Shared/CICE4/source/ice_ocean.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_ocean.F90 rename to LANL_Shared/CICE4/source/ice_ocean.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_orbital.F90 b/LANL_Shared/CICE4/source/ice_orbital.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_orbital.F90 rename to LANL_Shared/CICE4/source/ice_orbital.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_read_write.F90 b/LANL_Shared/CICE4/source/ice_read_write.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_read_write.F90 rename to LANL_Shared/CICE4/source/ice_read_write.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_restart.F90 b/LANL_Shared/CICE4/source/ice_restart.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_restart.F90 rename to LANL_Shared/CICE4/source/ice_restart.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_restoring.F90 b/LANL_Shared/CICE4/source/ice_restoring.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_restoring.F90 rename to LANL_Shared/CICE4/source/ice_restoring.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_shortwave.F90 b/LANL_Shared/CICE4/source/ice_shortwave.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_shortwave.F90 rename to LANL_Shared/CICE4/source/ice_shortwave.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_spacecurve.F90 b/LANL_Shared/CICE4/source/ice_spacecurve.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_spacecurve.F90 rename to LANL_Shared/CICE4/source/ice_spacecurve.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_state.F90 b/LANL_Shared/CICE4/source/ice_state.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_state.F90 rename to LANL_Shared/CICE4/source/ice_state.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_step_mod.F90 b/LANL_Shared/CICE4/source/ice_step_mod.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_step_mod.F90 rename to LANL_Shared/CICE4/source/ice_step_mod.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_therm_itd.F90 b/LANL_Shared/CICE4/source/ice_therm_itd.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_therm_itd.F90 rename to LANL_Shared/CICE4/source/ice_therm_itd.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_therm_vertical.F90 b/LANL_Shared/CICE4/source/ice_therm_vertical.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_therm_vertical.F90 rename to LANL_Shared/CICE4/source/ice_therm_vertical.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_therm_vertical_GEOS.F90 b/LANL_Shared/CICE4/source/ice_therm_vertical_GEOS.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_therm_vertical_GEOS.F90 rename to LANL_Shared/CICE4/source/ice_therm_vertical_GEOS.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_transport_driver.F90 b/LANL_Shared/CICE4/source/ice_transport_driver.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_transport_driver.F90 rename to LANL_Shared/CICE4/source/ice_transport_driver.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_transport_remap.F90 b/LANL_Shared/CICE4/source/ice_transport_remap.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_transport_remap.F90 rename to LANL_Shared/CICE4/source/ice_transport_remap.F90 diff --git a/LANL_Shared/LANL_cice/source/ice_work.F90 b/LANL_Shared/CICE4/source/ice_work.F90 similarity index 100% rename from LANL_Shared/LANL_cice/source/ice_work.F90 rename to LANL_Shared/CICE4/source/ice_work.F90 diff --git a/LANL_Shared/CMakeLists.txt b/LANL_Shared/CMakeLists.txt index 10258c05..006ef59a 100644 --- a/LANL_Shared/CMakeLists.txt +++ b/LANL_Shared/CMakeLists.txt @@ -1,2 +1,2 @@ -add_subdirectory (LANL_cice) +add_subdirectory (CICE4) diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..82ca4504 --- /dev/null +++ b/LICENSE @@ -0,0 +1,200 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, and + distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by the copyright + owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all other entities + that control, are controlled by, or are under common control with that entity. + For the purposes of this definition, "control" means (i) the power, direct or + indirect, to cause the direction or management of such entity, whether by + contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity exercising + permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, including + but not limited to software source code, documentation source, and configuration + files. + + "Object" form shall mean any form resulting from mechanical transformation or + translation of a Source form, including but not limited to compiled object code, + generated documentation, and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or Object form, made + available under the License, as indicated by a copyright notice that is included + in or attached to the work (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object form, that + is based on (or derived from) the Work and for which the editorial revisions, + annotations, elaborations, or other modifications represent, as a whole, an + original work of authorship. For the purposes of this License, Derivative Works + shall not include works that remain separable from, or merely link (or bind by + name) to the interfaces of, the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including the original version + of the Work and any modifications or additions to that Work or Derivative Works + thereof, that is intentionally submitted to Licensor for inclusion in the Work + by the copyright owner or by an individual or Legal Entity authorized to submit + on behalf of the copyright owner. For the purposes of this definition, + "submitted" means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, and + issue tracking systems that are managed by, or on behalf of, the Licensor for + the purpose of discussing and improving the Work, but excluding communication + that is conspicuously marked or otherwise designated in writing by the copyright + owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf + of whom a Contribution has been received by Licensor and subsequently + incorporated within the Work. + +2. Grant of Copyright License. + + Subject to the terms and conditions of this License, each Contributor hereby + grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, + irrevocable copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the Work and such + Derivative Works in Source or Object form. + +3. Grant of Patent License. + + Subject to the terms and conditions of this License, each Contributor hereby + grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, + irrevocable (except as stated in this section) patent license to make, have + made, use, offer to sell, sell, import, and otherwise transfer the Work, where + such license applies only to those patent claims licensable by such Contributor + that are necessarily infringed by their Contribution(s) alone or by combination + of their Contribution(s) with the Work to which such Contribution(s) was + submitted. If You institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work or a + Contribution incorporated within the Work constitutes direct or contributory + patent infringement, then any patent licenses granted to You under this License + for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + + You may reproduce and distribute copies of the Work or Derivative Works + thereof in any medium, with or without modifications, and in Source or Object + form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a + copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that + You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You + distribute, all copyright, patent, trademark, and attribution notices from + the Source form of the Work, excluding those notices that do not pertain + to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, + then any Derivative Works that You distribute must include a readable copy + of the attribution notices contained within such NOTICE file, excluding + those notices that do not pertain to any part of the Derivative Works, in + at least one of the following places: within a NOTICE text file + distributed as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, within a + display generated by the Derivative Works, if and wherever such + third-party notices normally appear. The contents of the NOTICE file are + for informational purposes only and do not modify the License. You may add + Your own attribution notices within Derivative Works that You distribute, + alongside or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed as modifying + the License. + + You may add Your own copyright statement to Your modifications and may + provide additional or different license terms and conditions for use, + reproduction, or distribution of Your modifications, or for any such + Derivative Works as a whole, provided Your use, reproduction, and + distribution of the Work otherwise complies with the conditions stated in + this License. + +5. Submission of Contributions. + + Unless You explicitly state otherwise, any Contribution intentionally + submitted for inclusion in the Work by You to the Licensor shall be under the + terms and conditions of this License, without any additional terms or + conditions. Notwithstanding the above, nothing herein shall supersede or + modify the terms of any separate license agreement you may have executed with + Licensor regarding such Contributions. + +6. Trademarks. + + This License does not grant permission to use the trade names, trademarks, + service marks, or product names of the Licensor, except as required for + reasonable and customary use in describing the origin of the Work and + reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + + Unless required by applicable law or agreed to in writing, Licensor provides + the Work (and each Contributor provides its Contributions) on an "AS IS" + BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions of + TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR + PURPOSE. You are solely responsible for determining the appropriateness of + using or redistributing the Work and assume any risks associated with Your + exercise of permissions under this License. + +8. Limitation of Liability. + + In no event and under no legal theory, whether in tort (including + negligence), contract, or otherwise, unless required by applicable law (such + as deliberate and grossly negligent acts) or agreed to in writing, shall any + Contributor be liable to You for damages, including any direct, indirect, + special, incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the Work + (including but not limited to damages for loss of goodwill, work stoppage, + computer failure or malfunction, or any and all other commercial damages or + losses), even if such Contributor has been advised of the possibility of such + damages. + +9. Accepting Warranty or Additional Liability. + + While redistributing the Work or Derivative Works thereof, You may choose to + offer, and charge a fee for, acceptance of support, warranty, indemnity, or + other liability obligations and/or rights consistent with this License. + However, in accepting such obligations, You may act only on Your own behalf + and on Your sole responsibility, not on behalf of any other Contributor, and + only if You agree to indemnify, defend, and hold each Contributor harmless + for any liability incurred by, or claims asserted against, such Contributor + by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + NASA Docket No. GSC-15,354-1, and identified as "GEOS-5 GCM Modeling Software” + + “Copyright © 2008 United States Government as represented by the Administrator + of the National Aeronautics and Space Administration. All Rights Reserved.” + + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed + under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. See the License for the + specific language governing permissions and limitations under the License. diff --git a/LICENSE-NOSA b/LICENSE-NOSA new file mode 100644 index 00000000..cf008bf9 --- /dev/null +++ b/LICENSE-NOSA @@ -0,0 +1,261 @@ + + NASA OPEN SOURCE SOFTWARE AGREEMENT + + +NASA OPEN SOURCE AGREEMENT VERSION 1.3 + +THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, +REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN +COMPUTER SOFTWARE ORIGINALLY RELEASED BY THE UNITED STATES GOVERNMENT AS +REPRESENTED BY THE GOVERNMENT AGENCY LISTED BELOW ("GOVERNMENT AGENCY"). +THE UNITED STATES GOVERNMENT, AS REPRESENTED BY GOVERNMENT AGENCY, IS AN +INTENDED THIRD-PARTY BENEFICIARY OF ALL SUBSEQUENT DISTRIBUTIONS OR +REDISTRIBUTIONS OF THE SUBJECT SOFTWARE. ANYONE WHO USES, REPRODUCES, +DISTRIBUTES, MODIFIES OR REDISTRIBUTES THE SUBJECT SOFTWARE, AS DEFINED +HEREIN, OR ANY PART THEREOF, IS, BY THAT ACTION, ACCEPTING IN FULL THE +RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS AGREEMENT. + +Government Agency: National Aeronautics and Space Administration +Government Agency Original Software Designation: GSC-15354-1 +Government Agency Original Software Title: GEOS-5 GCM Modeling Software +User Registration Requested. Please Visit http://opensource.gsfc.nasa.gov +Government Agency Point of Contact for Original Software: + Dale Hithon, SRA Assistant, (301) 286-2691 + +1. DEFINITIONS + +A. "Contributor" means Government Agency, as the developer of the +Original Software, and any entity that makes a Modification. + +B. "Covered Patents" mean patent claims licensable by a Contributor +that are necessarily infringed by the use or sale of its Modification +alone or when combined with the Subject Software. + +C. "Display" means the showing of a copy of the Subject Software, +either directly or by means of an image, or any other device. + +D. "Distribution" means conveyance or transfer of the Subject Software, +regardless of means, to another. + +E. "Larger Work" means computer software that combines Subject +Software, or portions thereof, with software separate from the Subject +Software that is not governed by the terms of this Agreement. + +F. "Modification" means any alteration of, including addition to +or deletion from, the substance or structure of either the Original +Software or Subject Software, and includes derivative works, as that +term is defined in the Copyright Statute, 17 USC 101. However, the act +of including Subject Software as part of a Larger Work does not in and +of itself constitute a Modification. + +G. "Original Software" means the computer software first released under +this Agreement by Government Agency with Government Agency designation +GSC-15354-1 and entitled GEOS-5 GCM Modeling Software, including source +code, object code and accompanying documentation, if any. + +H. "Recipient" means anyone who acquires the Subject Software under +this Agreement, including all Contributors. + +I. "Redistribution" means Distribution of the Subject Software after a +Modification has been made. + +J. "Reproduction" means the making of a counterpart, image or copy of +the Subject Software. + +K. "Sale" means the exchange of the Subject Software for money or +equivalent value. + +L. "Subject Software" means the Original Software, Modifications, or +any respective parts thereof. + +M. "Use" means the application or employment of the Subject Software +for any purpose. + + + +2. GRANT OF RIGHTS + +A. Under Non-Patent Rights: Subject to the terms and conditions of this +Agreement, each Contributor, with respect to its own contribution to +the Subject Software, hereby grants to each Recipient a non-exclusive, +world-wide, royalty-free license to engage in the following activities +pertaining to the Subject Software: + +1. Use +2. Distribution +3. Reproduction +4. Modification +5. Redistribution +6. Display + +B. Under Patent Rights: Subject to the terms and conditions of this +Agreement, each Contributor, with respect to its own contribution to +the Subject Software, hereby grants to each Recipient under Covered +Patents a non-exclusive, world-wide, royalty-free license to engage in +the following activities pertaining to the Subject Software: + +1. Use +2. Distribution +3. Reproduction +4. Sale +5. Offer for Sale + +C. The rights granted under Paragraph B. also apply to the combination +of a Contributor's Modification and the Subject Software if, at the +time the Modification is added by the Contributor, the addition of +such Modification causes the combination to be covered by the Covered +Patents. It does not apply to any other combinations that include a +Modification. + +D. The rights granted in Paragraphs A. and B. allow the Recipient to +sublicense those same rights. Such sublicense must be under the same +terms and conditions of this Agreement. + + +3. OBLIGATIONS OF RECIPIENT + +A. Distribution or Redistribution of the Subject Software must be made +under this Agreement except for additions covered under paragraph 3H. + +1. Whenever a Recipient distributes or redistributes the Subject +Software, a copy of this Agreement must be included with each copy of +the Subject Software; and + +2. If Recipient distributes or redistributes the Subject Software in +any form other than source code, Recipient must also make the source +code freely available, and must provide with each copy of the Subject +Software information on how to obtain the source code in a reasonable +manner on or through a medium customarily used for software exchange. + +B. Each Recipient must ensure that the following copyright notice +appears prominently in the Subject Software: + +Copyright © 2003-2018 United States Government as represented by the +Administrator of the National Aeronautics and Space Administration. All +Rights Reserved. + +C. Each Contributor must characterize its alteration of the Subject +Software as a Modification and must identify itself as the originator +of its Modification in a manner that reasonably allows subsequent +Recipients to identify the originator of the Modification. In +fulfillment of these requirements, Contributor must include a file +(e.g., a change log file) that describes the alterations made and +the date of the alterations, identifies Contributor as originator of +the alterations, and consents to characterization of the alterations +as a Modification, for example, by including a statement that the +Modification is derived, directly or indirectly, from Original Software +provided by Government Agency. Once consent is granted, it may not +thereafter be revoked. + +D. A Contributor may add its own copyright notice to the Subject +Software. Once a copyright notice has been added to the Subject +Software, a Recipient may not remove it without the express permission +of the Contributor who added the notice. + +E. A Recipient may not make any representation in the Subject Software +or in any promotional, advertising or other material that may be +construed as an endorsement by Government Agency or by any prior +Recipient of any product or service provided by Recipient, or that may +seek to obtain commercial advantage by the fact of Government Agency's +or a prior Recipient's participation in this Agreement. + +F. In an effort to track usage and maintain accurate records of +the Subject Software, each Recipient, upon receipt of the Subject +Software, is requested to register with Government Agency by visiting +the following website: http://opensource.gsfc.nasa.gov. Recipient's +name and personal information shall be used for statistical purposes +only. Once a Recipient makes a Modification available, it is requested +that the Recipient inform Government Agency at the web site provided +above how to access the Modification. + +G. Each Contributor represents that its Modification is believed to +be Contributor's original creation and does not violate any existing +agreements, regulations, statutes or rules, and further that Contributor +has sufficient rights to grant the rights conveyed by this Agreement. + +H. A Recipient may choose to offer, and to charge a fee for, warranty, +support, indemnity and/or liability obligations to one or more other +Recipients of the Subject Software. A Recipient may do so, however, +only on its own behalf and not on behalf of Government Agency or any +other Recipient. Such a Recipient must make it absolutely clear that +any such warranty, support, indemnity and/or liability obligation is +offered by that Recipient alone. Further, such Recipient agrees to +indemnify Government Agency and every other Recipient for any liability +incurred by them as a result of warranty, support, indemnity and/or +liability offered by such Recipient. + +I. A Recipient may create a Larger Work by combining Subject Software +with separate software not governed by the terms of this agreement +and distribute the Larger Work as a single product. In such case, the +Recipient must make sure Subject Software, or portions thereof, included +in the Larger Work is subject to this Agreement. + +J. Notwithstanding any provisions contained herein, Recipient is hereby +put on notice that export of any goods or technical data from the United +States may require some form of export license from the U.S. Government. +Failure to obtain necessary export licenses may result in criminal +liability under U.S. laws. Government Agency neither represents that a +license shall not be required nor that, if required, it shall be issued. +Nothing granted herein provides any such export license. + +4. DISCLAIMER OF WARRANTIES AND LIABILITIES; WAIVER AND INDEMNIFICATION + +A. No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT +ANY WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, +INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SUBJECT +SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM +INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR FREE, +OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE +SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER, CONSTITUTE AN +ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT OF ANY RESULTS, +RESULTING DESIGNS, HARDWARE, SOFTWARE PRODUCTS OR ANY OTHER APPLICATIONS +RESULTING FROM USE OF THE SUBJECT SOFTWARE. FURTHER, GOVERNMENT AGENCY +DISCLAIMS ALL WARRANTIES AND LIABILITIES REGARDING THIRD-PARTY SOFTWARE, +IF PRESENT IN THE ORIGINAL SOFTWARE, AND DISTRIBUTES IT "AS IS." + +B. Waiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL +CLAIMS AGAINST THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND +SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT. IF RECIPIENT'S USE +OF THE SUBJECT SOFTWARE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES, +EXPENSES OR LOSSES ARISING FROM SUCH USE, INCLUDING ANY DAMAGES FROM +PRODUCTS BASED ON, OR RESULTING FROM, RECIPIENT'S USE OF THE SUBJECT +SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED STATES +GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR +RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT'S SOLE REMEDY FOR +ANY SUCH MATTER SHALL BE THE IMMEDIATE, UNILATERAL TERMINATION OF THIS +AGREEMENT. + +5. GENERAL TERMS + +A. Termination: This Agreement and the rights granted hereunder will +terminate automatically if a Recipient fails to comply with these terms +and conditions, and fails to cure such noncompliance within thirty +(30) days of becoming aware of such noncompliance. Upon termination, +a Recipient agrees to immediately cease use and distribution of the +Subject Software. All sublicenses to the Subject Software properly +granted by the breaching Recipient shall survive any such termination of +this Agreement. + +B. Severability: If any provision of this Agreement is invalid or +unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement. + +C. Applicable Law: This Agreement shall be subject to United States +federal law only for all purposes, including, but not limited to, +determining the validity of this Agreement, the meaning of its +provisions and the rights, obligations and remedies of the parties. + +D. Entire Understanding: This Agreement constitutes the entire +understanding and agreement of the parties relating to release of the +Subject Software and may not be superseded, modified or amended except +by further written agreement duly executed by the parties. + +E. Binding Authority: By accepting and using the Subject Software under +this Agreement, a Recipient affirms its authority to bind the Recipient +to all terms and conditions of this Agreement and that that Recipient +hereby agrees to all terms and conditions herein. + +F. Point of Contact: Any Recipient contact with Government Agency is to +be directed to the designated representative as follows: Dale Hithon, +SRA Assistant, (301) 286-2691. diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 80be6d7f..00000000 --- a/LICENSE.md +++ /dev/null @@ -1,23 +0,0 @@ -``` -Copyright (c) 2003-2018 United States Government as represented by -the Admistrator of the National Aeronautics and Space Administration. -All Rights Reserved. - -THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, -REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN -COMPUTER SOFTWARE ORIGINALLY RELEASED BY THE UNITED STATES GOVERNMENT AS -REPRESENTED BY THE GOVERNMENT AGENCY LISTED BELOW ("GOVERNMENT AGENCY"). -THE UNITED STATES GOVERNMENT, AS REPRESENTED BY GOVERNMENT AGENCY, IS AN -INTENDED THIRD-PARTY BENEFICIARY OF ALL SUBSEQUENT DISTRIBUTIONS OR -REDISTRIBUTIONS OF THE SUBJECT SOFTWARE. ANYONE WHO USES, REPRODUCES, -DISTRIBUTES, MODIFIES OR REDISTRIBUTES THE SUBJECT SOFTWARE, AS DEFINED -HEREIN, OR ANY PART THEREOF, IS, BY THAT ACTION, ACCEPTING IN FULL THE -RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS AGREEMENT. - -Government Agency: National Aeronautics and Space Administration -Government Agency Original Software Designation: GSC-15354-1 -Government Agency Original Software Title: GEOS-5 GCM Modeling Software -User Registration Requested. Please Visit http://opensource.gsfc.nasa.gov -Government Agency Point of Contact for Original Software: - Dale Hithon, SRA Assistant, (301) 286-2691 -``` diff --git a/README.md b/README.md index 9a476f49..2890bc9d 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ # GEOS Shared Libraries Repository + +## Contributing + +Please check out our [contributing guidelines](CONTRIBUTING.md). + +## License + +All files are currently licensed under the Apache-2.0 license, see [`LICENSE`](LICENSE). + +Previously, the code was licensed under the [NASA Open Source Agreement, Version 1.3](LICENSE-NOSA). diff --git a/arpack/SRC/CMakeLists.txt b/arpack/SRC/CMakeLists.txt index 34c02d42..0ec21977 100644 --- a/arpack/SRC/CMakeLists.txt +++ b/arpack/SRC/CMakeLists.txt @@ -25,5 +25,4 @@ esma_add_library (${this} SRCS ${SRCS} ) - -target_include_directories (${this} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories (${this} PUBLIC $)