Skip to content

Conversation

@pwolfram
Copy link
Contributor

@pwolfram pwolfram commented Jun 19, 2018

This merge adds passive particle floats, generalizes and improves LIGHT code, and adds support for horizontal interpolation of sampling for salinity, temperature, and BGC quantities.

It also fixes the condition where partial bottom cells allows passive floats to advect out of the wetted domain. The solution, following consultation with @maltrud, is to simply ensure that particles are contained in the viable range (ssh - dz/2, bottomDepth - dz/2), which essentially returns particles to the nearest wet cell center vertically.

@pwolfram
Copy link
Contributor Author

cc @bradyrx, @xylar as we have discussed 3D passive float particle tracking in the past.

@pwolfram
Copy link
Contributor Author

cc @sbrus89 as an example of an MPAS-O PR that we will use for testing.

@pwolfram
Copy link
Contributor Author

pwolfram commented Jun 19, 2018

Particle setup files are at testing_and_setup/compass/utility_scripts/LIGHTparticles

Copy link
Contributor

@mark-petersen mark-petersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pwolfram I don't have time to test or review in detail. Considering that you only change a LIGHT file, if it passes your tests, go ahead and merge.

@mark-petersen
Copy link
Contributor

@pwolfram please confirm that this PR passes the nightly test suite. Only the cases with LIGHT are relevant, but it's easy to test the whole thing.

@pwolfram pwolfram force-pushed the particlePassiveFloatVerticalTreatmentFix branch 4 times, most recently from eb96bd1 to 13e5e99 Compare July 5, 2018 20:38
@pwolfram pwolfram force-pushed the particlePassiveFloatVerticalTreatmentFix branch from 6a645ba to 3036516 Compare July 14, 2018 16:37
@pwolfram pwolfram changed the title Fixes vertical boundary condition for LIGHT passive floats Adds LIGHT modes and capabilities (passive floats, improved sampling) Dec 19, 2018
@pwolfram pwolfram removed the bug label Dec 19, 2018
pwolfram added a commit to pwolfram/MPAS-Model that referenced this pull request Dec 19, 2018
This merge adds passive particle floats, generalizes and improves LIGHT
code, and adds support for horizontal interpolation of sampling for
salinity, temperature, and BGC quantities.

* pwolfram/particlePassiveFloatVerticalTreatmentFix: (63 commits)
  Corrects mis-matching LIGHT top and bottom interp
  doh. fixed the other PO4 typo
  fix typo for PO4
  add functionality for PO4, NO3, SiO3, NH4, Fe, O2 sensors with horizontal interpolation
  Fix bug for BGC segfault
  Fixes an index bug in particle spatial interp
  Switches to Wachspress approach
  Resolves compilation error on intel compilers
  Fixes boundary cell overrun
  Fixes failed search for nearest hex vertex
  Adds interp calling routines for particle tracers
  Cleans up LIGHT scalar interpolation
  Horizontally interpolates particle scalars
  Refractors identification of LIGHT vertical index
  Refractors identification of LIGHT vertical index
  Adds recommended fields for globalID, lat/lon
  Updates 20km ziso default case to test particles
  Fixes typo with rename of particle temp/salinity
  Uncomment sampling logs and change sample default in registry
  Fix conditional clause issues
  ...
@pwolfram
Copy link
Contributor Author

pwolfram commented Dec 19, 2018

Verified that LIGHT is BFB against fd71e645 using SOMA test case for "spot checking" (the case that failed in pwolfram#21 to find the bug fixed by e4f2dc5.

UPDATE: there was an error in the testing uncovered via the regression test and this is being looked into right now.

@mark-petersen
Copy link
Contributor

mark-petersen commented Dec 20, 2018

I successfully compiled the merge into ocean/develop on grizzly with gnu and intel. Ran nightly regression with gnu, it is not bfb with ocean/develop for zLevelParticle. I got this:

 ** Running case Periodic Planar 20km - LIGHT particle region reset test
   ** FAIL (See case_outputs/Periodic_Planar_20km_-_LIGHT_particle_region_reset_test for more information)
 ** Running case Periodic Planar 20km - LIGHT particle time reset test
   ** FAIL (See case_outputs/Periodic_Planar_20km_-_LIGHT_particle_time_reset_test for more information)

Is that expected? You can see the error file here:

/lustre/scratch4/turquoise/mpeterse/runs/nightly_ocean_model_181219_0c77a78_gr_gfortran_openmp_LIGHT/case_outputs/Periodic_Planar_20km_-_LIGHT_particle_*

only error is this one:

 ** FAIL Comparison of zLevelParticle between forward/analysis_members/lagrPartTrack.0001-01-01_00.00.00.nc and ...

everything else passes.

@mark-petersen
Copy link
Contributor

It also failed this one:

 ** Running case ZISO 20km - Smoke Test
   ** FAIL (See case_outputs/ZISO_20km_-_Smoke_Test for more information)

because of this line:

testing_and_setup/compass/utility_scripts/LIGHTparticles/make_particle_file.py:
  from pyamg.classical import split, interpolate as amginterp

I tried to install pyamg in my local python installation but couldn't get it to work. I'm sure I just installed it wrong. If you can get that ZISO smoke test case to run successfully, go ahead and merge. Then we can make a PR into E3SM.

import numpy as np
from scipy import spatial
from scipy import sparse
from pyamg.classical import split, interpolate as amginterp
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pwolfram, line 19 should be wrapped in a try block per our call with ANL and @mark-petersen's error. This of course will break if the user tries the --downsample flag without pyamg, but that should be fine. For whatever reason, pyamg is not an easy install (took many tries for me).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bradyrx thanks for the suggestion. I agree, put it in a try block, and have it actually fail only when the library is needed. That will keep our nightly testing suite more accessible and portable across users and machines.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we eventually need a better solution than pyamg for coarsening, but I don't think it's crucial for this PR. It's a feasible solution for oQU240, but takes ~40min for 60to30 and ~20hr for 30to10.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note my current hacky solution here: https://gist.github.com/bradyrx/ddb6c944e425ac5e63b8e8e7361809dd

I'm just running make_particle_file.py without downsampling, and then removing full columns with that gist by going through lat/lon with a fixed stride.

This approximately pulls columns at random due to the unstructured mesh indexing, but I don't suggest it as a formal method in ocean/develop.

Here, white dots are seeding at every grid cell and red are after running my script:

LIGHT BFB against ocean/develop

Cleans up LIGHT helper functions and signatures

BFB with minor clean up changes
(commit f6a7ff8c8848dc02b0c028b70d58e2dfada891cd)
@pwolfram pwolfram force-pushed the particlePassiveFloatVerticalTreatmentFix branch 2 times, most recently from 1654b1f to fb8d7de Compare April 24, 2019 20:16
@pwolfram
Copy link
Contributor Author

@maltrud took a look at a BGC G-case application with particles on and didn't find any problems (example below):

Screen Shot 2019-04-26 at 9 34 28 AM

@mark-petersen, this is ready to merge when you have a chance.

@bradyrx
Copy link

bradyrx commented Apr 29, 2019

@pwolfram, thanks for handling this! Testing from @maltrud confirms that passive float sensors are now good for physics and biogeochem.

@pwolfram
Copy link
Contributor Author

pwolfram commented May 1, 2019

@mark-petersen, please let me know if there is anything else you need us to do before this gets merged-- it is ready for your final approval and merge. Thanks!

@bradyrx
Copy link

bradyrx commented May 1, 2019

@pwolfram, I believe that this PR still breaks if a run is restarted without all procs assigned to at least one particle. Unless you fixed that issue? @maltrud and I were going to just manually bump a particle to the empty proc(s), although that might cause load-balancing issues.

@pwolfram
Copy link
Contributor Author

pwolfram commented May 1, 2019

@bradyrx, please see #224, which is a separate and independent issue from this PR (which is nearly a year old). We should engage there so this huge chunk of work can get merged without further scope creep.

@mark-petersen
Copy link
Contributor

Final test and merge today. Talk to me before changing anything.

mark-petersen added a commit to mark-petersen/MPAS-Model that referenced this pull request May 8, 2019
…ix' into ocean/develop

This merge adds passive particle floats, generalizes and improves LIGHT
code, and adds support for horizontal interpolation of sampling for
salinity, temperature, and BGC quantities.

It also fixes the condition where partial bottom cells allows passive
floats to advect out of the wetted domain. The solution, following
consultation with @maltrud, is to simply ensure that particles are
contained in the viable range (ssh - dz/2, bottomDepth - dz/2), which
essentially returns particles to the nearest wet cell center vertically.
@pwolfram
Copy link
Contributor Author

pwolfram commented May 8, 2019

@mark-petersen, please merge when you get the chance, I won't make any changes-- thanks!

@mark-petersen
Copy link
Contributor

Tested in mega-merge with MPAS nightly regression suite with gnu and intel, opt and debug, on grizzly. bfb on all tests expect were expected:

** Running case ZISO 20km - Smoke Test
   ** FAIL (See case_outputs/ZISO_20km_-_Smoke_Test for more information)
 ** Running case Periodic Planar 20km - LIGHT particle region reset test
   ** FAIL (See case_outputs/Periodic_Planar_20km_-_LIGHT_particle_region_reset_test for more information)
 ** Running case Periodic Planar 20km - LIGHT particle time reset test
   ** FAIL (See case_outputs/Periodic_Planar_20km_-_LIGHT_particle_time_reset_test for more information)

See more details here, but everything looks in order.

/lustre/scratch4/turquoise/mpeterse/runs/nightly_ocean_model_190508_a1256fb_gr_gfortran_openmp_pr_test

Testing mega-merge in E3SM now. Includes coastal branch as well.

@bradyrx
Copy link

bradyrx commented May 8, 2019

@mark-petersen @pwolfram, with this going into develop now, it might be a good time to point out my repo https://github.com/bradyrx/automate-mpas. I'll be down there next week so maybe we can talk about a path forward with this. It might be nice to get some code review here and ideas.

But basically, one just needs to alter the config.sh file and run generate_e3sm_case.sh. It'll manage every step of the E3SM/MPAS case setup and launch the run. This is built mainly to manage all of the minute steps of getting LIGHT to run properly (and is especially useful if you're running a bunch of simulations for scaling tests). The python files alter all of the streams files, etc. to set up proper supercycling, sensor modes, particle initialization, I/O, and of course base settings for MPAS.

@mark-petersen
Copy link
Contributor

test of mega-merge passed all in E3SM:

PASS SMS_D_Ln9.T62_oQU120_ais20.MPAS_LISIO_TEST.cori-knl_gnu RUN time=147
PASS SMS_D_Ln9.T62_oQU120_ais20.MPAS_LISIO_TEST.cori-knl_intel RUN time=397
PASS ERS_Ld9.T62_oEC60to30v3wLI.GMPAS-DIB-IAF-ISMF.cori-knl_gnu COMPARE_base_rest
PASS PEM_Ln9.ne30_oECv3wLI.A_WCYCL1850-DIB-ISMF_CMIP6.cori-knl_gnu COMPARE_base_modpes
PASS PET_Ln3.T62_oEC60to30v3wLI.GMPAS-DIB-IAF-ISMF.cori-knl_gnu COMPARE_base_single_thread

@mark-petersen mark-petersen merged commit d9c9505 into MPAS-Dev:ocean/develop May 9, 2019
mark-petersen added a commit that referenced this pull request May 9, 2019
Includes:
1. #56 LIGHT update
2. #164 clean up ice shelf melt flag
3. merge coastal branch
4. #201 CONUS mesh update
@pwolfram pwolfram deleted the particlePassiveFloatVerticalTreatmentFix branch May 9, 2019 14:00
@pwolfram
Copy link
Contributor Author

pwolfram commented May 9, 2019

Thanks @mark-petersen

@pwolfram pwolfram added the LIGHT MPAS-O LIGHT tag label May 9, 2019
mark-petersen added a commit to E3SM-Project/E3SM that referenced this pull request May 22, 2019
Includes:

1. LIGHT update (MPAS-Ocean Lagrangian particles): MPAS-Dev/MPAS-Model#56
2. clean up ice shelf melt flag: MPAS-Dev/MPAS-Model#164
3. merge coastal branch: MPAS-Dev/MPAS-Model#54
4. CONUS mesh update: MPAS-Dev/MPAS-Model#201
5. Major COMPASS upgrade to python 3: MPAS-Dev/MPAS-Model#229
6. Eliminate outdated -DUNDERSCORE flag: MPAS-Dev/MPAS-Model#156
7. PIO Version Compatibility Check - PGI Compiler Bug Fix: MPAS-Dev/MPAS-Model#212

These changes do not alter E3SM standard cases or testing on next. COMPASS is
the MPAS testing infrastructure. LIGHT and coastal changes are protected by
flags and not used in normal E3SM tests.
jonbob added a commit to E3SM-Project/E3SM that referenced this pull request May 22, 2019
Update mpas source

This PR update the mpas-source git submodule but only includes changes that
will not impact E3SM. These changes include:
* LIGHT update (MPAS-Ocean Lagrangian particles): MPAS-Dev/MPAS-Model#56
* clean up ice shelf melt flag: MPAS-Dev/MPAS-Model#164
* merge coastal branch: MPAS-Dev/MPAS-Model#54
* CONUS mesh update: MPAS-Dev/MPAS-Model#201
* Major COMPASS upgrade to python 3: MPAS-Dev/MPAS-Model#229
* Eliminate outdated -DUNDERSCORE flag: MPAS-Dev/MPAS-Model#156
* PIO Version Compatibility Check - PGI Compiler Bug Fix: MPAS-Dev/MPAS-Model#212

These changes do not alter E3SM standard cases or tested configurations.
COMPASS is the MPAS testing infrastructure. LIGHT and coastal changes
are protected by flags and not used in normal E3SM tests.

[NML]
[BFB]
jonbob added a commit to E3SM-Project/E3SM that referenced this pull request May 23, 2019
Update mpas source

This PR update the mpas-source git submodule but only includes changes that
will not impact E3SM. These changes include:
* LIGHT update (MPAS-Ocean Lagrangian particles): MPAS-Dev/MPAS-Model#56
* clean up ice shelf melt flag: MPAS-Dev/MPAS-Model#164
* merge coastal branch: MPAS-Dev/MPAS-Model#54
* CONUS mesh update: MPAS-Dev/MPAS-Model#201
* Major COMPASS upgrade to python 3: MPAS-Dev/MPAS-Model#229
* Eliminate outdated -DUNDERSCORE flag: MPAS-Dev/MPAS-Model#156
* PIO Version Compatibility Check - PGI Compiler Bug Fix: MPAS-Dev/MPAS-Model#212

These changes do not alter E3SM standard cases or tested configurations.
COMPASS is the MPAS testing infrastructure. LIGHT and coastal changes
are protected by flags and not used in normal E3SM tests.

[NML]
[BFB]
ashwathsv pushed a commit to ashwathsv/MPAS-Model that referenced this pull request Jul 21, 2020
…ix' into ocean/develop

This merge adds passive particle floats, generalizes and improves LIGHT
code, and adds support for horizontal interpolation of sampling for
salinity, temperature, and BGC quantities.

It also fixes the condition where partial bottom cells allows passive
floats to advect out of the wetted domain. The solution, following
consultation with @maltrud, is to simply ensure that particles are
contained in the viable range (ssh - dz/2, bottomDepth - dz/2), which
essentially returns particles to the nearest wet cell center vertically.
mark-petersen added a commit to mark-petersen/MPAS-Model that referenced this pull request Jan 11, 2021
…ix' into ocean/develop

This merge adds passive particle floats, generalizes and improves LIGHT
code, and adds support for horizontal interpolation of sampling for
salinity, temperature, and BGC quantities.

It also fixes the condition where partial bottom cells allows passive
floats to advect out of the wetted domain. The solution, following
consultation with @maltrud, is to simply ensure that particles are
contained in the viable range (ssh - dz/2, bottomDepth - dz/2), which
essentially returns particles to the nearest wet cell center vertically.
caozd999 pushed a commit to caozd999/MPAS-Model that referenced this pull request Jan 14, 2021
…ix' into ocean/develop

This merge adds passive particle floats, generalizes and improves LIGHT
code, and adds support for horizontal interpolation of sampling for
salinity, temperature, and BGC quantities.

It also fixes the condition where partial bottom cells allows passive
floats to advect out of the wetted domain. The solution, following
consultation with @maltrud, is to simply ensure that particles are
contained in the viable range (ssh - dz/2, bottomDepth - dz/2), which
essentially returns particles to the nearest wet cell center vertically.
barlage pushed a commit to barlage/MPAS-Model that referenced this pull request Nov 6, 2024
* "GF coldpool updates and bugfix for radiation coupling"

* "Update formating following Mike's suggestions"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants