Changeset 2356 in lmdz_wrf


Ignore:
Timestamp:
Feb 20, 2019, 2:46:48 PM (6 years ago)
Author:
lfita
Message:

Adding:

  • `from_ptlist_2DRKmatrix': Subroutine to construct a 2D RK matrix from a list of values accompaigned by a list of coordinates
  • module_ForGen.so': python binding to the funcionts in module_generic.f90'
Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/Makefile.trueno

    r2261 r2356  
    5454intsrcs = $(srcs) module_ForInterpolate.f90
    5555scisrcs = $(srcs)
     56gensrcs = module_definitions.f90 module_basic.f90 module_generic.f90
    5657defsrcs = module_definitions.f90
    5758
     
    9293        pyintmods.o \
    9394        pyscimods.o \
     95        pygenmods.o \
    9496        pydefmods.o \
    9597        trajectories_overlap.o
     
    101103        pyintmods.o \
    102104        pyscimods.o \
     105        pygenmods.o \
    103106        pydefmods.o
    104107
     
    116119
    117120clean :
    118         $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForDef.so
     121        $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForGen.so module_ForDef.so
    119122
    120123########    #######
     
    170173        $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForSci $(scisrcs) -L$(NCLIBFOLD)
    171174
     175pygenmods.o:
     176        $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForGen $(gensrcs) -L$(NCLIBFOLD)
     177
    172178pydefmods.o:
    173179        $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDef $(defsrcs) -L$(NCLIBFOLD)
  • trunk/tools/module_generic.f90

    r2340 r2356  
    55! continguos_homogene_zones: Subroutine to look for contiguous zones by looking by continuous grid points
    66! freeunit: provides the number of a free unit in which open a file
     7! from_ptlist_2DRKmatrix: Subroutine to construct a 2D RK matrix from a list of values accompaigned
     8!   by a list of coordinates
    79! GetInNamelist: Subroutine to get a paramter from a namelistfile
    810! get_xyconlimits: Subroutine for getting the limits of contiguous values from a given point in a 2D matrix
     
    985987  END SUBROUTINE get_xyconlimits
    986988
     989  SUBROUTINE from_ptlist_2DRKmatrix(Npts, pts, vals, dx, dy, NOval, matrix)
     990  ! Subroutine to construct a 2D RK matrix from a list of values accompaigned by a list of coordinates
     991
     992    IMPLICIT NONE
     993
     994    INTEGER, INTENT(in)                                  :: Npts, dx, dy
     995    REAL(r_k), INTENT(in)                                :: NOval
     996    INTEGER, DIMENSION(Npts,2), INTENT(in)               :: pts
     997    REAL(r_k), DIMENSION(Npts), INTENT(in)               :: vals
     998    REAL(r_k), DIMENSION(dx,dy), INTENT(out)             :: matrix
     999
     1000! Local
     1001    INTEGER                                              :: iv, i, j
     1002
     1003!!!!!!! Variables
     1004! Npts: Number of values of the list
     1005! pts: 2D matrix coordinates of the values
     1006! vals: list of values correspondant to the coordinates
     1007! dx, dy: shape of the 2D matrix
     1008! NOval: Value to assign when there is no coordinate
     1009! matrix: resultant matrix
     1010
     1011    fname = 'from_ptlist_2DRKmatrix'
     1012
     1013    matrix = NOval
     1014
     1015    DO iv=1, Npts
     1016      i = pts(iv,1)
     1017      j = pts(iv,2)
     1018      matrix(i,j) = vals(iv)
     1019    END DO
     1020
     1021    RETURN
     1022
     1023  END SUBROUTINE from_ptlist_2DRKmatrix
     1024
    9871025END MODULE module_generic
Note: See TracChangeset for help on using the changeset viewer.