Giter VIP home page Giter VIP logo

genbe_2.0's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

genbe_2.0's Issues

Open file repeatedly in gen_be_stage4.exe

When use_global_bin=.true. and num_bins2d .gt. 1, the lines 560 to 562

                 filename = 'sl_print.b'//ci//'.'//trim(variable)
                 open( unit=ounit, file=trim(filename), form='formatted', &
                 action='write', access='sequential', status='replace')

will be executed. In lines 507-509, there are the same codes as above, and there is not a close statement between them, which means the file filename will be opened more than once. This may cause an error in some compiler, such as ifort 17.0.5. According to the context, the code from lines 560 to 562 may be able to be deleted.

question: filter in laplacian

There is Is the purpose of the conditional below computational efficiency?

There is a conditional test that prevents the calculation of var_bin_field, var_bin_lap_field, var_field, and var_lap_field when the lap_field_2d is small.

if ( lap_field_2d(i,j) .gt. 1e-13 ) then

if ( lap_field_2d(i,j) .gt. 1e-13 ) then

Based on testing, I don't think this conditional filter is good for chemical (e.g., no2) calculations. When I remove the filter, the results look much more reasonable.

dsig in read_be_gsi

The read_be_gsi uses dsig to normalize the vertical length scale[1,2], but I believe it should be updated for sigma coordinate and may need to be redone for hybrid coordinates.

Right now, dsig is calculated from sigma (aka eta) coordinates using the centers and approximating the edge values. Essentially, half the distance in log space between each center-point and the center-points above/below is assigned to each level. For the bottom level and the top level, the distance in each direction is approximated using the distance in one direction (up for the bottom level; down for the top level). This approximation is unnecessary for the bottom since the edge value is defined as 1. The top edge is also defined as zero, but cannot be used because its value is undefined in log-space.

Attached is a fortran code with several alternative calculations.

  1. Adjusts edges of dsig using known properties of ZNU (bottom=1, top=0),
  2. Calculates dsig from a reconstructed ZNW,
  3. Uses assumed surface pressure and model pressure top to calculate in pressure space.

The last alternative is based on two things. (2) My interpretation of the code is that dsig approximates a value proportional to $log(P_{k,bottom} / P_{k,top})$, which is used to convert the length scale into something proportional to vertical coordinate unit. (2) In the future, the hybrid coordinate in WRF will require an adjustment to account for constant pressure levels.

The Fortran code produces the attached CSV output and I made the following figure to show the changes. For the vertical coordinate used at the EPA, the first approach changes the bottom value by ~7% and the top value by a similar amount. The other approaches make larger changes.

vlen_dsig

genbe.F90.txt
genbe_dsig.csv

[1] https://github.com/wrf-model/GENBE_2.0/blob/master/src/gen_be_nc2gsi.F#L627-L631
[2] https://github.com/wrf-model/GENBE_2.0/blob/master/src/gen_be_nc2gsi.F#L637

ls_method = 1 bugs

ls_method = 1 does not appear to be operational. There are two major bugs that occur when using ls_method = 1 with correl or covar and gauss

  1. arrays used within loop are deallocated after the first bin. This causes a segmentation fault.

deallocate (field_2d)

deallocate (cov)

deallocate (cor)

deallocate (mean)

deallocate (var)

  1. cov is passed directly to get_covariance_masked rather than passing as cov(b, :). It is not clear what the effect would be

Also, ls_method = 1 appears to only work with single level variables. Is this as intended?

I am pursuing ls_method = 1 instead of 2 because I am getting surprising results and wanted to explore other options.

Illegal memory access when running gen_be_stage0.exe

When I rans the gen_be_stage3.exe, it threw me an error. And I backtracked to the subroutine read_input_state in external/tools/io_input.f90. In the line 181:

      call io_input_field_time(input_obj, state % date)

the second argument should be type(field3dReal/field2dReal/field1dReal). However, the input argument here is character (len=10) :: date. This may cause illegal memory access in some compilers (my compiler is ifort 17.0.5).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.