libsim Versione 7.1.11
|
◆ vol7d_ana_vect_read_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.
Definizione alla linea 531 del file vol7d_ana_class.F90. 532! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
533! authors:
534! Davide Cesari <dcesari@arpa.emr.it>
535! Paolo Patruno <ppatruno@arpa.emr.it>
536
537! This program is free software; you can redistribute it and/or
538! modify it under the terms of the GNU General Public License as
539! published by the Free Software Foundation; either version 2 of
540! the License, or (at your option) any later version.
541
542! This program is distributed in the hope that it will be useful,
543! but WITHOUT ANY WARRANTY; without even the implied warranty of
544! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
545! GNU General Public License for more details.
546
547! You should have received a copy of the GNU General Public License
548! along with this program. If not, see <http://www.gnu.org/licenses/>.
549#include "config.h"
550
559IMPLICIT NONE
560
562INTEGER,PARAMETER :: vol7d_ana_lenident=20
563
569 TYPE(geo_coord) :: coord
570 CHARACTER(len=vol7d_ana_lenident) :: ident
572
575
580 MODULE PROCEDURE vol7d_ana_init
581END INTERFACE
582
586 MODULE PROCEDURE vol7d_ana_delete
587END INTERFACE
588
592INTERFACE OPERATOR (==)
593 MODULE PROCEDURE vol7d_ana_eq
594END INTERFACE
595
599INTERFACE OPERATOR (/=)
600 MODULE PROCEDURE vol7d_ana_ne
601END INTERFACE
602
603
608INTERFACE OPERATOR (>)
609 MODULE PROCEDURE vol7d_ana_gt
610END INTERFACE
611
616INTERFACE OPERATOR (<)
617 MODULE PROCEDURE vol7d_ana_lt
618END INTERFACE
619
624INTERFACE OPERATOR (>=)
625 MODULE PROCEDURE vol7d_ana_ge
626END INTERFACE
627
632INTERFACE OPERATOR (<=)
633 MODULE PROCEDURE vol7d_ana_le
634END INTERFACE
635
636
639 MODULE PROCEDURE vol7d_ana_c_e
640END INTERFACE
641
645 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
646END INTERFACE
647
651 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
652END INTERFACE
653
654#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
655#define VOL7D_POLY_TYPES _ana
656#define ENABLE_SORT
657#include "array_utilities_pre.F90"
658
661 MODULE PROCEDURE to_char_ana
662END INTERFACE
663
666 MODULE PROCEDURE display_ana
667END INTERFACE
668
669CONTAINS
670
674SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
675TYPE(vol7d_ana),INTENT(INOUT) :: this
676REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
677REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
678CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
679INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
680INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
681
683IF (PRESENT(ident)) THEN
684 this%ident = ident
685ELSE
686 this%ident = cmiss
687ENDIF
688
689END SUBROUTINE vol7d_ana_init
690
691
693SUBROUTINE vol7d_ana_delete(this)
694TYPE(vol7d_ana),INTENT(INOUT) :: this
695
697this%ident = cmiss
698
699END SUBROUTINE vol7d_ana_delete
700
701
702
703character(len=80) function to_char_ana(this)
704
705TYPE(vol7d_ana),INTENT(in) :: this
706
707to_char_ana="ANA: "//&
710 t2c(this%ident,miss="Missing ident")
711
712return
713
714end function to_char_ana
715
716
717subroutine display_ana(this)
718
719TYPE(vol7d_ana),INTENT(in) :: this
720
721print*, trim(to_char(this))
722
723end subroutine display_ana
724
725
726ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
727TYPE(vol7d_ana),INTENT(IN) :: this, that
728LOGICAL :: res
729
730res = this%coord == that%coord .AND. this%ident == that%ident
731
732END FUNCTION vol7d_ana_eq
733
734
735ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
736TYPE(vol7d_ana),INTENT(IN) :: this, that
737LOGICAL :: res
738
739res = .NOT.(this == that)
740
741END FUNCTION vol7d_ana_ne
742
743
744ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
745TYPE(vol7d_ana),INTENT(IN) :: this, that
746LOGICAL :: res
747
748res = this%ident > that%ident
749
750if ( this%ident == that%ident) then
751 res =this%coord > that%coord
752end if
753
754END FUNCTION vol7d_ana_gt
755
756
757ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
758TYPE(vol7d_ana),INTENT(IN) :: this, that
759LOGICAL :: res
760
761res = .not. this < that
762
763END FUNCTION vol7d_ana_ge
764
765
766ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
767TYPE(vol7d_ana),INTENT(IN) :: this, that
768LOGICAL :: res
769
770res = this%ident < that%ident
771
772if ( this%ident == that%ident) then
773 res = this%coord < that%coord
774end if
775
776END FUNCTION vol7d_ana_lt
777
778
779ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
780TYPE(vol7d_ana),INTENT(IN) :: this, that
781LOGICAL :: res
782
783res = .not. (this > that)
784
785END FUNCTION vol7d_ana_le
786
787
788
789ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
790TYPE(vol7d_ana),INTENT(IN) :: this
791LOGICAL :: c_e
792c_e = this /= vol7d_ana_miss
793END FUNCTION vol7d_ana_c_e
794
795
800SUBROUTINE vol7d_ana_read_unit(this, unit)
801TYPE(vol7d_ana),INTENT(out) :: this
802INTEGER, INTENT(in) :: unit
803
804CALL vol7d_ana_vect_read_unit((/this/), unit)
805
806END SUBROUTINE vol7d_ana_read_unit
807
808
813SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
814TYPE(vol7d_ana) :: this(:)
815INTEGER, INTENT(in) :: unit
816
817CHARACTER(len=40) :: form
818
820INQUIRE(unit, form=form)
821IF (form == 'FORMATTED') THEN
822 READ(unit,'(A)')this(:)%ident
823ELSE
824 READ(unit)this(:)%ident
825ENDIF
826
827END SUBROUTINE vol7d_ana_vect_read_unit
828
829
834SUBROUTINE vol7d_ana_write_unit(this, unit)
835TYPE(vol7d_ana),INTENT(in) :: this
836INTEGER, INTENT(in) :: unit
837
838CALL vol7d_ana_vect_write_unit((/this/), unit)
839
840END SUBROUTINE vol7d_ana_write_unit
841
842
847SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
848TYPE(vol7d_ana),INTENT(in) :: this(:)
849INTEGER, INTENT(in) :: unit
850
851CHARACTER(len=40) :: form
852
854INQUIRE(unit, form=form)
855IF (form == 'FORMATTED') THEN
856 WRITE(unit,'(A)')this(:)%ident
857ELSE
858 WRITE(unit)this(:)%ident
859ENDIF
860
861END SUBROUTINE vol7d_ana_vect_write_unit
862
863
864#include "array_utilities_inc.F90"
865
866
Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da un file FORMATTED o UNFORMATTED. Definition: vol7d_ana_class.F90:307 Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su un file FORMATTED o UNFORMATTED. Definition: vol7d_ana_class.F90:313 Classes for handling georeferenced sparse points in geographical corodinates. Definition: geo_coord_class.F90:222 Definition of constants to be used for declaring variables of a desired type. Definition: kinds.F90:251 Definitions of constants and functions for working with missing values. Definition: missing_values.f90:50 Classe per la gestione dell'anagrafica di stazioni meteo e affini. Definition: vol7d_ana_class.F90:218 Definisce l'anagrafica di una stazione. Definition: vol7d_ana_class.F90:231 |