libsim Versione 7.2.1

◆ vol7d_ana_read_unit()

subroutine vol7d_ana_read_unit ( type(vol7d_ana), intent(out) 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
[out]thisobject to be read
[in]unitunit from which to read, it must be an opened Fortran file unit

Definizione alla linea 512 del file vol7d_ana_class.F90.

513! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
514! authors:
515! Davide Cesari <dcesari@arpa.emr.it>
516! Paolo Patruno <ppatruno@arpa.emr.it>
517
518! This program is free software; you can redistribute it and/or
519! modify it under the terms of the GNU General Public License as
520! published by the Free Software Foundation; either version 2 of
521! the License, or (at your option) any later version.
522
523! This program is distributed in the hope that it will be useful,
524! but WITHOUT ANY WARRANTY; without even the implied warranty of
525! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
526! GNU General Public License for more details.
527
528! You should have received a copy of the GNU General Public License
529! along with this program. If not, see <http://www.gnu.org/licenses/>.
530#include "config.h"
531
536MODULE vol7d_ana_class
537USE kinds
540IMPLICIT NONE
541
543INTEGER,PARAMETER :: vol7d_ana_lenident=20
544
549TYPE vol7d_ana
550 TYPE(geo_coord) :: coord
551 CHARACTER(len=vol7d_ana_lenident) :: ident
552END TYPE vol7d_ana
553
555TYPE(vol7d_ana),PARAMETER :: vol7d_ana_miss=vol7d_ana(geo_coord_miss,cmiss)
556
560INTERFACE init
561 MODULE PROCEDURE vol7d_ana_init
562END INTERFACE
563
566INTERFACE delete
567 MODULE PROCEDURE vol7d_ana_delete
568END INTERFACE
569
573INTERFACE OPERATOR (==)
574 MODULE PROCEDURE vol7d_ana_eq
575END INTERFACE
576
580INTERFACE OPERATOR (/=)
581 MODULE PROCEDURE vol7d_ana_ne
582END INTERFACE
583
584
589INTERFACE OPERATOR (>)
590 MODULE PROCEDURE vol7d_ana_gt
591END INTERFACE
592
597INTERFACE OPERATOR (<)
598 MODULE PROCEDURE vol7d_ana_lt
599END INTERFACE
600
605INTERFACE OPERATOR (>=)
606 MODULE PROCEDURE vol7d_ana_ge
607END INTERFACE
608
613INTERFACE OPERATOR (<=)
614 MODULE PROCEDURE vol7d_ana_le
615END INTERFACE
616
617
619INTERFACE c_e
620 MODULE PROCEDURE vol7d_ana_c_e
621END INTERFACE
622
625INTERFACE read_unit
626 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
627END INTERFACE
628
631INTERFACE write_unit
632 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
633END INTERFACE
634
635#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
636#define VOL7D_POLY_TYPES _ana
637#define ENABLE_SORT
638#include "array_utilities_pre.F90"
639
641INTERFACE to_char
642 MODULE PROCEDURE to_char_ana
643END INTERFACE
644
646INTERFACE display
647 MODULE PROCEDURE display_ana
648END INTERFACE
649
650CONTAINS
651
655SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
656TYPE(vol7d_ana),INTENT(INOUT) :: this
657REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
658REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
659CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
660INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
661INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
662
663CALL init(this%coord, lon=lon, lat=lat , ilon=ilon, ilat=ilat)
664IF (PRESENT(ident)) THEN
665 this%ident = ident
666ELSE
667 this%ident = cmiss
668ENDIF
669
670END SUBROUTINE vol7d_ana_init
671
672
674SUBROUTINE vol7d_ana_delete(this)
675TYPE(vol7d_ana),INTENT(INOUT) :: this
676
677CALL delete(this%coord)
678this%ident = cmiss
679
680END SUBROUTINE vol7d_ana_delete
681
682
683
684character(len=80) function to_char_ana(this)
685
686TYPE(vol7d_ana),INTENT(in) :: this
687
688to_char_ana="ANA: "//&
689 to_char(getlon(this%coord),miss="Missing lon",form="(f11.5)")//&
690 to_char(getlat(this%coord),miss="Missing lat",form="(f11.5)")//&
691 t2c(this%ident,miss="Missing ident")
692
693return
694
695end function to_char_ana
696
697
698subroutine display_ana(this)
699
700TYPE(vol7d_ana),INTENT(in) :: this
701
702print*, trim(to_char(this))
703
704end subroutine display_ana
705
706
707ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
708TYPE(vol7d_ana),INTENT(IN) :: this, that
709LOGICAL :: res
710
711res = this%coord == that%coord .AND. this%ident == that%ident
712
713END FUNCTION vol7d_ana_eq
714
715
716ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
717TYPE(vol7d_ana),INTENT(IN) :: this, that
718LOGICAL :: res
719
720res = .NOT.(this == that)
721
722END FUNCTION vol7d_ana_ne
723
724
725ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
726TYPE(vol7d_ana),INTENT(IN) :: this, that
727LOGICAL :: res
728
729res = this%ident > that%ident
730
731if ( this%ident == that%ident) then
732 res =this%coord > that%coord
733end if
734
735END FUNCTION vol7d_ana_gt
736
737
738ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
739TYPE(vol7d_ana),INTENT(IN) :: this, that
740LOGICAL :: res
741
742res = .not. this < that
743
744END FUNCTION vol7d_ana_ge
745
746
747ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
748TYPE(vol7d_ana),INTENT(IN) :: this, that
749LOGICAL :: res
750
751res = this%ident < that%ident
752
753if ( this%ident == that%ident) then
754 res = this%coord < that%coord
755end if
756
757END FUNCTION vol7d_ana_lt
758
759
760ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
761TYPE(vol7d_ana),INTENT(IN) :: this, that
762LOGICAL :: res
763
764res = .not. (this > that)
765
766END FUNCTION vol7d_ana_le
767
768
769
770ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
771TYPE(vol7d_ana),INTENT(IN) :: this
772LOGICAL :: c_e
773c_e = this /= vol7d_ana_miss
774END FUNCTION vol7d_ana_c_e
775
776
781SUBROUTINE vol7d_ana_read_unit(this, unit)
782TYPE(vol7d_ana),INTENT(out) :: this
783INTEGER, INTENT(in) :: unit
784
785CALL vol7d_ana_vect_read_unit((/this/), unit)
786
787END SUBROUTINE vol7d_ana_read_unit
788
789
794SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
795TYPE(vol7d_ana) :: this(:)
796INTEGER, INTENT(in) :: unit
797
798CHARACTER(len=40) :: form
799
800CALL read_unit(this%coord, unit)
801INQUIRE(unit, form=form)
802IF (form == 'FORMATTED') THEN
803 READ(unit,'(A)')this(:)%ident
804ELSE
805 READ(unit)this(:)%ident
806ENDIF
807
808END SUBROUTINE vol7d_ana_vect_read_unit
809
810
815SUBROUTINE vol7d_ana_write_unit(this, unit)
816TYPE(vol7d_ana),INTENT(in) :: this
817INTEGER, INTENT(in) :: unit
818
819CALL vol7d_ana_vect_write_unit((/this/), unit)
820
821END SUBROUTINE vol7d_ana_write_unit
822
823
828SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
829TYPE(vol7d_ana),INTENT(in) :: this(:)
830INTEGER, INTENT(in) :: unit
831
832CHARACTER(len=40) :: form
833
834CALL write_unit(this%coord, unit)
835INQUIRE(unit, form=form)
836IF (form == 'FORMATTED') THEN
837 WRITE(unit,'(A)')this(:)%ident
838ELSE
839 WRITE(unit)this(:)%ident
840ENDIF
841
842END SUBROUTINE vol7d_ana_vect_write_unit
843
844
845#include "array_utilities_inc.F90"
846
847
848END 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.