libsim Versione 7.2.1

◆ vol7d_ana_vect_read_unit()

subroutine vol7d_ana_vect_read_unit ( type(vol7d_ana), dimension(:)  this,
integer, intent(in)  unit 
)

This method reads from a Fortran file unit the contents of the object this.

The record to be read must have been written with the ::write_unit method. The method works both on formatted and unformatted files.

Parametri
thisobject to be read
[in]unitunit from which to read, it must be an opened Fortran file unit

Definizione alla linea 525 del file vol7d_ana_class.F90.

526! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
527! authors:
528! Davide Cesari <dcesari@arpa.emr.it>
529! Paolo Patruno <ppatruno@arpa.emr.it>
530
531! This program is free software; you can redistribute it and/or
532! modify it under the terms of the GNU General Public License as
533! published by the Free Software Foundation; either version 2 of
534! the License, or (at your option) any later version.
535
536! This program is distributed in the hope that it will be useful,
537! but WITHOUT ANY WARRANTY; without even the implied warranty of
538! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
539! GNU General Public License for more details.
540
541! You should have received a copy of the GNU General Public License
542! along with this program. If not, see <http://www.gnu.org/licenses/>.
543#include "config.h"
544
549MODULE vol7d_ana_class
550USE kinds
553IMPLICIT NONE
554
556INTEGER,PARAMETER :: vol7d_ana_lenident=20
557
562TYPE vol7d_ana
563 TYPE(geo_coord) :: coord
564 CHARACTER(len=vol7d_ana_lenident) :: ident
565END TYPE vol7d_ana
566
568TYPE(vol7d_ana),PARAMETER :: vol7d_ana_miss=vol7d_ana(geo_coord_miss,cmiss)
569
573INTERFACE init
574 MODULE PROCEDURE vol7d_ana_init
575END INTERFACE
576
579INTERFACE delete
580 MODULE PROCEDURE vol7d_ana_delete
581END INTERFACE
582
586INTERFACE OPERATOR (==)
587 MODULE PROCEDURE vol7d_ana_eq
588END INTERFACE
589
593INTERFACE OPERATOR (/=)
594 MODULE PROCEDURE vol7d_ana_ne
595END INTERFACE
596
597
602INTERFACE OPERATOR (>)
603 MODULE PROCEDURE vol7d_ana_gt
604END INTERFACE
605
610INTERFACE OPERATOR (<)
611 MODULE PROCEDURE vol7d_ana_lt
612END INTERFACE
613
618INTERFACE OPERATOR (>=)
619 MODULE PROCEDURE vol7d_ana_ge
620END INTERFACE
621
626INTERFACE OPERATOR (<=)
627 MODULE PROCEDURE vol7d_ana_le
628END INTERFACE
629
630
632INTERFACE c_e
633 MODULE PROCEDURE vol7d_ana_c_e
634END INTERFACE
635
638INTERFACE read_unit
639 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
640END INTERFACE
641
644INTERFACE write_unit
645 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
646END INTERFACE
647
648#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
649#define VOL7D_POLY_TYPES _ana
650#define ENABLE_SORT
651#include "array_utilities_pre.F90"
652
654INTERFACE to_char
655 MODULE PROCEDURE to_char_ana
656END INTERFACE
657
659INTERFACE display
660 MODULE PROCEDURE display_ana
661END INTERFACE
662
663CONTAINS
664
668SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
669TYPE(vol7d_ana),INTENT(INOUT) :: this
670REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
671REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
672CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
673INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
674INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
675
676CALL init(this%coord, lon=lon, lat=lat , ilon=ilon, ilat=ilat)
677IF (PRESENT(ident)) THEN
678 this%ident = ident
679ELSE
680 this%ident = cmiss
681ENDIF
682
683END SUBROUTINE vol7d_ana_init
684
685
687SUBROUTINE vol7d_ana_delete(this)
688TYPE(vol7d_ana),INTENT(INOUT) :: this
689
690CALL delete(this%coord)
691this%ident = cmiss
692
693END SUBROUTINE vol7d_ana_delete
694
695
696
697character(len=80) function to_char_ana(this)
698
699TYPE(vol7d_ana),INTENT(in) :: this
700
701to_char_ana="ANA: "//&
702 to_char(getlon(this%coord),miss="Missing lon",form="(f11.5)")//&
703 to_char(getlat(this%coord),miss="Missing lat",form="(f11.5)")//&
704 t2c(this%ident,miss="Missing ident")
705
706return
707
708end function to_char_ana
709
710
711subroutine display_ana(this)
712
713TYPE(vol7d_ana),INTENT(in) :: this
714
715print*, trim(to_char(this))
716
717end subroutine display_ana
718
719
720ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
721TYPE(vol7d_ana),INTENT(IN) :: this, that
722LOGICAL :: res
723
724res = this%coord == that%coord .AND. this%ident == that%ident
725
726END FUNCTION vol7d_ana_eq
727
728
729ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
730TYPE(vol7d_ana),INTENT(IN) :: this, that
731LOGICAL :: res
732
733res = .NOT.(this == that)
734
735END FUNCTION vol7d_ana_ne
736
737
738ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
739TYPE(vol7d_ana),INTENT(IN) :: this, that
740LOGICAL :: res
741
742res = this%ident > that%ident
743
744if ( this%ident == that%ident) then
745 res =this%coord > that%coord
746end if
747
748END FUNCTION vol7d_ana_gt
749
750
751ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
752TYPE(vol7d_ana),INTENT(IN) :: this, that
753LOGICAL :: res
754
755res = .not. this < that
756
757END FUNCTION vol7d_ana_ge
758
759
760ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
761TYPE(vol7d_ana),INTENT(IN) :: this, that
762LOGICAL :: res
763
764res = this%ident < that%ident
765
766if ( this%ident == that%ident) then
767 res = this%coord < that%coord
768end if
769
770END FUNCTION vol7d_ana_lt
771
772
773ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
774TYPE(vol7d_ana),INTENT(IN) :: this, that
775LOGICAL :: res
776
777res = .not. (this > that)
778
779END FUNCTION vol7d_ana_le
780
781
782
783ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
784TYPE(vol7d_ana),INTENT(IN) :: this
785LOGICAL :: c_e
786c_e = this /= vol7d_ana_miss
787END FUNCTION vol7d_ana_c_e
788
789
794SUBROUTINE vol7d_ana_read_unit(this, unit)
795TYPE(vol7d_ana),INTENT(out) :: this
796INTEGER, INTENT(in) :: unit
797
798CALL vol7d_ana_vect_read_unit((/this/), unit)
799
800END SUBROUTINE vol7d_ana_read_unit
801
802
807SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
808TYPE(vol7d_ana) :: this(:)
809INTEGER, INTENT(in) :: unit
810
811CHARACTER(len=40) :: form
812
813CALL read_unit(this%coord, unit)
814INQUIRE(unit, form=form)
815IF (form == 'FORMATTED') THEN
816 READ(unit,'(A)')this(:)%ident
817ELSE
818 READ(unit)this(:)%ident
819ENDIF
820
821END SUBROUTINE vol7d_ana_vect_read_unit
822
823
828SUBROUTINE vol7d_ana_write_unit(this, unit)
829TYPE(vol7d_ana),INTENT(in) :: this
830INTEGER, INTENT(in) :: unit
831
832CALL vol7d_ana_vect_write_unit((/this/), unit)
833
834END SUBROUTINE vol7d_ana_write_unit
835
836
841SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
842TYPE(vol7d_ana),INTENT(in) :: this(:)
843INTEGER, INTENT(in) :: unit
844
845CHARACTER(len=40) :: form
846
847CALL write_unit(this%coord, unit)
848INQUIRE(unit, form=form)
849IF (form == 'FORMATTED') THEN
850 WRITE(unit,'(A)')this(:)%ident
851ELSE
852 WRITE(unit)this(:)%ident
853ENDIF
854
855END SUBROUTINE vol7d_ana_vect_write_unit
856
857
858#include "array_utilities_inc.F90"
859
860
861END MODULE vol7d_ana_class
check for missing value
Distruttore per la classe vol7d_ana.
Costruttore per la classe vol7d_ana.
Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da un file FORMATTED o UNFORMATTED.
Represent ana object in a pretty string.
Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su un file FORMATTED o UNFORMATTED.
Classes for handling georeferenced sparse points in geographical corodinates.
Definition of constants to be used for declaring variables of a desired type.
Definition: kinds.F90:245
Definitions of constants and functions for working with missing values.
Classe per la gestione dell'anagrafica di stazioni meteo e affini.
Definisce l'anagrafica di una stazione.

Generated with Doxygen.