geoschem / GCHP

The "superproject" wrapper repository for GCHP, the high-performance instance of the GEOS-Chem chemical-transport model.
https://gchp.readthedocs.io
Other
22 stars 25 forks source link

Question about STRETCHED GRID #376

Closed ast222340 closed 7 months ago

ast222340 commented 7 months ago

Name and Institution (Required)

Name: Sayan Institution: Vidyasagar University

Confirm you have reviewed the following documentation

Description of your issue or question

Respected sir/madam, I am using GCHP V14.1.1.I simulated the full chemistry of 2019 with C48 globally and created monthly output file. Example : SpeciesConcVV_CO Size: 48x48x6x72x1 Dimensions: Xdim,Ydim,nf,lev,time Datatype: single Since I did all my research work in 'MATLAB'.My question is how to do plots of variables(SpeciesConcVV_CO) in matlab.I have never done a 'cubed-sphere' grid plot.If ypu tell me how to do it or is there any technique that i apply here or if you have any matlab sample code please share.what should i do when need average mean & season plot.scatter plot for ground measurement vs model.

I have attached two images here for STRETCHED GRID.I want to run for India domain(C180) so which one will be proper? I have a doubt about this.which one is perfect? 1.Stretch factor:3 Target longitude:79 Target latitude: 21 Screenshot (28) 2.Stretch factor:15 Target longitude:79 Target latitude: 21 Screenshot (29) for STRETCHED GRID case, need 2 node,24 core..it is right or wrong?

yantosca commented 7 months ago

Thanks for writing @ast222340. We do not have much experience with Matlab, so we would not be able to assist you with that. However, GCPy (our Python package) has the functionality to read and plot data on on GCHP cubed-sphere/stretched grids. We would recommend that you look into using GCPy for your analysis. See: https://gcpy.readthedocs.io.

I think that the grid in the first figure would be more proper for the entire country of India (even though you have some border countries included).

Also tagging @lizziel @yidant

ast222340 commented 7 months ago

Thank you @yantosca.I was late replying because you tagged them.I have started the STRETCHED GRID simulation of the first figure as you said.I am using "GEOSChem.Restart.fullchem.20190701_0000z.c180.nc4" file for STRETCHED GRID which is available in ExtData as GEOSCHEM_RESTARTS.My reason is that I use C180 because comparing with 05x0625.I am facing many errors.

Integer*4 Resource Parameter: GCHPchem_REFERENCE_TIME:500 Character Resource Parameter: GCHPchem_INTERNAL_CHECKPOINT_FILE:Restarts/gcchem_internal_checkpoint Character Resource Parameter: GCHPchem_INTERNAL_RESTART_FILE:gchp_restart.nc4 Character Resource Parameter: MAPL_ENABLE_BOOTSTRAP:YES pe=00011 FAIL at line=06123 MAPL_Generic.F90 pe=00011 FAIL at line=01609 MAPL_Generic.F90 pe=00015 FAIL at line=06123 MAPL_Generic.F90

I just showed a variable in that restart file. SPC_N2O
Size: 180x1080x72x1 Dimensions: lon,lat,lev,time Datatype: single I don't understand why the model is not running.Please let me know where I am doing wrong. GCHP.log.txt

lizziel commented 7 months ago

@ast222340, please read the stretched grid section of GCHP ReadTheDocs. It states that there is a stretched grid restart file available for a test case. The test case is not at c180 so it sounds like you are trying to use a regular grid c180 restart file for your stretched grid run. This will fail. You need to make a restart file that matches your grid resolution and stretch grid parameters.

Please also make sure that if you are using the standard simulation you update setCommonRunSettings.sh to allow missing variables in the restart file. You can find the setting for that by scrolling through the configuration section of the file and reading the comments. Ideally your restart file would be generated to match the version you are running with. You can do this by creating your stretched grid restart file from one of the restarts that is included in the Restarts subdirectory in the run directory you create from your source code.

Lastly, the latest ReadTheDocs has an updated debugging page. Please see https://gchp.readthedocs.io/en/stable/user-guide/debugging.html.

ast222340 commented 7 months ago

Thank you @lizziel.As I read GCHP ReadTheDocs,I realized that need to convert the restart file mentioned above to stretched grid using regridding method(like GEOSChem.Restart.20190701_0000z.c180.s3_21N_82E.nc').Then transfer this new file to the Restarts subdirectory in the run directory.Did I say it right?please correct me if i am wrong.

When STRETCH_GRID=OFF,then model started running fine.I ran the first 1 months for testing.Then a file was created on the Restarts subdirectory as name "gcchem_internal_checkpoint".I renamed the checkpoint file (GEOSChem.Restart.fullchem.20190801_0000z.c180.nc4) to long run for 1 year.This process is right.If this is wrong,please tell me otherwise my analysis will be wrong.

This restart file is provided for testing purposes.Can't i do the simulation without taking restart file just for asking?if possible,where to change.it is required for long simulations because if the model stops midway. setCommonRunSettings.sh.txt

lizziel commented 7 months ago

Hi @ast222340, that is correct that you need to create a restart file for your stretched grid simulation. When you transfer it to the Restarts subdirectory make sure that you set the symbolic link to it before running. See the GCHP ReadTheDocs section called "Configure run directory" within the stretched grid page for how to do this.

That's great that you have the model working for C180 with stretched grid off. You can avoid having to manually rename the gcchem_internal_checkpoint file by using a run script from subdirectory runScriptSamples.

I renamed the checkpoint file (GEOSChem.Restart.fullchem.20190801_0000z.c180.nc4) to long run for 1 year.

Could you clarify what you mean?

This restart file is provided for testing purposes.Can't i do the simulation without taking restart file just for asking?if possible,where to change.it is required for long simulations because if the model stops midway.

I'm not sure I understand your question. Can you clarify?

ast222340 commented 7 months ago

Thank You @lizziel. I renamed the checkpoint file (GEOSChem.Restart.fullchem.20190801_0000z.c180.nc4) to long run for 1 year. ---Example,I have a Restart file "GEOSChem.Restart.fullchem.20190801_0000z.c180.nc4".First i ran it for a month for testing purposes.A gcchem_internal_checkpoint is created in the Restart subdirectory at the end of the run.I was saying that using this check file I can run for one year.

This restart file is provided for testing purposes.Can't i do the simulation without taking restart file just for asking?if possible,where to change.it is required for long simulations because if the model stops midway

 GEOS Chem classic model does not required a restart file without test case,it has an option to create it automatically via "HISTORY.rc" file.

============================================================================== %%%%% THE Restart COLLECTION %%%%%

GEOS-Chem restart file fields

  Available for all simulations

============================================================================== Restart.filename: './Restarts/GEOSChem.Restart.%y4%m2%d2%h2%n2z.nc4', Restart.frequency: 00000001 000000 Restart.duration: 00000001 000000 Restart.mode: 'instantaneous' Restart.fields: 'SpeciesRst?ALL? ',

If this model had such an option then we would not need to provide any restart file initially.

I used "MATLAB" for all of my research work.I would like to know how to plot variables in Matlab, such as SpeciesConcVV_CO.'Cubed-sphere' grid plots are something I have never done.If you could explain the process to me, let me know what method to use in this situation, or provide some sample Matlab code.

lizziel commented 7 months ago

Hi @ast222340, the code in HISTORY.rc you are referring to is the output restart file for GEOS-Chem Classic. You need an initial restart file for GEOS-Chem Classic. Like GCHP, a restart file is provided in the run directory.

For both GEOS-Chem Classic and GCHP we recommend using the provided restart file to do a "spin-up", meaning a simulation run prior to your science run start date. This better captures the state of the atmosphere at the date you wish to start simulation the atmosphere. We also recommend taking seasonality into account. For example, If you have a July 2019 restart file that comes with the run directory and you want to start your simulation on January 1st 2018, then you would rename your GCHP restart file to July 1st 2017 and run for 6 months. The output restart file would be the restart file to use for your science run. This assumes a 6 month spin-up is okay for the research you are doing. If you are looking at the stratosphere then you may want to spin up the model for longer.

The GEOS-Chem Support Team does not advise on use of MATLAB for analyzing GEOS-Chem data. We provide the python package GCPy which includes examples for plotting. See https://github.com/geoschem/gcpy.

lizziel commented 7 months ago

I am closing this issue because the original questions about stretched grid are resolved.