33 PUBLIC ::
OPERATOR(==)
48 INTERFACE OPERATOR(==)
50 END INTERFACE OPERATOR(==)
57 '$Id: Subset_Define.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 66 LOGICAL :: is_allocated = .false.
68 INTEGER :: n_values = 0
70 INTEGER,
ALLOCATABLE :: number(:)
71 INTEGER,
ALLOCATABLE :: index(:)
124 status = subset%Is_Allocated
152 subset%Is_Allocated = .false.
193 INTEGER ,
INTENT(IN) :: n_values
195 INTEGER :: alloc_stat
198 IF ( n_values < 1 )
RETURN 201 ALLOCATE( subset%Number( n_values ), &
202 subset%Index( n_values ), &
204 IF ( alloc_stat /= 0 )
RETURN 209 subset%n_Values = n_values
216 subset%Is_Allocated = .true.
245 WRITE(*,
'(1x,"Subset OBJECT")')
247 WRITE(*,
'(3x,"n_Values:",1x,i0)') subset%n_Values
250 WRITE(*,
'(3x,"Number :")')
251 WRITE(*,
'(10(1x,i5,:))') subset%Number
252 WRITE(*,
'(3x,"Index :")')
253 WRITE(*,
'(10(1x,i5,:))') subset%Index
283 CHARACTER(*),
INTENT(OUT) :: id
331 Number , & ! Optional input
335 INTEGER,
OPTIONAL,
INTENT(IN) :: number(:)
336 INTEGER,
OPTIONAL,
INTENT(IN) :: index(:)
340 IF (
PRESENT(number) )
THEN 341 IF (
SIZE(number) == subset%n_Values )
THEN 342 subset%Number = number
348 IF (
PRESENT(index) )
THEN 349 IF (
SIZE(index) == subset%n_Values )
THEN 405 n_Values, & ! Optional output
406 Number , & ! Optional output
410 INTEGER,
OPTIONAL,
INTENT(OUT) :: n_values
411 INTEGER,
ALLOCATABLE,
OPTIONAL,
INTENT(OUT) :: number(:)
412 INTEGER,
ALLOCATABLE,
OPTIONAL,
INTENT(OUT) :: index(:)
417 IF (
PRESENT(n_values) ) n_values = n
419 IF (
PRESENT(number) )
THEN 421 number = subset%Number
424 IF (
PRESENT(index) )
THEN 474 INTEGER ,
INTENT(IN) :: list(:)
475 INTEGER ,
INTENT(IN) :: subset_list(:)
477 INTEGER :: sorted_list(
size(list))
478 INTEGER :: sorted_subset_list(
size(subset_list))
480 INTEGER :: n_subset_list
481 INTEGER :: n_elements
482 INTEGER :: isubset, iextract
487 n_subset_list =
SIZE(subset_list)
488 IF ( n_list < 1 .OR. n_subset_list < 1 )
RETURN 494 sorted_subset_list = subset_list
499 n_elements = count( sorted_subset_list >= sorted_list(1) .AND. &
500 sorted_subset_list <= sorted_list(n_list) )
501 IF ( n_elements == 0 )
RETURN 511 isubset = minloc( sorted_subset_list - sorted_list(1), &
512 mask = ( (sorted_subset_list - sorted_list(1)) >= 0 ), &
519 list_loop:
DO i = 1, n_list
520 IF ( sorted_list(i) == sorted_subset_list(isubset) )
THEN 521 subset%Index( iextract ) = i
522 subset%Number( iextract ) = sorted_list(i)
523 iextract = iextract + 1
524 isubset = isubset + 1
525 IF ( isubset > n_subset_list )
EXIT list_loop
574 ELEMENTAL FUNCTION subset_equal( x, y )
RESULT( is_equal )
587 IF ( x%n_Values /= y%n_Values )
RETURN 589 IF ( all(x%Number == y%Number ) .AND. &
590 all(x%Index == y%Index ) ) &
subroutine, public subset_inspect(Subset)
character(*), parameter module_version_id
integer, parameter, public failure
elemental logical function, public subset_associated(Subset)
subroutine, public subset_setvalue(Subset, Number, Index)
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
elemental subroutine, public subset_destroy(Subset)
subroutine, public subset_getvalue(Subset, n_Values, Number, Index)
************************************************************************GNU Lesser General Public License **This file is part of the GFDL Flexible Modeling System(FMS). ! *! *FMS is free software without even the implied warranty of MERCHANTABILITY or *FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License *for more details **You should have received a copy of the GNU Lesser General Public *License along with FMS If see< http:! ***********************************************************************subroutine READ_RECORD_CORE_(unit, field, nwords, data, start, axsiz) integer, intent(in) ::unit type(fieldtype), intent(in) ::field integer, intent(in) ::nwords MPP_TYPE_, intent(inout) ::data(nwords) integer, intent(in) ::start(:), axsiz(:) integer(SHORT_KIND) ::i2vals(nwords)!rab used in conjunction with transfer intrinsic to determine size of a variable integer(KIND=1) ::one_byte(8) integer ::word_sz!#ifdef __sgi integer(INT_KIND) ::ivals(nwords) real(FLOAT_KIND) ::rvals(nwords)!#else! integer ::ivals(nwords)! real ::rvals(nwords)!#endif real(DOUBLE_KIND) ::r8vals(nwords) pointer(ptr1, i2vals) pointer(ptr2, ivals) pointer(ptr3, rvals) pointer(ptr4, r8vals) if(mpp_io_stack_size< nwords) call mpp_io_set_stack_size(nwords) call mpp_error(FATAL, 'MPP_READ currently requires use_netCDF option') end subroutine READ_RECORD_CORE_ subroutine READ_RECORD_(unit, field, nwords, data, time_level, domain, position, tile_count, start_in, axsiz_in)!routine that is finally called by all mpp_read routines to perform the read!a non-netCDF record contains:! field ID! a set of 4 coordinates(is:ie, js:je) giving the data subdomain! a timelevel and a timestamp(=NULLTIME if field is static)! 3D real data(stored as 1D)!if you are using direct access I/O, the RECL argument to OPEN must be large enough for the above!in a global direct access file, record position on PE is given by %record.!Treatment of timestamp:! We assume that static fields have been passed without a timestamp.! Here that is converted into a timestamp of NULLTIME.! For non-netCDF fields, field is treated no differently, but is written! with a timestamp of NULLTIME. There is no check in the code to prevent! the user from repeatedly writing a static field. integer, intent(in) ::unit, nwords type(fieldtype), intent(in) ::field MPP_TYPE_, intent(inout) ::data(nwords) integer, intent(in), optional ::time_level type(domain2D), intent(in), optional ::domain integer, intent(in), optional ::position, tile_count integer, intent(in), optional ::start_in(:), axsiz_in(:) integer, dimension(size(field%axes(:))) ::start, axsiz integer ::tlevel !, subdomain(4) integer ::i, error, is, ie, js, je, isg, ieg, jsg, jeg type(domain2d), pointer ::io_domain=> tlevel if(PRESENT(start_in) .AND. PRESENT(axsiz_in)) then if(size(start(! the data domain and compute domain must refer to the subdomain being passed ! In this ! since that attempts to gather all data on PE size(field%axes(:)) axsiz(i)
elemental logical function subset_equal(x, y)
subroutine, public subset_defineversion(Id)
subroutine, public subset_generate(Subset, List, Subset_List)
integer, parameter, public success
elemental subroutine, public subset_create(Subset, n_Values)
integer, parameter, public information